My app streams HLS content using AVPlayer. When Siri is activated (for example with a long press of the lock button), the video and audio stop. I want it to work like the Youtube and Twitch players : the live stream doesn’t get interrupted, but the volume of the audio is lowered. Is that possible ?
What I’ve seen so far, which aren’t a solution to my problem :
- implementing an
AVAudioSession
interruption handler. This doesn’t work for me because it still stops the playback + it seems the Siri interruption only triggers the begin type of interruption and not the end - setting the player of the AVPlayerLayer to nil when app is inactive and restoring it when it becomes active again (this is from the Apple’s documentation archive, but it is not what I want since the user should still be able to see the video)
New contributor
tddev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.