mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 22:13:41 +00:00
Don't switch to MPV after closing PiP
This commit is contained in:
parent
a7607693f8
commit
46b1ef9530
@ -56,7 +56,6 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
private(set) var avPlayer = AVPlayer()
|
private(set) var avPlayer = AVPlayer()
|
||||||
var controller: AppleAVPlayerViewController?
|
var controller: AppleAVPlayerViewController?
|
||||||
var startPictureInPictureOnPlay = false
|
var startPictureInPictureOnPlay = false
|
||||||
var switchToMPVOnPipClose = false
|
|
||||||
|
|
||||||
private var asset: AVURLAsset?
|
private var asset: AVURLAsset?
|
||||||
private var composition = AVMutableComposition()
|
private var composition = AVMutableComposition()
|
||||||
|
@ -24,17 +24,6 @@ final class PiPDelegate: NSObject, AVPictureInPictureControllerDelegate {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if player.avPlayerBackend.switchToMPVOnPipClose,
|
|
||||||
!player.currentItem.isNil
|
|
||||||
{
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
player.avPlayerBackend.switchToMPVOnPipClose = false
|
|
||||||
player.saveTime {
|
|
||||||
player.changeActiveBackend(from: .appleAVPlayer, to: .mpv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
player.playingInPictureInPicture = false
|
player.playingInPictureInPicture = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,10 +132,6 @@ final class PlayerControlsModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func startPiP(startImmediately: Bool = true) {
|
func startPiP(startImmediately: Bool = true) {
|
||||||
if player.activeBackend == .mpv {
|
|
||||||
player.avPlayerBackend.switchToMPVOnPipClose = true
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
player.exitFullScreen()
|
player.exitFullScreen()
|
||||||
#endif
|
#endif
|
||||||
|
@ -868,7 +868,6 @@ final class PlayerModel: ObservableObject {
|
|||||||
if musicMode {
|
if musicMode {
|
||||||
if playingInPictureInPicture {
|
if playingInPictureInPicture {
|
||||||
avPlayerBackend.pause()
|
avPlayerBackend.pause()
|
||||||
avPlayerBackend.switchToMPVOnPipClose = false
|
|
||||||
closePiP()
|
closePiP()
|
||||||
}
|
}
|
||||||
changeActiveBackend(from: .appleAVPlayer, to: .mpv)
|
changeActiveBackend(from: .appleAVPlayer, to: .mpv)
|
||||||
|
Loading…
Reference in New Issue
Block a user