-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Duration value is always '0' in useProgress hooks #1709
Comments
@kyimoemin please provide an example audio file which gives this issue |
- (breaking) fix: usePlaybackState was incorrectly returning State.None by default. Now it returns undefined while it is waiting on the async call to TrackPlayer to resolve. This also fixes the following issue where duration was incorrectly being reported as `0`: doublesymmetry#1709 - optimization: avoid unnecessarily reevaluating the useEffect on every player state change by moving the `playerState === State.None` outside of the effect and including it as a dependency instead
See #1723 for a fix candidate |
@kyimoemin @chrismadalina, As puckey referenced please try the nightly build as this might be fixed there. Apart from that we need your feedback based on our recommendation it might be a bad audio file. Please try send a reproduction based on the example app from a fork of this lib. If we hear back with something that merits further inquiry I'll open this issue again. |
- (breaking) fix: usePlaybackState was incorrectly returning State.None by default. Now it returns undefined while it is waiting on the async call to TrackPlayer to resolve. This also fixes the following issue where duration was incorrectly being reported as `0`: doublesymmetry#1709 - optimization: avoid unnecessarily reevaluating the useEffect on every player state change by moving the `playerState === State.None` outside of the effect and including it as a dependency instead
* fix(js): fix useProgress & usePlayback hooks - (breaking) fix: usePlaybackState was incorrectly returning State.None by default. Now it returns undefined while it is waiting on the async call to TrackPlayer to resolve. This also fixes the following issue where duration was incorrectly being reported as `0`: #1709 - optimization: avoid unnecessarily reevaluating the useEffect on every player state change by moving the `playerState === State.None` outside of the effect and including it as a dependency instead * chore(js): make hooks fix non-breaking
@jspizziri @puckey hey, i have the same issue on 3.1.0 and either on the nightly build here is an example audio this is how i add tracks:
|
@drachyovmaxim please fork of this repository and create a reproduction in the example project. We will reopen this if we can confirm it there. |
@jspizziri we fixed this issue on backend side by adding |
* fix(js): fix useProgress & usePlayback hooks - (breaking) fix: usePlaybackState was incorrectly returning State.None by default. Now it returns undefined while it is waiting on the async call to TrackPlayer to resolve. This also fixes the following issue where duration was incorrectly being reported as `0`: doublesymmetry/react-native-track-player#1709 - optimization: avoid unnecessarily reevaluating the useEffect on every player state change by moving the `playerState === State.None` outside of the effect and including it as a dependency instead * chore(js): make hooks fix non-breaking
Describe the Bug
the value of duration that returned from useProgress hooks is always '0' in iOS simulator. Android simulator don't have that problem, the duration is showing correctly in android.
Steps To Reproduce
start the iOS simulator and run the following code.
Code To Reproduce
Environment Info:
System:
OS: macOS 12.5.1
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 47.27 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.17.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.13 - /usr/local/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 27, 28, 29, 30, 31
Build Tools: 29.0.2, 30.0.3, 31.0.0
System Images: android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_282 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.2 => 0.64.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
react-native-track-player
:3.1.0
device: simulator
running OS: iOS
The text was updated successfully, but these errors were encountered: