我要重用AVPlayerItem
但不斷收到此錯誤:如何從AVPlayerItem斷開AVPlayer?
An AVPlayerItem cannot be associated with more than one instance of AVPlayer
想重新使用它之前,我破壞了以前的AVPlayer是這樣的:
[self.player pause];
[self.player replaceCurrentItemWithPlayerItem:nil];
self.player = nil;
爲什麼仍然是相關的AVPlayerItem以及如何斷開它?
這裏是問題的一個完整的再現(僅50行BTW)一個要點是:https://gist.github.com/sbiermanlytle/14a6faab515f7691b810789086ae9e50
您可以通過創建一個新的單一視圖的應用程序,並且排擠掉了的ViewController執行該代碼運行。