Skip to content

Commit

Permalink
refactor(ios): remove type assertion within setupPipController (#3493)
Browse files Browse the repository at this point in the history
* refactor(ios): remove type assertion within setupPipController

* lint: apply swift lint
  • Loading branch information
YangJonghun authored Jan 24, 2024
1 parent 7eeb1c5 commit e63c7cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ios/Video/Features/RCTPictureInPicture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Video/Features/RCTVideoTVUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
var metadataGroups = [AVTimedMetadataGroup]()

// 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))
}

Expand Down

0 comments on commit e63c7cb

Please sign in to comment.