mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 22:13:41 +00:00
Improve animations
This commit is contained in:
parent
3cb20452c7
commit
9d79543085
@ -43,11 +43,18 @@ final class PiPDelegate: NSObject, AVPictureInPictureControllerDelegate {
|
||||
_: AVPictureInPictureController,
|
||||
restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void
|
||||
) {
|
||||
var delay = 0.0
|
||||
#if os(iOS)
|
||||
if player.currentItem.isNil {
|
||||
delay = 0.5
|
||||
}
|
||||
#endif
|
||||
|
||||
if !player.currentItem.isNil {
|
||||
player?.show()
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
|
||||
completionHandler(true)
|
||||
}
|
||||
}
|
||||
|
@ -206,9 +206,11 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
|
||||
func play(_ video: Video, at time: CMTime? = nil, showingPlayer: Bool = true) {
|
||||
pause()
|
||||
|
||||
var delay = 0.0
|
||||
#if !os(macOS)
|
||||
delay = 0.3
|
||||
#if os(iOS)
|
||||
delay = 0.5
|
||||
#endif
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in
|
||||
|
Loading…
Reference in New Issue
Block a user