0

Is there any good solution of iOS AVPlayer to let user choose specified HLS video resolution / bandwidth?

So the question will be separated in to two

  1. Get the resolution / bandwidth list in m3u8:
  2. Specify the stream resolution and bandwidth

For 1. A workaround solution is to get indicatedBitrate of AVPlayerItemAccessLogEvent (Get bandwidth of stream from m3u stream) The other possible solution is to download and parse m3u8, apart from the AVPlayer interface.

For 2. A workaround solution to change the default adaptive behavior of AVPlayer is to use preferredPeakBitRate or preferredMaximumResolution. But video quality might still get lower if network gets slower. (Change HLS bandwidth manually?)

Thank you.

CJ Lin
  • 712
  • 1
  • 6
  • 12
  • 1
    Sounds like you need a m3u8 parser. e.g. https://github.com/alexsun/M3U8Paser – Vincent Sit Oct 01 '18 at 07:49
  • check out this https://github.com/alexsun/M3U8Paser/blob/b72ba607e1ab72cbc2aee839a2d24b9751d08f8a/Source/Master%20Playlist/M3U8ExtXStreamInf.h#L48 – Vincent Sit Oct 01 '18 at 07:52

0 Answers0