I work on the Stream team at Cloudflare. Many of you know the way get thumbnails on a video based on URL query parameters. You can use these images with the Stream player using the
poster attribute. For example this URL will get you an image from 68 seconds into the video:
I’d like to highlight a new feature: there is a new
thumbnailTimestampPct value, which is a floating number between 0 and 1 in the Stream API.
By changing this value, you can change location of thumbnail image calculated as a percentage value of the video’s duration. Setting this value to
0.5 will make the thumbnail from the frame at the midpoint of the video, and setting
0.1 will show the frame 10% into the video as the default thumbnail value.
So by changing this option, you can change the image displayed at the default thumbnail URL:
This feature could be useful for users who may have many videos in their account and would like to choose a custom default video thumbnail across videos, so you don’t have to go back and change the poster attribute on your website. You can specify this option at upload time too, so you don’t have to worry about determining the video duration and choosing a frame that works after.
What do you think? Have you already tried using this new feature yet? We’d love your feedback