repeat AVPlayerItem in AVQueuePlayer

ぐ巨炮叔叔 提交于 2019-12-07 09:41:10

问题


I am using AVQueuePlayer to play my list of videos. I want to play one video continuously unless I call for second video to play. Now, Video1 plays and when it ends, calls for video2 to play which I don't like.

Secondly, there is a delay in between two videos. Is there any way of smooth transition from 1 video to second one?


回答1:


Regarding your first question: Set the AVQueuePlayer's actionAtItemEnd property to AVPlayerActionAtItemEndNone. Then register for AVPlayerItemDidPlayToEndTimeNotification and inside the function that treats this notification call [player seekToTime:kCMTimeZero], which plays your current video from the beginning.
Second question: You could take care of this case inside the above function also.



来源:https://stackoverflow.com/questions/4890087/repeat-avplayeritem-in-avqueueplayer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!