我有一個處理流式視頻的應用程序。用.m3u8播放列表開始,它創建AVAssets數組,並通過AVPlayer不能在漸進式下載和流媒體之間切換
[player replaceCurrentItemWithPlayerItem:[AVPlayerItem playerItemWithAsset:[assetItems objectAtIndex:index]]]
這工作得很好,通過他們翻轉,但是在這之前我想用漸進式下載宣揚短mp4視頻。我使用
AVAsset *prerollAsset = [AVAsset assetWithURL:prerollURL];
[player replaceCurrentItemWithPlayerItem:[AVPlayerItem playerItemWithAsset:prerollAsset]];
它起着加載AVPlayer,但是當我像以前一樣繼續流式視頻,我得到AVPlayerStatusFailed的狀態,在AVPlayerItem錯誤The operation could not be completed
對於它的工作,我需要爲(漸進式下載)預卷創建一個AVPlayer對象,然後創建一個全新的AVPlayer對象來開始播放流式視頻。
單個AVPlayer實例可能無法播放漸進式下載視頻,然後是流式視頻嗎?或者可能還有其他事情我做錯了?
我遇到同樣的問題。使用MPMoviePlayerController,我們可以設置movieSourceType屬性,但不能與AVPlayer或AVPlayerItem一起使用 –
這個錯誤依然存在於iOS7.1 SDK –
@KentNguyen有點晚,但您可以閱讀https://developer.apple.com/library/mac/文檔/ AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html,查看部分**創建並準備HTTP實況流以供播放** – onmyway133