mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Add related videos
This commit is contained in:
@@ -9,20 +9,26 @@ final class PictureInPictureDelegate: NSObject, AVPlayerViewPictureInPictureDele
|
||||
}
|
||||
|
||||
func playerViewWillStartPicture(inPicture _: AVPlayerView) {
|
||||
playerModel.playingInPictureInPicture = true
|
||||
playerModel.presentingPlayer = false
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
self?.playerModel.playingInPictureInPicture = true
|
||||
self?.playerModel.presentingPlayer = false
|
||||
}
|
||||
}
|
||||
|
||||
func playerViewWillStopPicture(inPicture _: AVPlayerView) {
|
||||
playerModel.playingInPictureInPicture = false
|
||||
playerModel.presentPlayer()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
self?.playerModel.playingInPictureInPicture = false
|
||||
self?.playerModel.presentPlayer()
|
||||
}
|
||||
}
|
||||
|
||||
func playerView(
|
||||
_: AVPlayerView,
|
||||
restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: (Bool) -> Void
|
||||
) {
|
||||
playerModel.presentingPlayer = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
self?.playerModel.presentingPlayer = true
|
||||
}
|
||||
completionHandler(true)
|
||||
}
|
||||
}
|
||||
|
@@ -7,9 +7,6 @@ final class PlayerViewController: NSViewController {
|
||||
var pictureInPictureDelegate = PictureInPictureDelegate()
|
||||
|
||||
override func viewDidDisappear() {
|
||||
if !playerModel.playingInPictureInPicture {
|
||||
playerModel.pause()
|
||||
}
|
||||
super.viewDidDisappear()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user