Video Player Web Test - Dart
Video Player Web Test - Dart
Video Player Web Test - Dart
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:video_player/video_player.dart';
import 'package:video_player_platform_interface/video_player_platform_interface.
dart';
import 'package:video_player_web/video_player_web.dart';
void main() {
group('VideoPlayer for Web', () {
int textureId;
setUp(() async {
VideoPlayerPlatform.instance = VideoPlayerPlugin();
textureId = await VideoPlayerPlatform.instance.create(
DataSource(
sourceType: DataSourceType.network,
uri:
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee
.mp4'),
);
});
test('can init', () {
expect(VideoPlayerPlatform.instance.init(), completes);
});
test('can dispose', () {
expect(VideoPlayerPlatform.instance.dispose(textureId), completes);
});
Stream<VideoEvent> eventStream =
VideoPlayerPlatform.instance.videoEventsFor(videoPlayerId);
expect(eventStream, emitsError(isA<PlatformException>()));
});
test('can pause', () {
expect(VideoPlayerPlatform.instance.pause(textureId), completes);
});