Skip to content

Commit

Permalink
refactor(ios): remove type assertion within setupPipController
Browse files Browse the repository at this point in the history
  • Loading branch information
YangJonghun committed Jan 23, 2024
1 parent 3858a15 commit dc7b420
Showing 1 changed file with 3 additions and 1 deletion.
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 }

Check failure on line 51 in ios/Video/Features/RCTPictureInPicture.swift

View workflow job for this annotation

GitHub Actions / Swift-Lint

Control Statement Violation: `if`, `for`, `guard`, `switch`, `while`, and `catch` statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses (control_statement)
// 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

0 comments on commit dc7b420

Please sign in to comment.