I am constructing a React Native app that performs audio utilizing react-native-track-player
. Every little thing works properly when the audio is actively enjoying — I can see the media widget on the lock display, management playback, and even see monitor metadata.
Nonetheless, the issue is that as soon as I pause the audio, the lock display widget disappears or will get changed by the system’s default media widget (like Spotify, YouTube, or Apple Music). I would like the widget to keep seen and constant, even when the audio is paused, identical to how different music apps behave.
What I’ve tried:
-
Setting
alwaysPauseOnInterruption: false
and different playback choices inupdateOptions
-
Configuring capabilities like
Functionality.Play
,Functionality.Pause
,Functionality.Cease
, and so forth. -
Setting
compactCapabilities
-
Organising the participant with
waitForBuffer: true
and differentsetupPlayer
config choices -
Tried sustaining audio session in native iOS code to forestall session from ending
However none of those helped — the widget nonetheless disappears or switches after pause.
await TrackPlayer.updateOptions({
stopWithApp: false,
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
],
compactCapabilities: [Capability.Play, Capability.Pause],
alwaysPauseOnInterruption: false,
});
Machine Information:
My Objective:
I would like the lock display media widget to stay seen even when audio is paused, like different audio apps (Spotify, YouTube Music, and so forth.).
Any recommendations or workarounds to maintain the lock display widget persistent throughout pause can be enormously appreciated!