AVPlayer seekToTime does not play at correct position

前端 未结 5 1190
忘了有多久
忘了有多久 2021-01-31 03:31

I have an AVPlayer which is playing a HLS video stream. My user interface provides a row of buttons, one for each \"chapter\" in the video (the buttons are labeled \"1\", \"2\",

5条回答
  •  春和景丽
    2021-01-31 04:09

    My suggestion: 1) Don't use [avplayer seekToTime: toleranceBefore: toleranceAfter: ], this will delay your seek time 4-5 seconds.

    2) HLS video cut to 10 seconds per segment. Your chapter start postion should fit the value which is multipes of 10. As the segment starts with I frame, on this way, you can get quick seek time and accurate time.

提交回复
热议问题