I know this question is all over Stack Overflow but still, most of them are old and not related with what I\'m going to ask here.
So I\'ve got an array with AV
Using this code solved the problem for me:
player?.pause() let playerItem = AVPlayerItem(asset: myAsset) player = nil player = AVPlayer() player?.replaceCurrentItem(with: playerItem)
Instead of:
player?.pause() player = nil player = AVPlayer() player?.replaceCurrentItem(with: availablePlayerItem) // availablePlayerItem is a playerItem which has been created before and played once with this AVPlayer
Note: In both codes, the "player" is a global variable in my class which is:
var player : AVPlayer? = nil