Skip to content

Commit

Permalink
fix(tvOS): compile issues with tvOS linked to earpiece & pip (#3276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duell10111 authored Oct 6, 2023
1 parent 92831af commit 7b6b84c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
_audioOutput = audioOutput
do {
if audioOutput == "speaker" {
#if os(iOS)
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
#endif
} else if audioOutput == "earpiece" {
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.none)
}
Expand Down Expand Up @@ -821,7 +823,9 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH

viewController.view.frame = self.bounds
viewController.player = player
viewController.allowsPictureInPicturePlayback = true
if #available(tvOS 14.0, *) {
viewController.allowsPictureInPicturePlayback = true
}
return viewController
}

Expand Down

0 comments on commit 7b6b84c

Please sign in to comment.