Repository navigation
[video_player][iOS] VideoPlayerController.value.position not updating on video completion for video_player_avfoundation > 2.4.2 #124475
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 10, 2023 Hi @neeraj-dhake
I'm checking this on the latest plugin version:video_player: ^2.6.1andvideo_player_avfoundation: ^2.4.4but don't see the issue. Verified oniPhone 7, iOS 15.7.2.Which
video_playerversion are you using? How often does this issue happen?- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 10, 2023 I have the same versions as you.
This is my pubspec.lock file:
# Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: async: dependency: transitive description: name: async sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.dev" source: hosted version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted version: "2.1.1" characters: dependency: transitive description: name: characters sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.dev" source: hosted version: "1.2.1" clock: dependency: transitive description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.dev" source: hosted version: "1.17.0" csslib: dependency: transitive description: name: csslib sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 url: "https://pub.dev" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be url: "https://pub.dev" source: hosted version: "1.0.5" fake_async: dependency: transitive description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted version: "1.3.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" flutter_lints: dependency: "direct dev" description: name: flutter_lints sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" flutter_web_plugins: dependency: transitive description: flutter source: sdk version: "0.0.0" html: dependency: transitive description: name: html sha256: "79d498e6d6761925a34ee5ea8fa6dfef38607781d2fa91e37523474282af55cb" url: "https://pub.dev" source: hosted version: "0.15.2" js: dependency: transitive description: name: js sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" url: "https://pub.dev" source: hosted version: "0.6.5" lints: dependency: transitive description: name: lints sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" url: "https://pub.dev" source: hosted version: "2.0.1" matcher: dependency: transitive description: name: matcher sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.dev" source: hosted version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted version: "0.2.0" meta: dependency: transitive description: name: meta sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.dev" source: hosted version: "1.8.0" path: dependency: transitive description: name: path sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.dev" source: hosted version: "1.8.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" url: "https://pub.dev" source: hosted version: "2.1.4" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" source_span: dependency: transitive description: name: source_span sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 url: "https://pub.dev" source: hosted version: "0.4.16" vector_math: dependency: transitive description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" url: "https://pub.dev" source: hosted version: "2.1.4" video_player: dependency: "direct main" description: name: video_player sha256: de95f0e9405f29b5582573d4166132e71f83b3158aac14e8ee5767a54f4f1fbd url: "https://pub.dev" source: hosted version: "2.6.1" video_player_android: dependency: transitive description: name: video_player_android sha256: a592048a711d5739d9cea2255d425779f138d41095b9149bda60ce4bc1af8871 url: "https://pub.dev" source: hosted version: "2.4.4" video_player_avfoundation: dependency: "direct main" description: name: video_player_avfoundation sha256: "75c6d68cd479a25f34d635149ba6887bc8f1b2b2921841121fd44ea0c5bc1927" url: "https://pub.dev" source: hosted version: "2.4.4" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface sha256: a8c4dcae2a7a6e7cc1d7f9808294d968eca1993af34a98e95b9bdfa959bec684 url: "https://pub.dev" source: hosted version: "6.1.0" video_player_web: dependency: transitive description: name: video_player_web sha256: "44ce41424d104dfb7cf6982cc6b84af2b007a24d126406025bf40de5d481c74c" url: "https://pub.dev" source: hosted version: "2.0.16" sdks: dart: ">=2.19.6 <3.0.0" flutter: ">=3.3.0"It happened every time for me (although on an internal stream URL, which unfortunately I can't share). We actually started noticing this on our content which is also kaltura delivered, and there it happens 100% of the time on multiple iOS devices - iPhone XS, iPhone 12, iPhone 13 Pro, regardless of whether there's seek or not.
For the URL I linked, it happened to me 3/3 times that I tested yesterday, however now it didn't. But I could reproduce 10/10 times it by seeking to 2 min at the beginning while initializing, and it didn't happen when the
video_player_avfoundation = 2.4.1:initializeVideoPlayerFuture = controller .initialize() .then((value) => controller.seekTo(const Duration(minutes: 2)));
- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 10, 2023 Thanks for your response. Now I can reproduce the issue when using above snippet code.
And as you said, it only happens on the latest version
video_player_avfoundation: ^2.4.4but it works as expected onvideo_player_avfoundation: 2.4.1.Complete sample code
import 'package:flutter/material.dart'; import 'package:video_player/video_player.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar(title: const Text('Video Player')), body: const VideoPlayerExample(), ), ); } } class VideoPlayerExample extends StatefulWidget { const VideoPlayerExample({super.key}); @override VideoPlayerExampleState createState() => VideoPlayerExampleState(); } class VideoPlayerExampleState extends State<VideoPlayerExample> { final controller = VideoPlayerController.network( 'https://cdnapisec.kaltura.com/p/309/sp/0/playManifest/entryId/1_rcit0qgs/format/applehttp/protocol/https/flavorParamId/301971/manifest.m3u8', ); late Future<void> initializeVideoPlayerFuture; @override void initState() { initializeVideoPlayerFuture = controller.initialize().then((value) => controller.seekTo(const Duration(minutes: 2))); controller.play(); controller.addListener(listener); super.initState(); } @override void dispose() { controller.removeListener(listener); controller.dispose(); super.dispose(); } void listener() { setState(() {}); } @override Widget build(BuildContext context) { return Column( children: [ FutureBuilder( future: initializeVideoPlayerFuture, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { return AspectRatio( aspectRatio: controller.value.aspectRatio, child: VideoPlayer(controller), ); } else { return const CircularProgressIndicator(); } }, ), const SizedBox(height: 20), Text( controller.value.position >= controller.value.duration ? 'Completed' : 'Playing', style: const TextStyle(fontSize: 24), ), ], ); } }
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.10, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.7.10 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4b12645012 (2 days ago), 2023-04-03 17:46:48 -0700 • Engine revision ec975089ac • Dart version 2.19.6 • DevTools version 2.20.1 [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 32.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.77.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.60.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 111.0.5563.146 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found![!] Flutter (Channel master, 3.10.0-3.0.pre.30, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.10.0-3.0.pre.30 on channel master at /Users/huynq/Documents/GitHub/flutter_master ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2cf8502589 (7 minutes ago), 2023-04-10 20:21:24 -0700 • Engine revision 4a7f3f2a1f • Dart version 3.0.0 (build 3.0.0-427.0.dev) • DevTools version 2.23.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 32.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.77.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.62.0 [✓] Connected device (3 available) • SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.49 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category.
- addedc: regressionIt was better in the past than it is nowIt was better in the past than it is nowplatform-iosiOS applications specificallyiOS applications specificallyp: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.10Found to occur in 3.10Found to occur in 3.10and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 11, 2023 - addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work list
on Apr 11, 2023 - added a commit that references this issue
on May 11, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on May 12, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on May 26, 2023 - added a commit that references this issue
on Jun 1, 2023 - added a commit that references this issue
on Jul 16, 2023 - added a commit that references this issue
on Jun 10, 2026 - added a commit that references this issue
on Jun 19, 2026

Steps to Reproduce
flutter runon the code sample linked below.video_player_avfoundationto2.4.1Expected results: The text below the video should get updated to
CompletedActual results: The text below the video doesn't get updated to
Completedand remainsisPlayingFrom my debugging, what I could see was that the following code was triggered:
but in the
seekTofunction, the following does not complete:The change in
video_player_avfoundation = 2.4.2was to make the seek async, so its highly likely that this is the issue.Code sample
`main.dart`:pubspec.yaml:Logs
Run
flutter analyzeand attach any output of that command below.Finally, paste the output of running
flutter doctor -vhere.