Pre-buffering for AVQueuePlayer

前端 未结 6 2053
-上瘾入骨i
-上瘾入骨i 2020-11-28 04:23

Does anyone know if AVQueuePlayer starts buffering the next AVPlayerItem when the current item is about to finish playing?

I know there\'s

6条回答
  •  -上瘾入骨i
    2020-11-28 04:34

    You can use three AVPlayers. First is previous, second is current and last is next. When current is playing, play last player as preloading and observe its status. When the preloading player's status becomes AVPlayerStatusReadyToPlay, stop it and call next lines: [player.playerItem cancelPendingSeeks]; [player.playerItem.asset cancelLoading];

    These codes will prevent pre-loading all data of the video.

提交回复
热议问题