From 62bff9283cc788eb6e809f5713d624d988a2821e Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 6 Dec 2021 19:12:02 +0100 Subject: [PATCH] Faster replacing player item --- Model/Player/PlayerQueue.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Model/Player/PlayerQueue.swift b/Model/Player/PlayerQueue.swift index 8a6a4e68..d43a0dec 100644 --- a/Model/Player/PlayerQueue.swift +++ b/Model/Player/PlayerQueue.swift @@ -29,6 +29,7 @@ extension PlayerModel { } func playNow(_ video: Video, at time: TimeInterval? = nil) { + player.replaceCurrentItem(with: nil) addCurrentItemToHistory() enqueueVideo(video, prepending: true) { _, item in @@ -92,6 +93,7 @@ extension PlayerModel { } func advanceToItem(_ newItem: PlayerQueueItem, at time: TimeInterval? = nil) { + player.replaceCurrentItem(with: nil) addCurrentItemToHistory() remove(newItem)