seel-channel / video_viewer

FLUTTER PACKAGE: Multiplatform minimalist video viewer with spectacular user experience.
https://pub.dev/packages/video_viewer
MIT License
56 stars 57 forks source link

Play video from Uint8List #30

Closed rupamking1 closed 3 years ago

rupamking1 commented 3 years ago

Play video from Uint8List

seel-channel commented 3 years ago

You can use this.

VideoPlayerController fromUint8List(
    String path,
    Uint8List bytes, {
    Future<ClosedCaptionFile>? closedCaptionFile,
    VideoPlayerOptions? videoPlayerOptions,
  }) {
    final File file = File(path);
    file.writeAsBytesSync(bytes);
    return VideoPlayerController.file(
      file,
      closedCaptionFile: closedCaptionFile,
      videoPlayerOptions: videoPlayerOptions,
    );
  }