In the example above, we use a sprite image of 192x720 pixel size with 65 thumbnails, each of 192x108 pixel size, tiled vertically. The video length is relatively short, about 129 seconds, so it's easy to calculate that video thumbnails were extracted per ~2 seconds from the entire video length.
Code snippet
<script> var player = videojs('example_video_1'); player.nuevo({ slideImage: '//domain.com/path/to/sprite.jpg', slideType: 'vertical', //optional slideWidth: 160, //optional slideHeight: 90 //optional }); </script>
The Nuevo plugin features a custom method to control mouse-press events over the progress bar. This allows you to display a ghost thumb image as a video poster when the mouse is pressed and moved over the progress bar. To enable this feature, you must set the appropriate Nuevo plugin option.
Code snippet
<script> var player = videojs('example_video_1'); player.nuevo({ slideImage: '//domain.com/path/to/sprite.jpg',ghostThumb:true }); </script>
We created a simple spritevideo bash script to generate a ready jpg sprite image from a video file. The script requires ffmpeg installed on the server. The usage is simple.
Available arguments: -i video input file (required) -w width of the single thumb [optional], default=160 -h height of the simgle thumb [optional], default=90 -o directory relative path to process video thumbs (required) -p relative path for generated jpg sprite image file (required)