Search packages, repositories and app categories

Package detailsv1.0.6

cached_video_preview

Flutter plugin that can help you get remote or local video preview image and cache it.

AndroidiOS
30-day downloads
147
Likes
27
Pub points
125

Install package

flutter pub add cached_video_preview

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin that enables fetching and caching preview images from local or remote videos. It efficiently generates thumbnails by leveraging platform-specific video processing, reducing redundant network requests and improving performance. The cached results are stored locally for quick access on subsequent loads, enhancing user experience in media-heavy applications. Ideal for video galleries, social feeds, or any app requiring fast thumbnail generation.

Use cases

  • Video gallery thumbnail generation
  • Social media feed previews
  • Offline video content caching
  • Streaming app thumbnail loading
  • Media player UI enhancements

Key features

  • Remote and local video preview support
  • Automatic image caching
  • Cross-platform compatibility (Android/iOS)
  • Efficient thumbnail generation
  • Configurable cache size and duration

Suitable for

  • Apps with large video libraries
  • Media-rich applications
  • Performance-sensitive UIs
  • Offline-first video apps
  • Thumbnail-heavy interfaces

Considerations

  • Requires platform-specific permissions for file access
  • Cache management may need manual cleanup
  • Large video files may impact initial load time
  • Limited to static preview frames
  • Dependent on underlying platform video codecs

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Introduction

Cached Video Preview can help you get remote or local video preview image and cache it.

USAGE

This is example code how to implement this package.

Get Remote Video Image Preview extracting metadata in web pages

CachedVideoPreview(
  path: 'https://www.youtube.com/watch?v=b_sQ9bMltGU',
  type: SourceType.remote,
  remoteImageBuilder: (BuildContext context, url) =>
      Image.network(url),
)

Get Remote Video Image Preview from video url

CachedVideoPreview(
  path: 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
  type: SourceType.remote,
  httpHeaders: const <String, String>{},
  remoteImageBuilder: (BuildContext context, url) =>
      Image.network(url),
)

Get Local Video Image Preview from File path
final File video = File('video.mp4');

CachedVideoPreview(
  path: video.path,
  type: SourceType.local,
  fileImageBuilder: (context, bytes) =>
      Image.memory(bytes),
)

Acknowledgments

Thanks to the authors of these libraries metadata_fetch and video_thumbnail.

Contact and bugs

Use Issue Tracker for any questions or bug reports.

Categories

Dependencies

Dependency list 8 items

Source repository

Projects using this package

No data available yet.