I want to reuse AVPlayerItem, but keep getting this error:
AVPlayerItem
An AVPlayerItem cannot be associated with more than one instance of AVPlayer
Before trying to reuse it, I destroy the previous AVPlayer as follows:
[self.player pause]; [self.player replaceCurrentItemWithPlayerItem:nil]; self.player = nil;
why is AVPlayerItem still connected and how to disable it?
Here is a Gist with full reproduction of the problem (only 50 lines by the way): https://gist.github.com/sbiermanlytle/14a6faab515f7691b810789086ae9e50
You can run it by creating a new Single View application and displacing the ViewController implementation with this code.
AVPlayerItems. , , , , , NULL, item NULL..
. URL-, AVAsset ( ...) , , PlayerItem, .
AVPlayerItem* newPlayerItem = [AVPlayerItem playerItemWithAsset:playerItem.asset];
. - "" , . .
Source: https://habr.com/ru/post/1618040/More articles:Send an email using javax.mail using your existing InputStream as attachment content - javaкаковы опасности использования Mutable thisarg или контекста с помощью javascript - javascriptCMD Echo Command сохраняет только последнюю строку текста - windowsAVPlayerItemStatus Error when too many instances of AVPlayer occur - iosWhy does "foo" .class === String return false? - stringSimplification-Java (by hgoebl) Problem with a list of abbreviated points Always size 2 - javaInfluxDB Betting - Time-seriesClear screen in watch command - linuxlimitations of button buttons in yii2 - phpHow to list all background values in bash - bashAll Articles