Improve PiP

Fix #186
Fix #196
This commit is contained in:
Arkadiusz Fal
2022-08-26 22:17:21 +02:00
parent 99881ccc23
commit 60f38a80aa
13 changed files with 173 additions and 104 deletions

View File

@@ -167,7 +167,15 @@ struct VideoContextMenuView: View {
private var playNowInPictureInPictureButton: some View {
Button {
player.controls.startPiP(startImmediately: player.presentingPlayer && player.activeBackend == .appleAVPlayer)
player.avPlayerBackend.startPictureInPictureOnPlay = true
#if !os(macOS)
player.exitFullScreen()
#endif
if player.activeBackend != PlayerBackendType.appleAVPlayer {
player.changeActiveBackend(from: .mpv, to: .appleAVPlayer)
}
player.hide()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {