I have an AVQueuePlayer which is working as expected except for after returning from a suspended state.
It's playing a HLS audio stream. The logic for my pause button is very simple
isPlaying ? player?.play() : player?.pause()
I've checked the state of the player and the currentItem, all of which say it's "playing". But the audio does not progress or playback
player.rate = 1
player.currentItem.asset.isPlayable = true
player.status == readyToPlay
player.currentItem.status == readyToPlay
I'm also setting the session with:
do {
try session.setCategory(AVAudioSession.Category.playback, options: [])
try session.setActive(true, options: [])
} catch {
print("Failed to set session active")
}
Any advice on how to troubleshoot this would be greatly appreciated. Do I need to keep track of the app entering a suspended state and reload the AVPlayerItem?