You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[video_player] Playback speed doesn't work when setting it before initialization #73643
I am mainly opening this issue to track the state of this. I am planning on fixing this myself.
Description
When setting the playback speed before initializing or when seeking, the playback speed is reset on the actual video (the video player value on the Flutter side has the set speed but the underlying player does not):
VideoPlayerController(..)
..setPlaybackSpeed(2) // This is ignored by the underlying player on iOS.
..initialize();
controller.seekTo(..); // This will also reset the playback speed on iOS.
Here I created a complete reproducible code sample with a test video and some buttons. I can reproduce the issue where playback speed doesn't work when set before initializing the video (works as expected to set it afterward). However, playback is working as expected when seeking to Duration.zero or Duration(minutes: 0), playback doesn't reset for me. Can you please try the code sample below and give me feedback on seekTo.
I have tested on the simulator and physical XR, both running iOS 14.3
Btw, I am using iPhone 12 Pro Max iOS 14.3 Simulator for testing, however, we also see this happening on all real devices.
And nevermind the play call. I tested this a bunch now and I can confirm that this always happens when seekTo is called (even without play). Did you use a different device for testing?
Source
I figured that it might be the audio source - we are using a stream over the internet as our audio source.
That is m3u8.
Hi @creativecreatorormaybenot
Thanks for the confirmation, it must stream source, I can't reproduce even with a longer video (NullSafety Video) with a .mp4 extension.
Since #71264 address the sekTo and it also reproduced using a stream #71264 (comment) but link no longer working to reproduce it again, I will retitle this issue for an initialization bug
Thank you
changed the title [-][video_player] Playback speed is reset on iOS[/-][+][video_player] Playback speed doesn't work when setting it before initialization [/+]on Jan 12, 2021
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 -v and a minimal reproduction of the issue.
Activity
TahaTesser commentedon Jan 11, 2021
Hi @creativecreatorormaybenot
Here I created a complete reproducible code sample with a test video and some buttons. I can reproduce the issue where playback speed doesn't work when set before initializing the video (works as expected to set it afterward). However, playback is working as expected when seeking to
Duration.zeroorDuration(minutes: 0), playback doesn't reset for me. Can you please try the code sample below and give me feedback onseekTo.I have tested on the simulator and physical XR, both running
iOS 14.3Code Sample
complete code sample
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-GB) • Flutter version 1.22.5 at /Users/tahatesser/Code/flutter_stable • Framework revision 7891006299 (5 weeks ago), 2020-12-10 11:54:40 -0800 • Engine revision ae90085a84 • Dart version 2.10.4 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Volumes/Extreme/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Volumes/Extreme/SDK • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.52.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.18.1 [✓] Connected device (2 available) • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.3 • iPhone 12 (mobile) • 2FC46D8B-2A58-4ABB-B3FF-76F1AEC857FF • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) ! Doctor found issues in 1 category.[✓] Flutter (Channel master, 1.26.0-2.0.pre.275, on macOS 11.1 20C69 darwin-x64, locale en-GB) • Flutter version 1.26.0-2.0.pre.275 at /Users/tahatesser/Code/flutter_master • Framework revision d9044a8a61 (2 days ago), 2021-01-09 04:04:04 -0500 • Engine revision caf6a8191f • Dart version 2.12.0 (build 2.12.0-204.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Volumes/Extreme/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Volumes/Extreme/SDK • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.52.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.18.1 [✓] Connected device (4 available) • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.3 • iPhone 12 (mobile) • 2FC46D8B-2A58-4ABB-B3FF-76F1AEC857FF • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 11.1 20C69 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.141 • No issues found!Thank you.
creativecreatorormaybenot commentedon Jan 11, 2021
@TahaTesser Thank you so much! ❤️
I will try to see about the
seekTo. I happens for us when we skip forward 10 seconds e.g.Will try to post an example later 👍
TahaTesser commentedon Jan 11, 2021
Hi @creativecreatorormaybenot
seekTorelated #71264However, it also doesn't reproduce for me #71264 (comment) here
Thank you
creativecreatorormaybenot commentedon Jan 11, 2021
@TahaTesser In our code, we call:
Maybe
playresets the playback speed 🤔creativecreatorormaybenot commentedon Jan 11, 2021
Btw, I am using iPhone 12 Pro Max iOS 14.3 Simulator for testing, however, we also see this happening on all real devices.
And nevermind the
playcall. I tested this a bunch now and I can confirm that this always happens whenseekTois called (even withoutplay). Did you use a different device for testing?Source
I figured that it might be the audio source - we are using a stream over the internet as our audio source.
That is
m3u8.TahaTesser commentedon Jan 12, 2021
Hi @creativecreatorormaybenot
Thanks for the confirmation, it must stream source, I can't reproduce even with a longer video (NullSafety Video) with a
.mp4extension.Since #71264 address the
sekToand it also reproduced using a stream #71264 (comment) but link no longer working to reproduce it again, I will retitle this issue for an initialization bugThank you
[-][video_player] Playback speed is reset on iOS[/-][+][video_player] Playback speed doesn't work when setting it before initialization [/+]10 remaining items
andreasgangso commentedon Jul 31, 2023
I had similar problems in a similar project, and fixed it with iOS 16's new defaultRate property.
Here, add something like this:
I'm not using video_player myself but someone should probably try this and make a PR :)
github-actions commentedon Jan 29, 2025
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.[video_player_avfoundation] fix playback speed resetting (#7657)
[video_player_avfoundation] fix playback speed resetting (flutter#7657)
[video_player_avfoundation] fix playback speed resetting (flutter#7657)
[video_player_avfoundation] fix playback speed resetting (flutter#7657)
[video_player_avfoundation] fix playback speed resetting (flutter#7657)