React-native-track-player: Player state is going to STATE_NONE and notification is disappearing while network interruption.

Created on 29 Jan 2020  路  3Comments  路  Source: react-native-kit/react-native-track-player

Notification is disappearing when there is a network interruption, how to make the notification widget stay at interruptions?

react-native-track-player: 1.1.8 v
react-native: 0.60.4

occurrence: When track is played for 10 min, notification widget disappears and players stops playing.
platform: iOS and android.

Most helpful comment

@Guichaguri Any thoughts on the first issue? The state seems super unreliable lately. We're using this in production, and we've had many reports of users complaining that the audio keeps randomly stopping, pausing, or restarting.

We think this could potentially be tied into losing and reconnecting network state.

All 3 comments

@Guichaguri Any thoughts on the first issue? The state seems super unreliable lately. We're using this in production, and we've had many reports of users complaining that the audio keeps randomly stopping, pausing, or restarting.

We think this could potentially be tied into losing and reconnecting network state.

Ok, maybe lets try to get a bit more detail into reproduction steps.

Are you guys using several instances of the player? (Like a mini player/ full player or just a player that mounts and unmounts often)
Displaying a progress bar?
Using hooks or class components?

@stokesbga Thanks for getting back to us!

We initialize the player when we initialize our app, and then we don't initialize it again. We have a mini player / full screen player, and we display a progress bar. We're trying to use the hooks useTrackPlayerEvents and useProgress. We wrapped the state functionality in our own hook where we store the state, as we found the state updates in general very unreliable.

If you'd like some more information, please don't hesitate to get in touch.

currently on version 1.2.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moduval picture moduval  路  3Comments

mnlbox picture mnlbox  路  4Comments

tarahiw picture tarahiw  路  3Comments

amed picture amed  路  4Comments

curiousdustin picture curiousdustin  路  4Comments