refactor(ios): remove type assertion within setupPipController (#3493)
* refactor(ios): remove type assertion within setupPipController * lint: apply swift lint
This commit is contained in:
@@ -47,8 +47,10 @@ import React
|
||||
}
|
||||
|
||||
func setupPipController(_ playerLayer: AVPlayerLayer?) {
|
||||
guard let playerLayer else { return }
|
||||
if !AVPictureInPictureController.isPictureInPictureSupported() { return }
|
||||
// Create new controller passing reference to the AVPlayerLayer
|
||||
_pipController = AVPictureInPictureController(playerLayer: playerLayer!)
|
||||
_pipController = AVPictureInPictureController(playerLayer: playerLayer)
|
||||
if #available(iOS 14.2, *) {
|
||||
_pipController?.canStartPictureInPictureAutomaticallyFromInline = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user