mirror of
https://github.com/yattee/yattee.git
synced 2024-12-25 06:53:42 +00:00
Fix #86
This commit is contained in:
parent
1d5d920f88
commit
9e076f8b5f
@ -39,6 +39,10 @@ final class MPVBackend: PlayerBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateControlsIsPlaying()
|
updateControlsIsPlaying()
|
||||||
|
|
||||||
|
#if !os(macOS)
|
||||||
|
UIApplication.shared.isIdleTimerDisabled = model.presentingPlayer && isPlaying
|
||||||
|
#endif
|
||||||
}}
|
}}
|
||||||
var playerItemDuration: CMTime?
|
var playerItemDuration: CMTime?
|
||||||
|
|
||||||
@ -77,6 +81,12 @@ final class MPVBackend: PlayerBackend {
|
|||||||
|
|
||||||
func playStream(_ stream: Stream, of video: Video, preservingTime: Bool, upgrading _: Bool) {
|
func playStream(_ stream: Stream, of video: Video, preservingTime: Bool, upgrading _: Bool) {
|
||||||
handleEOF = false
|
handleEOF = false
|
||||||
|
#if !os(macOS)
|
||||||
|
if model.presentingPlayer {
|
||||||
|
UIApplication.shared.isIdleTimerDisabled = true
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
let updateCurrentStream = {
|
let updateCurrentStream = {
|
||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
self?.stream = stream
|
self?.stream = stream
|
||||||
|
@ -299,6 +299,10 @@ final class PlayerModel: ObservableObject {
|
|||||||
backend.setNeedsDrawing(presentingPlayer)
|
backend.setNeedsDrawing(presentingPlayer)
|
||||||
controls.hide()
|
controls.hide()
|
||||||
|
|
||||||
|
#if !os(macOS)
|
||||||
|
UIApplication.shared.isIdleTimerDisabled = presentingPlayer
|
||||||
|
#endif
|
||||||
|
|
||||||
if presentingPlayer, closePiPOnOpeningPlayer, playingInPictureInPicture {
|
if presentingPlayer, closePiPOnOpeningPlayer, playingInPictureInPicture {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
||||||
self?.closePiP()
|
self?.closePiP()
|
||||||
|
Loading…
Reference in New Issue
Block a user