Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interruption Handling Notifications not working #128

Open
Kedar-27 opened this issue Sep 20, 2019 · 2 comments
Open

Interruption Handling Notifications not working #128

Kedar-27 opened this issue Sep 20, 2019 · 2 comments

Comments

@Kedar-27
Copy link

Kedar-27 commented Sep 20, 2019

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)

    notificationCenter.addObserver(self, selector: #selector(playerDidRecieveError(_:)), name: .AVPlayerItemNewErrorLogEntry, object: nil)

     notificationCenter.addObserver(self, selector: #selector(playerDidRecieveError(_:)), name: .AVPlayerItemFailedToPlayToEndTime , object: nil)

    notificationCenter.addObserver(self, selector: #selector(playerDidRecieveError(_:)), name: .AVPlayerItemPlaybackStalled , object: nil)`

}

I added 3 more notifications for interruption handling, but seems not to be working please help with this issue @analogcode @fethica

@fethica
Copy link
Collaborator

fethica commented Oct 2, 2019

@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
Copy link
Author

Kedar-27 commented Oct 3, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants