-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] unable to resume track after first play #1225
Comments
Hi @AdamSheaHewett 👋 you seem to be correct. I'll try to take a look sometime in the next days, in the meantime does pausing and seeking to start work for you? |
Yes, pausing works, and I put in a hacky function that syncs the state's playlist with the TrackPlayer queue if the queue is corrupted:
|
@dcvz any updates on this bug? If it's fixed I'd like to stop manually checking if state matches the playlist queue. |
@AdamSheaHewett the bug is still here, thanks for your workaround ❤️ |
Thanks for reporting this. @AdamSheaHewett and @rborn are you able to investigate and/or create a PR to fix this? Would love some extra help. Cheers |
@bradleyflood I only implemented a version of the hack above, which is a "hack" 😅. Probably this should be fixed at the native level? (an my native-fu is nonexistent 😞) |
@dcvz I can confirm this behavior. Here's a breakdown of the issue: iOS (v1.2.7 & current)
So, from that perspective this almost seems like intended behavior. But the documentation doesn't mention anything about clearing the queue.. So I looked at what Kotlin was doing. KotlinKotlin simply calls Note: after further review, I believe Kotlin is behaving correctly. Android
Moreover, it doesn't seem that in this case ConclusionI guess my big question is: How should it work (in a way that's non-breaking)? From my limited perspective, it seems that:
At this point, I'm relatively convinced this is the correct approach, so I have opened a PR to this effect. LMK if you disagree. |
…ame as the Android API for stop additionally, fix an issue with Event.PlaybackProgressUpdated causing exceptions when fired after certain queue manipulations doublesymmetry#1225
@AdamSheaHewett FYI
|
Fantastic news. Please let us know when the solution is released. |
@dcvz Can you confirm on this logic above? @jspizziri Has created a PR fix for this which would be sweet to get into production if the above logic is correct. |
All, this fix was merged. Now we just need a new release 😁 so I'm going to close this issue. ✌️ |
…ame as the Android API for stop (#1529) additionally, fix an issue with Event.PlaybackProgressUpdated causing exceptions when fired after certain queue manipulations doublesymmetry/react-native-track-player#1225
Describe the bug
On iOS, it seems that TrackPlayer.stop() clears the queue and also sets the state to State.None
I add a track as normal, and am able to play it, but the moment I use the stop() function, the queue is cleared, state is State.None, and the player just stops working.
To Reproduce
Using v2.0.0 on iOS, add a track, TrackPlayer.play(), TrackPlayer.stop(), then try to TrackPlayer.play() again. It won't work.
Environment (please complete the following information):
react-native-track-player
version 2.0.0System:
OS: macOS 11.5.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 233.77 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.4/bin/yarn
npm: 6.14.10 - ~/.nvm/versions/node/v14.15.4/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7583922
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Code
Please, share the code that is causing the issue
This only happens on iOS
The text was updated successfully, but these errors were encountered: