Fix: iOS - audio does not work with headphones (#3284)
* Fix: Make AVAudioSession.Category.playAndRecord opt-in * Fix: Call configureAudio when audioOutput is changed * Update CHANGELOG.md
This commit is contained in:
@@ -488,7 +488,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
||||
@objc
|
||||
func setIgnoreSilentSwitch(_ ignoreSilentSwitch:String?) {
|
||||
_ignoreSilentSwitch = ignoreSilentSwitch
|
||||
RCTPlayerOperations.configureAudio(ignoreSilentSwitch:_ignoreSilentSwitch, mixWithOthers:_mixWithOthers)
|
||||
RCTPlayerOperations.configureAudio(ignoreSilentSwitch:_ignoreSilentSwitch, mixWithOthers:_mixWithOthers, audioOutput:_audioOutput)
|
||||
applyModifiers()
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
||||
_player?.rate = 0.0
|
||||
}
|
||||
} else {
|
||||
RCTPlayerOperations.configureAudio(ignoreSilentSwitch:_ignoreSilentSwitch, mixWithOthers:_mixWithOthers)
|
||||
RCTPlayerOperations.configureAudio(ignoreSilentSwitch:_ignoreSilentSwitch, mixWithOthers:_mixWithOthers, audioOutput:_audioOutput)
|
||||
|
||||
if _adPlaying {
|
||||
#if USE_GOOGLE_IMA
|
||||
@@ -583,6 +583,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
||||
@objc
|
||||
func setAudioOutput(_ audioOutput:String) {
|
||||
_audioOutput = audioOutput
|
||||
RCTPlayerOperations.configureAudio(ignoreSilentSwitch:_ignoreSilentSwitch, mixWithOthers:_mixWithOthers, audioOutput:_audioOutput)
|
||||
do {
|
||||
if audioOutput == "speaker" {
|
||||
#if os(iOS)
|
||||
|
||||
Reference in New Issue
Block a user