fix(tvOS): compile issues with tvOS linked to earpiece & pip (#3276)
This commit is contained in:
parent
92831afd5f
commit
7b6b84c8cb
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user