@@ -11,6 +11,22 @@ import 'package:integration_test/integration_test.dart';
11
11
import 'package:video_player_platform_interface/video_player_platform_interface.dart' ;
12
12
import 'package:video_player_web/video_player_web.dart' ;
13
13
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
+
14
30
void main () {
15
31
IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
16
32
@@ -23,8 +39,7 @@ void main() {
23
39
.create (
24
40
DataSource (
25
41
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),
28
43
),
29
44
)
30
45
.then ((int ? textureId) => textureId! );
@@ -38,9 +53,9 @@ void main() {
38
53
expect (
39
54
VideoPlayerPlatform .instance.create (
40
55
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
+ ),
44
59
),
45
60
completion (isNonZero));
46
61
});
@@ -100,9 +115,9 @@ void main() {
100
115
(WidgetTester tester) async {
101
116
final int videoPlayerId = (await VideoPlayerPlatform .instance.create (
102
117
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
+ ),
106
121
))! ;
107
122
108
123
final Stream <VideoEvent > eventStream =
0 commit comments