mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Minor fixes
This commit is contained in:
parent
1329bef2f9
commit
0716602e3f
@ -1,5 +1,6 @@
|
|||||||
import Combine
|
import Combine
|
||||||
import CoreMedia
|
import CoreMedia
|
||||||
|
import Defaults
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@ -7,8 +8,8 @@ final class PlayerControlsModel: ObservableObject {
|
|||||||
@Published var isLoadingVideo = false
|
@Published var isLoadingVideo = false
|
||||||
@Published var isPlaying = true
|
@Published var isPlaying = true
|
||||||
@Published var presentingControls = false { didSet { handlePresentationChange() } }
|
@Published var presentingControls = false { didSet { handlePresentationChange() } }
|
||||||
@Published var presentingControlsOverlay = false { didSet { handleOverlayPresentationChange() } }
|
@Published var presentingControlsOverlay = false { didSet { handleSettingsOverlayPresentationChange() } }
|
||||||
@Published var presentingDetailsOverlay = false
|
@Published var presentingDetailsOverlay = false { didSet { handleDetailsOverlayPresentationChange() } }
|
||||||
@Published var timer: Timer?
|
@Published var timer: Timer?
|
||||||
|
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
@ -49,8 +50,8 @@ final class PlayerControlsModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleOverlayPresentationChange() {
|
func handleSettingsOverlayPresentationChange() {
|
||||||
player?.backend.setNeedsNetworkStateUpdates(presentingControlsOverlay)
|
player?.backend.setNeedsNetworkStateUpdates(presentingControlsOverlay && Defaults[.showMPVPlaybackStats])
|
||||||
if presentingControlsOverlay {
|
if presentingControlsOverlay {
|
||||||
removeTimer()
|
removeTimer()
|
||||||
} else {
|
} else {
|
||||||
@ -58,6 +59,14 @@ final class PlayerControlsModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleDetailsOverlayPresentationChange() {
|
||||||
|
if presentingDetailsOverlay {
|
||||||
|
removeTimer()
|
||||||
|
} else {
|
||||||
|
resetTimer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var presentingOverlays: Bool {
|
var presentingOverlays: Bool {
|
||||||
presentingDetailsOverlay || presentingControlsOverlay
|
presentingDetailsOverlay || presentingControlsOverlay
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,11 @@ struct ControlsOverlay: View {
|
|||||||
backendButtons
|
backendButtons
|
||||||
}
|
}
|
||||||
qualityButton
|
qualityButton
|
||||||
captionsButton
|
|
||||||
|
if player.activeBackend == .mpv {
|
||||||
|
captionsButton
|
||||||
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
decreaseRateButton
|
decreaseRateButton
|
||||||
rateButton
|
rateButton
|
||||||
|
Loading…
Reference in New Issue
Block a user