Skip to content

Commit d48dc08

Browse files
committed
Update LoopingPlayerProtocol.swift
1 parent 44d3c50 commit d48dc08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,13 @@ internal extension LoopingPlayerProtocol {
7878
let wasPlaying = player.rate != 0
7979

8080
if wasPlaying {
81-
player.pause()
81+
pause()
8282
}
8383

8484
// Cleaning
8585
unloop()
8686
clearPlayerQueue()
8787
removeAllFilters()
88-
8988

9089
// Replace the current item
9190
let newItem = AVPlayerItem(asset: asset)
@@ -215,9 +214,10 @@ internal extension LoopingPlayerProtocol {
215214
removeAllFilters()
216215

217216
player = nil
217+
delegate = nil
218218

219219
#if DEBUG
220-
print("Cleaned up AVPlayer and observers.") // Debug log for confirming cleanup.
220+
print("Cleaned up Player!")
221221
#endif
222222
}
223223

0 commit comments

Comments
 (0)