@@ -11,6 +11,22 @@ import 'package:integration_test/integration_test.dart';
1111import 'package:video_player_platform_interface/video_player_platform_interface.dart' ;
1212import 'package:video_player_web/video_player_web.dart' ;
1313
14+ // Returns the URL to load an asset from this example app as a network source.
15+ //
16+ // TODO(stuartmorgan): Convert this to a local `HttpServer` that vends the
17+ // assets directly, https://github.com/flutter/flutter/issues/95420
18+ String getUrlForAssetAsNetworkSource (String assetKey) {
19+ return 'https://github.com/flutter/plugins/blob/'
20+ // This hash can be rolled forward to pick up newly-added assets.
21+ 'cb381ced070d356799dddf24aca38ce0579d3d7b'
22+ '/packages/video_player/video_player/example/'
23+ '$assetKey '
24+ '?raw=true' ;
25+ }
26+
27+ // Use WebM for web to allow CI to use Chromium.
28+ const String _videoAssetKey = 'assets/Butterfly-209.webm' ;
29+
1430void main () {
1531 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
1632
@@ -23,8 +39,7 @@ void main() {
2339 .create (
2440 DataSource (
2541 sourceType: DataSourceType .network,
26- uri:
27- 'https://github.com/flutter/plugins/blob/main/packages/video_player/video_player/example/assets/Butterfly-209.webm?raw=true' ,
42+ uri: getUrlForAssetAsNetworkSource (_videoAssetKey),
2843 ),
2944 )
3045 .then ((int ? textureId) => textureId! );
@@ -38,9 +53,9 @@ void main() {
3853 expect (
3954 VideoPlayerPlatform .instance.create (
4055 DataSource (
41- sourceType: DataSourceType .network,
42- uri:
43- 'https://github.com/flutter/plugins/blob/main/packages/video_player/video_player/example/assets/Butterfly-209.webm?raw=true' ),
56+ sourceType: DataSourceType .network,
57+ uri: getUrlForAssetAsNetworkSource (_videoAssetKey),
58+ ),
4459 ),
4560 completion (isNonZero));
4661 });
@@ -100,9 +115,9 @@ void main() {
100115 (WidgetTester tester) async {
101116 final int videoPlayerId = (await VideoPlayerPlatform .instance.create (
102117 DataSource (
103- sourceType: DataSourceType .network,
104- uri:
105- 'https://flutter.github.io/assets-for-api-docs/assets/videos/_non_existent_video.mp4' ),
118+ sourceType: DataSourceType .network,
119+ uri: getUrlForAssetAsNetworkSource ( 'assets/__non_existent.webm' ),
120+ ),
106121 ))! ;
107122
108123 final Stream <VideoEvent > eventStream =
0 commit comments