refactor(ios): remove type assertion within setupPipController (#3493)
* refactor(ios): remove type assertion within setupPipController * lint: apply swift lint
This commit is contained in:
parent
7eeb1c530d
commit
e63c7cbd30
@ -47,8 +47,10 @@ import React
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setupPipController(_ playerLayer: AVPlayerLayer?) {
|
func setupPipController(_ playerLayer: AVPlayerLayer?) {
|
||||||
|
guard let playerLayer else { return }
|
||||||
|
if !AVPictureInPictureController.isPictureInPictureSupported() { return }
|
||||||
// Create new controller passing reference to the AVPlayerLayer
|
// Create new controller passing reference to the AVPlayerLayer
|
||||||
_pipController = AVPictureInPictureController(playerLayer: playerLayer!)
|
_pipController = AVPictureInPictureController(playerLayer: playerLayer)
|
||||||
if #available(iOS 14.2, *) {
|
if #available(iOS 14.2, *) {
|
||||||
_pipController?.canStartPictureInPictureAutomaticallyFromInline = true
|
_pipController?.canStartPictureInPictureAutomaticallyFromInline = true
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import Foundation
|
|||||||
var metadataGroups = [AVTimedMetadataGroup]()
|
var metadataGroups = [AVTimedMetadataGroup]()
|
||||||
|
|
||||||
// Iterate over the defined chapters and build a timed metadata group object for each.
|
// Iterate over the defined chapters and build a timed metadata group object for each.
|
||||||
chapters.forEach { chapter in
|
for chapter in chapters {
|
||||||
metadataGroups.append(makeTimedMetadataGroup(for: chapter))
|
metadataGroups.append(makeTimedMetadataGroup(for: chapter))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user