From d48dc0882eee1067ad4d6bb885c5e93088b342e8 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 14 Aug 2024 12:26:02 +0200 Subject: [PATCH] Update LoopingPlayerProtocol.swift --- .../protocol/view/LoopingPlayerProtocol.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift b/Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift index 430f65d..7eef451 100644 --- a/Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift +++ b/Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift @@ -78,14 +78,13 @@ internal extension LoopingPlayerProtocol { let wasPlaying = player.rate != 0 if wasPlaying { - player.pause() + pause() } // Cleaning unloop() clearPlayerQueue() removeAllFilters() - // Replace the current item let newItem = AVPlayerItem(asset: asset) @@ -215,9 +214,10 @@ internal extension LoopingPlayerProtocol { removeAllFilters() player = nil + delegate = nil #if DEBUG - print("Cleaned up AVPlayer and observers.") // Debug log for confirming cleanup. + print("Cleaned up Player!") #endif }