mirror of
https://github.com/yattee/yattee.git
synced 2025-11-20 17:02:21 +00:00
Fix playing videos from channel view in modal opened in video player
Handle case where player is already presenting by using delayed dispatch instead of appending to onPresentPlayer callback queue.
This commit is contained in:
@@ -440,11 +440,19 @@ final class PlayerModel: ObservableObject {
|
||||
|
||||
#if os(iOS)
|
||||
if !playingInPictureInPicture, showingPlayer {
|
||||
onPresentPlayer.append { [weak self] in
|
||||
changeBackendHandler?()
|
||||
self?.playNow(video, at: time)
|
||||
if presentingPlayer {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
||||
guard let self else { return }
|
||||
changeBackendHandler?()
|
||||
self.playNow(video, at: time)
|
||||
}
|
||||
} else {
|
||||
onPresentPlayer.append { [weak self] in
|
||||
changeBackendHandler?()
|
||||
self?.playNow(video, at: time)
|
||||
}
|
||||
show()
|
||||
}
|
||||
show()
|
||||
return
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user