StreamVideoThumbnailImage constructor
const
StreamVideoThumbnailImage({})
A custom ImageProvider class for loading video thumbnails as images in Flutter.
Use this class to load a video thumbnail as an image. It takes a video URL or path and generates a thumbnail image from the video. The generated thumbnail image can be used with the Image widget.
{@tool snippet} Load a video thumbnail from a URL:
Image(
image: StreamVideoThumbnailImage(
video: 'https://example.com/video.mp4',
maxHeight: 200,
maxWidth: 200,
),
)
{@end-tool}
{@tool snippet} Load a video thumbnail from a local file path:
Image(
image: StreamVideoThumbnailImage(
video: '/path/to/video.mp4',
maxHeight: 200,
maxWidth: 200,
),
)
{@end-tool}
Implementation
const StreamVideoThumbnailImage({
required this.video,
this.headers,
this.imageFormat = ImageFormat.PNG,
this.maxHeight = 0,
this.maxWidth = 0,
this.timeMs = 0,
this.quality = 10,
this.scale = 1.0,
});