From a3ba1cb6df128077513cf895205557fe9e5d4597 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 11 Nov 2022 12:34:55 +0100 Subject: [PATCH] Improve opening videos --- Model/OpenVideosModel.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Model/OpenVideosModel.swift b/Model/OpenVideosModel.swift index 03a21752..a28d4135 100644 --- a/Model/OpenVideosModel.swift +++ b/Model/OpenVideosModel.swift @@ -97,7 +97,15 @@ struct OpenVideosModel { if playbackMode == .playNow || playbackMode == .shuffleAll { player.show() - player.advanceToNextItem() + #if os(iOS) + if player.presentingPlayer { + player.advanceToNextItem() + } else { + player.onPresentPlayer.append { [weak player] in player?.advanceToNextItem() } + } + #else + player.advanceToNextItem() + #endif } }