Enable PiP on Native Player (#786)

This commit is contained in:
Wendy Liga 2023-06-10 13:06:43 +07:00 committed by GitHub
parent 2e2fc32e84
commit d624c1e869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -63,6 +63,10 @@ network.</string>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchScreen</key>

View File

@ -73,6 +73,9 @@ class UINativeVideoPlayerViewController: AVPlayerViewController {
newPlayer.appliesMediaSelectionCriteriaAutomatically = false
newPlayer.currentItem?.externalMetadata = createMetadata()
// enable pip
allowsPictureInPicturePlayback = true
rateObserver = newPlayer.observe(\.rate, options: .new) { _, change in
guard let newValue = change.newValue else { return }