Category: javascript

canvid.js tiny library for playing video on canvas elements

Half of the trick is done by converting the video into a long JPEG sprite, which is done beforehand with ffmpeg + ImageMagick. ffmpeg -i myvideo.mp4 -vf scale=375:-1 -r 5 frames/%04d.png montage -border 0 -geometry 375x -tile 6x -quality 60% frames/*.png myvideo.jpg The other half is the library. Better than animated GIFs. https://gka.github.io/canvid/#how-to-convert-your-video-to-a-jpg-sprite

You might not need jQuery

If you’re developing a library on the other hand, please take a moment to consider if you actually need jQuery as a dependency. Maybe you can include a few lines of utility code, and forgo the requirement. If you’re only targeting more modern browsers, you might not need anything more than what the browser ships… Read more