mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 22:30:32 +05:30
Fix updating controls buttons status
This commit is contained in:
parent
9bf45a26d2
commit
616886f0d2
@ -51,7 +51,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
@Published var availableStreams = [Stream]() { didSet { handleAvailableStreamsChange() } }
|
@Published var availableStreams = [Stream]() { didSet { handleAvailableStreamsChange() } }
|
||||||
@Published var streamSelection: Stream? { didSet { rebuildTVMenu() } }
|
@Published var streamSelection: Stream? { didSet { rebuildTVMenu() } }
|
||||||
|
|
||||||
@Published var queue = [PlayerQueueItem]() { didSet { Defaults[.queue] = queue } }
|
@Published var queue = [PlayerQueueItem]() { didSet { handleQueueChange() } }
|
||||||
@Published var currentItem: PlayerQueueItem! { didSet { handleCurrentItemChange() } }
|
@Published var currentItem: PlayerQueueItem! { didSet { handleCurrentItemChange() } }
|
||||||
@Published var videoBeingOpened: Video?
|
@Published var videoBeingOpened: Video?
|
||||||
@Published var historyVideos = [Video]()
|
@Published var historyVideos = [Video]()
|
||||||
@ -485,6 +485,12 @@ final class PlayerModel: ObservableObject {
|
|||||||
backend.closePiP(wasPlaying: wasPlaying)
|
backend.closePiP(wasPlaying: wasPlaying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleQueueChange() {
|
||||||
|
Defaults[.queue] = queue
|
||||||
|
|
||||||
|
controls.objectWillChange.send()
|
||||||
|
}
|
||||||
|
|
||||||
func handleCurrentItemChange() {
|
func handleCurrentItemChange() {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
Windows.player.window?.title = windowTitle
|
Windows.player.window?.title = windowTitle
|
||||||
|
Loading…
Reference in New Issue
Block a user