You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Kedar-27 Can you add more context on why you'd like to add the notifications? The interruptions are handled by default, and you can use the delegate interface of the RadioPlayer to add custom behaviour.
@Kedar-27 Can you add more context on why you'd like to add the notifications? The interruptions are handled by default, and you can use the delegate interface of the RadioPlayer to add custom behavior.
Yes, we have delegates, but they all detect the error at the start of playback. I wanted more precise error handling during playback
private func setupNotifications() {
let notificationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: #selector(handleInterruption), name: AVAudioSession.interruptionNotification, object: nil) notificationCenter.addObserver(self, selector: #selector(handleRouteChange), name: AVAudioSession.routeChangeNotification, object: nil) notificationCenter.addObserver(self, selector: #selector(playerDidFinishPlaying), name: .AVPlayerItemDidPlayToEndTime, object: nil)
}
I added 3 more notifications for interruption handling, but seems not to be working please help with this issue @analogcode @fethica
The text was updated successfully, but these errors were encountered: