Skip to content

feat: add disable audio session management#4829

Draft
fnwk wants to merge 2 commits intomasterfrom
feat/add-disableAudioSessionManagement
Draft

feat: add disable audio session management#4829
fnwk wants to merge 2 commits intomasterfrom
feat/add-disableAudioSessionManagement

Conversation

@fnwk
Copy link
Collaborator

@fnwk fnwk commented Jan 29, 2026

This pull request introduces a new feature to globally and per-player disable internal audio session management on iOS, allowing other libraries (such as audio recording libraries) to control the AVAudioSession without interference from react-native-video. The implementation is iOS-specific and is a no-op on Android. The changes include new APIs, property additions, and updates to the native and TypeScript layers.

iOS Audio Session Management Control:

  • Added a global method setAudioSessionManagementDisabled to allow disabling or enabling internal audio session management from JavaScript, exposed via the VideoPlayerFactory interface and implemented in both Swift and TypeScript. [1] [2] [3] [4] [5]
  • Updated the VideoManager in Swift to support both a global flag and per-player flags for disabling audio session management, ensuring that AVAudioSession is only controlled if management is enabled. [1] [2] [3]
  • Added a new property disableAudioSessionManagement to the HybridVideoPlayer class on iOS, with logic to trigger audio session updates when changed.

TypeScript/JS API and Typings:

  • Exposed the disableAudioSessionManagement property on the VideoPlayerBase TypeScript interface and implemented corresponding getter/setter logic in the VideoPlayer class, including developer warnings for unsupported platforms. [1] [2]
  • Exported the new setAudioSessionManagementDisabled utility from the main module entry point for easy access.

Android Compatibility:

  • Added no-op implementations for the new audio session management APIs and properties on Android to maintain cross-platform compatibility and prevent errors. [1] [2]

Developer Experience:

  • Added developer warnings in JavaScript for attempts to use the audio session management APIs on unsupported platforms. [1] [2]

These changes make it easier to integrate react-native-video with other audio-related libraries on iOS by providing fine-grained control over AVAudioSession management.

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

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant

Comments