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

Handle mediaServicesWereReset Notification #956

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

GianniCarlo
Copy link
Collaborator

Purpose

There's a unrecoverable state that can happen at the OS level, and we need to handle it by recreating the audio components for playback

Related tasks

#914

Approach

  • Register observer for AVAudioSession.mediaServicesWereResetNotification
    • Stop playback when this happens
    • Reset AVAudioSession category
    • Recreate AVPlayer
  • Add an intermediate publisher, so observers do not depend directly on the AVPlayer KVO observer, so the publishers are still live after AVPlayer is recreated

@GianniCarlo GianniCarlo self-assigned this Jul 6, 2023
@GianniCarlo GianniCarlo merged commit 8dea123 into develop Jul 6, 2023
1 check passed
@GianniCarlo GianniCarlo deleted the 914-mediaservices-notification branch July 6, 2023 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant