flutter_media_picker/lib/video_player/video_player_web.dart

14 lines
373 B
Dart
Raw Normal View History

2022-10-25 14:20:18 +02:00
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'dart:typed_data';
import 'package:video_player/video_player.dart';
class VideoPlayerWrapper {
Future<VideoPlayerController> getController(Uint8List video) async {
final blob = Blob([video]);
final url = Url.createObjectUrlFromBlob(blob);
return VideoPlayerController.network(url);
}
}