Describe the Bug
When I play something the media notification will show up but then it quickly gets removed.
Steps To Reproduce
Play audio/video with the following code
And make sure to add an HLS track
Code To Reproduce
await TrackPlayer.setupPlayer({
// Important: CarPlay works with IOSCategory.Playback.
iosCategory: IOSCategory.Playback,
// We must set this to the empty array, otherwise the player will
// only play audio in airplane mode. AND it breaks lock screen controls if its not
// the empty array.
// https://react-native-track-player.js.org/docs/api/constants/ios-category-options#allowairplay
iosCategoryOptions: [],
// We must set this to SpokenAudio for lock screen controls to work with
// IOSCategory.Playback.
iosCategoryMode: IOSCategoryMode.SpokenAudio,
})
// We mute the track player because the video player will be the one
// playing the audio. This is to prevent the audio from playing twice.
await TrackPlayer.setVolume(0)
...
await TrackPlayer.updateOptions({
android: {
appKilledPlaybackBehavior:
AppKilledPlaybackBehavior.StopPlaybackAndRemoveNotification,
},
// stoppingAppPausesPlayback is deprecated but we still use it just in
// case it's needed.
stoppingAppPausesPlayback: true,
capabilities: [
Capability.Play,
Capability.Stop,
Capability.Pause,
Capability.JumpBackward,
Capability.JumpForward,
Capability.SeekTo,
],
compactCapabilities: [
Capability.Play,
Capability.Pause,
Capability.JumpForward,
Capability.JumpBackward,
Capability.SeekTo,
Capability.Stop,
],
progressUpdateEventInterval: 1,
})
Describe the Bug When I play something the media notification will show up but then it quickly gets removed.
Steps To Reproduce Play audio/video with the following code And make sure to add an HLS track
Code To Reproduce
Replicable on Example App? Can you replicate this bug in the React Native Track Player Example App?
Environment Info:
I tried both 4.1.1 and 4.0.1
Real device? Android Samsung Tab S6 Lite
What OS are you running? Android 14
How I can Help
Android adb logs: