StreamVideoThumbnailImage constructor

const StreamVideoThumbnailImage({
  1. required String video,
  2. Map<String, String>? headers,
  3. ImageFormat imageFormat = ImageFormat.PNG,
  4. int maxHeight = 0,
  5. int maxWidth = 0,
  6. int timeMs = 0,
  7. int quality = 10,
  8. double scale = 1.0,
})

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,
});