bytes static method

FutureOr<VideoPlayerController> bytes(
  1. Uint8List bytes, {
  2. String? checksum,
  3. VideoPlayerOptions? videoPlayerOptions,
})

Creates a VideoPlayerController from the provided bytes.

Implementation

static FutureOr<VideoPlayerController> bytes(
  Uint8List bytes, {
  String? checksum,
  VideoPlayerOptions? videoPlayerOptions,
}) {
  final blob = web.Blob(
    [bytes.toJS].toJS,
    web.BlobPropertyBag(type: 'video/mp4'),
  );

  final String url = web.URL.createObjectURL(blob);
  return VideoPlayerController.networkUrl(
    Uri.parse(url),
    videoPlayerOptions: videoPlayerOptions,
  );
}