diff --git a/example/lib/app/app.dart b/example/lib/app/app.dart index 84970d9af..4718733a8 100644 --- a/example/lib/app/app.dart +++ b/example/lib/app/app.dart @@ -39,6 +39,7 @@ class _ChewieDemoState extends State { } List srcs = [ + "https://upload.wikimedia.org/wikipedia/commons/2/2c/Earth_rotation_during_Galileo_flyby_%28PIA00114%29_%28color-adjusted%29.webm", "https://assets.mixkit.co/videos/preview/mixkit-daytime-city-traffic-aerial-view-56-large.mp4", "https://assets.mixkit.co/videos/preview/mixkit-a-girl-blowing-a-bubble-gum-at-an-amusement-park-1226-large.mp4" ]; @@ -153,7 +154,10 @@ class _ChewieDemoState extends State { Future toggleVideo() async { await _videoPlayerController1.pause(); - currPlayIndex = currPlayIndex == 0 ? 1 : 0; + currPlayIndex += 1; + if (currPlayIndex >= srcs.length) { + currPlayIndex = 0; + } await initializePlayer(); } diff --git a/pubspec.yaml b/pubspec.yaml index edc3199fd..070ff3d06 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,11 @@ dependencies: flutter: sdk: flutter provider: ^6.0.1 - video_player: ^2.2.7 + video_player: + git: + url: https://github.com/henri2h/plugins.git + ref: henri/enhance-seeking-mechanism-test + path: packages/video_player/video_player wakelock: ^0.6.1+1 very_good_analysis: ^2.4.0