New Feature: Thumbnail Timestamp Percentages

Hey there!

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: https://cloudflarestream.com/5d5bc37ffcf54c9b82e996823bffbb81/thumbnails/thumbnail.jpg?time=68s

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: https://cloudflarestream.com/5d5bc37ffcf54c9b82e996823bffbb81/thumbnails/thumbnail.jpg

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 :slight_smile:

Out of curiosity, how many decimal places can you use in this parameter? Docs only show tenths.

15 decimal digits of precision. So if you submitted 0.05555551343245634634534535, we’d truncate to 0.0555555134324563. It should be enough for frame accuracy on most videos, even though accuracy is not the intent of this API.

1 Like