Repository: expo/expo
File: packages/expo-video/ios/VideoModule.swift (Swift)

Code before:
        view.stopPictureInPicture()
      }
    }

    View(VideoAirPlayButtonView.self) {
      Events(
        "onBeginPresentingRoutes",
        "onEndPresentingRoutes"
      )

      Prop("tint") { (view, tint: UIColor?) in
        view.tint = tint
      }

      Prop("activeTint") { (view, activeTint: UIColor?) in
        view.activeTintColor = activeTint
      }

      Prop("prioritizeVideoDevices") { (view, prioritizeVideoDevices: Bool?) in
        view.prioritizeVideoDevices = prioritizeVideoDevices ?? true
      }
    }

    Class(VideoPlayer.self) {
      // playerBuilderOptions - NOOP on iOS
      Constructor { (source: VideoSource?, useSynchronousReplace: Bool?, _: [String: Any?]?) -> VideoPlayer in
        let useSynchronousReplace = useSynchronousReplace ?? false
        let player = AVPlayer()
        let videoPlayer = try VideoPlayer(player, initialSource: source, useSynchronousReplace: useSynchronousReplace)
        player.pause()
        return videoPlayer
      }

      Property("playing") { player -> Bool in
        return player.isPlaying
      }

      Property("muted") { player -> Bool in
        return player.isMuted
      }
      .set { (player, muted: Bool) in
        player.isMuted = muted
      }

      Property("allowsExternalPlayback") { player -> Bool in
        return player.ref.allowsExternalPlayback
      }
      .set { (player, allowsExternalPlayback: Bool) in
        player.ref.allowsExternalPlayback = allowsExternalPlayback
      }


Review comment (suggestion):
```suggestion
      Constructor { (source: VideoSource?, useSynchronousReplace: Bool?, /* playerBuilderOptions - Android only */ _: [String: Any?]?) -> VideoPlayer in
```
up to you

Code after:
        view.stopPictureInPicture()
      }
    }

    View(VideoAirPlayButtonView.self) {
      Events(
        "onBeginPresentingRoutes",
        "onEndPresentingRoutes"
      )

      Prop("tint") { (view, tint: UIColor?) in
        view.tint = tint
      }

      Prop("activeTint") { (view, activeTint: UIColor?) in
        view.activeTintColor = activeTint
      }

      Prop("prioritizeVideoDevices") { (view, prioritizeVideoDevices: Bool?) in
        view.prioritizeVideoDevices = prioritizeVideoDevices ?? true
      }
    }

    Class(VideoPlayer.self) {
      Constructor { (source: VideoSource?, useSynchronousReplace: Bool?, /* playerBuilderOptions - Android only */ _: [String: Any?]?) -> VideoPlayer in
        let useSynchronousReplace = useSynchronousReplace ?? false
        let player = AVPlayer()
        let videoPlayer = try VideoPlayer(player, initialSource: source, useSynchronousReplace: useSynchronousReplace)
        player.pause()
        return videoPlayer
      }

      Property("playing") { player -> Bool in
        return player.isPlaying
      }

      Property("muted") { player -> Bool in
        return player.isMuted
      }
      .set { (player, muted: Bool) in
        player.isMuted = muted
      }

      Property("allowsExternalPlayback") { player -> Bool in
        return player.ref.allowsExternalPlayback
      }
      .set { (player, allowsExternalPlayback: Bool) in
        player.ref.allowsExternalPlayback = allowsExternalPlayback
      }

      Property("staysActiveInBackground") { player -> Bool in