mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Faster replacing player item
This commit is contained in:
@@ -29,6 +29,7 @@ extension PlayerModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func playNow(_ video: Video, at time: TimeInterval? = nil) {
|
func playNow(_ video: Video, at time: TimeInterval? = nil) {
|
||||||
|
player.replaceCurrentItem(with: nil)
|
||||||
addCurrentItemToHistory()
|
addCurrentItemToHistory()
|
||||||
|
|
||||||
enqueueVideo(video, prepending: true) { _, item in
|
enqueueVideo(video, prepending: true) { _, item in
|
||||||
@@ -92,6 +93,7 @@ extension PlayerModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func advanceToItem(_ newItem: PlayerQueueItem, at time: TimeInterval? = nil) {
|
func advanceToItem(_ newItem: PlayerQueueItem, at time: TimeInterval? = nil) {
|
||||||
|
player.replaceCurrentItem(with: nil)
|
||||||
addCurrentItemToHistory()
|
addCurrentItemToHistory()
|
||||||
|
|
||||||
remove(newItem)
|
remove(newItem)
|
||||||
|
Reference in New Issue
Block a user