Skip to content

fix(ios): fixed audio focus change on iOS#4811

Merged
moskalakamil merged 2 commits intoTheWidlarzGroup:masterfrom
robertert:fix/audioFocus
Mar 9, 2026
Merged

fix(ios): fixed audio focus change on iOS#4811
moskalakamil merged 2 commits intoTheWidlarzGroup:masterfrom
robertert:fix/audioFocus

Conversation

@robertert
Copy link
Copy Markdown
Contributor

The previous implementation of audio mixing mode selection had a bug where switching between different modes (e.g., from .mixWithOthers to .doNotMix) did not consistently remove the previously set options. This was because the switch statement only handled removals in specific cases, potentially leaving stale flags in audioSessionCategoryOptions.

@Okelm
Copy link
Copy Markdown
Contributor

Okelm commented Jan 8, 2026

is this connected to some reported issue somewhere?

@robertert
Copy link
Copy Markdown
Contributor Author

no i was just playing with the example app and found this issue

@Okelm
Copy link
Copy Markdown
Contributor

Okelm commented Jan 8, 2026

by any chance it might fix this? #4810

@robertert
Copy link
Copy Markdown
Contributor Author

This issue doesn't occur here.
But I made this change in v7 version and the issue was on 6.11 so I suppose it could be fixed earlier.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes iOS audio session category option handling so switching MixAudioMode values doesn’t leave stale AVAudioSession.CategoryOptions flags set.

Changes:

  • Always clears .duckOthers and .mixWithOthers before applying the newly determined mixing mode.
  • Simplifies the switch by combining the “no-op” modes (.auto, .donotmix) into a single case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-native-video/ios/core/VideoManager.swift Outdated
@moskalakamil moskalakamil merged commit ddcb9e6 into TheWidlarzGroup:master Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants