fix(tvOS): compile issues with tvOS linked to earpiece & pip (#3276)

This commit is contained in:
Konstantin 2023-10-06 18:42:53 +02:00 committed by GitHub
parent 92831afd5f
commit 7b6b84c8cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -580,7 +580,9 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
_audioOutput = audioOutput _audioOutput = audioOutput
do { do {
if audioOutput == "speaker" { if audioOutput == "speaker" {
#if os(iOS)
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.speaker) try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
#endif
} else if audioOutput == "earpiece" { } else if audioOutput == "earpiece" {
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.none) try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.none)
} }
@ -821,7 +823,9 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
viewController.view.frame = self.bounds viewController.view.frame = self.bounds
viewController.player = player viewController.player = player
viewController.allowsPictureInPicturePlayback = true if #available(tvOS 14.0, *) {
viewController.allowsPictureInPicturePlayback = true
}
return viewController return viewController
} }