thanks youin that example the image is painted by a function, how could I load a image or a video ..
just define proper mime type and put the video to output stream in the same way.