activating the audio session
This commit is contained in:
parent
a0450e026c
commit
7c8244bd07
@ -127,12 +127,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
_eventDispatcher = eventDispatcher
|
_eventDispatcher = eventDispatcher
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
let audioSession = AVAudioSession.sharedInstance()
|
|
||||||
do {
|
|
||||||
try audioSession.setCategory(.playback)
|
|
||||||
try audioSession.setActive(true, options: [])
|
|
||||||
} catch {
|
|
||||||
}
|
|
||||||
_pip = RCTPictureInPicture(self._onPictureInPictureStatusChanged, self._onRestoreUserInterfaceForPictureInPictureStop)
|
_pip = RCTPictureInPicture(self._onPictureInPictureStatusChanged, self._onRestoreUserInterfaceForPictureInPictureStop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -429,6 +423,12 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
@objc
|
@objc
|
||||||
func setPictureInPicture(_ pictureInPicture:Bool) {
|
func setPictureInPicture(_ pictureInPicture:Bool) {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
|
let audioSession = AVAudioSession.sharedInstance()
|
||||||
|
do {
|
||||||
|
try audioSession.setCategory(.playback)
|
||||||
|
try audioSession.setActive(true, options: [])
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
_pip?.setPictureInPicture(pictureInPicture)
|
_pip?.setPictureInPicture(pictureInPicture)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user