State.Buffering doesnt show / report in Android.
Describe the Bug Hi , seem that in any version higher than v2.1.3 State.Buffering doesnt show, am i missing something? Tested with v2.1.3, 2.2.0-RC4 , 3.0.0, 3.1.0 and next
With version v2.1.3: LOG Stored State: Playing / 3 - usePlaybackState: Buffering / 6 LOG Stored State: Buffering / 6 - usePlaybackState: Buffering / 6 LOG Stored State: Buffering / 6 - usePlaybackState: Playing / 3 LOG Stored State: Playing / 3 - usePlaybackState: Playing / 3 LOG Stored State: Playing / 3 - usePlaybackState: Buffering / 6 LOG Stored State: Playing / 3 - usePlaybackState: Playing / 3 LOG Stored State: Playing / 3 - usePlaybackState: Buffering / 6 LOG Stored State: Playing / 3 - usePlaybackState: Playing / 3 LOG Stored State: Playing / 3 - usePlaybackState: Buffering / 6 LOG Stored State: Buffering / 6 - usePlaybackState: Buffering / 6 LOG Stored State: Buffering / 6 - usePlaybackState: Stopped / 1 LOG Stored State: Stopped / 1 - usePlaybackState: Stopped / 1 LOG Stored State: Stopped / 1 - usePlaybackState: None / 0
The stored state is what im using and its working fine. With other versions im getting Paused state instead of Buffering when seekto / skiptonext etc.
With v3.1.0 LOG Stored State: Playing / 2 - usePlaybackState: Paused / 3 LOG Stored State: Paused / 3 - usePlaybackState: Paused / 3 LOG Stored State: Paused / 3 - usePlaybackState: Playing / 2 LOG Stored State: Playing / 2 - usePlaybackState: Playing / 2 LOG Stored State: Playing / 2 - usePlaybackState: Paused / 3 LOG Stored State: Playing / 2 - usePlaybackState: Playing / 2 LOG Stored State: Playing / 2 - usePlaybackState: Paused / 3 LOG Stored State: Paused / 3 - usePlaybackState: Paused / 3 LOG Stored State: Paused / 3 - usePlaybackState: Playing / 2 LOG Stored State: Playing / 2 - usePlaybackState: Playing / 2
// Seems to be working when paused (showing Connecting state) but not when playing (showing Paused state instead).
LOG we seek LOG Stored State: Connecting / 6 LOG Stored State: Connecting / 6 LOG Stored State: Ready / 1 LOG Stored State: Ready / 1 LOG we seek LOG Stored State: Connecting / 6 LOG Stored State: Connecting / 6 LOG Stored State: Ready / 1 LOG Stored State: Ready / 1 LOG Stored State: Ready / 1
Edit: Tested in Example app too and no "Buffering" state / event on Android.
I am not sure if this is related but im getting this warning when building: w: E:\EuCitesc\node_modules\react-native-track-player\android\src\main\java\com\doublesymmetry\trackplayer\module\MusicModule.kt: (11, 47): 'LocalBroadcastManager' is deprecated. Deprecated in Java w: E:\EuCitesc\node_modules\react-native-track-player\android\src\main\java\com\doublesymmetry\trackplayer\module\MusicModule.kt: (112, 27): 'LocalBroadcastManager' is deprecated. Deprecated in Java w: E:\EuCitesc\node_modules\react-native-track-player\android\src\main\java\com\doublesymmetry\trackplayer\module\MusicModule.kt: (214, 23): 'LocalBroadcastManager' is deprecated. Deprecated in Java w: E:\EuCitesc\node_modules\react-native-track-player\android\src\main\java\com\doublesymmetry\trackplayer\service\MusicService.kt: (7, 47): 'LocalBroadcastManager' is deprecated. Deprecated in Java w: E:\EuCitesc\node_modules\react-native-track-player\android\src\main\java\com\doublesymmetry\trackplayer\service\MusicService.kt: (428, 9): 'LocalBroadcastManager' is deprecated. Deprecated in Java
Please try the nightly version – it includes a possible fix for this issue: https://github.com/doublesymmetry/react-native-track-player/commit/1b5bb02bbe1457902949ebd9c29829ba4998eb07
in usePlaybackState avoid possible race condition where setPlayerState could override the value received from the event listener by using callback version of setState by only setting if initial state is still missing
@izyspania I'll close for now. Please test nightly. If you still have the issue I'll reopen.
Sadly it does exactly the same , no Buffering state. "version": "3.1.0-7b247404c2b54df0550379277949a1cab5ddf47c", Edit: Tested with the example app too , it doesnt work.
I am also seeing missing events still. I think the fix mentioned doesn't actually fix the underlying issue, which is a case of player state events overriding each other. Will make a separate pull request which hopefully fixes this for good.
It seems to work fine now , good work, Thanks. Had some noise when playing (on android) but after i reinstalled the app and cleaned the cache it seems to work fine so far.
@puckey, I'll leave this open until yours studies it's fixed completely.
Should be fixed completely by https://github.com/doublesymmetry/react-native-track-player/pull/1713
It works fine now , yes.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Closed by https://github.com/doublesymmetry/react-native-track-player/pull/1713