Display thumbnails
A thumbnail from your video can be generated using a special link where you specify the time from the video you’d like to get the thumbnail from.
https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg?time=1s&height=270
Using the poster
query parameter in the embed URL, you can set a thumbnail to any time in your video. If signed URLs are required, you must use a signed URL instead of video UIDs.
Supported URL attributes are:
time
(default0s
, configurable) time from the video e.g.8m
,5m2s
height
(default640
)width
(default640
)fit
(defaultcrop
) to clarify what to do when requested height and width doesn’t match the original upload, which should be one of:crop
cut parts of the video that doesn’t fit in the given sizeclip
preserve the entire frame and decrease the size of the image within given sizescale
distort the image to fit the given sizefill
preserve the entire frame and fill the rest of the requested size with black background
By default, the Stream Player sets the thumbnail to the first frame of the video. You can change this on a per-video basis by setting the “thumbnailTimestampPct” value using the API:
thumbnailTimestampPct
is a value between 0.0 (the first frame of the video) and 1.0 (the last frame of the video). For example, you wanted the thumbnail to be the frame at the half way point of your videos, you can set the thumbnailTimestampPct
value to 0.5. Using relative values in this way allows you to set the default thumbnail even if you or your users’ videos vary in duration.
Stream supports animated GIFs as thumbnails. Viewing animated thumbnails does not count toward billed minutes delivered or minutes viewed in Stream Analytics.
https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.gif?time=1s&height=200&duration=4s
Supported URL attributes for animated thumbnails are:
time
(default0s
) time from the video e.g.8m
,5m2s
height
(default640
)width
(default640
)fit
(defaultcrop
) to clarify what to do when requested height and width doesn’t match the original upload, which should be one of:crop
cut parts of the video that doesn’t fit in the given sizeclip
preserve the entire frame and decrease the size of the image within given sizescale
distort the image to fit the given sizefill
preserve the entire frame and fill the rest of the requested size with black background
duration
(default5s
)fps
(default8
)