title: AVPlayer / AVFoundation play specified HLS bandwidth and resolution
body: <p>Is there any good solution of iOS AVPlayer to let user choose specified HLS video resolution / bandwidth?</p>
  
  <p>So the question will be separated in to two</p>
  
  <ol>
  <li>Get the resolution / bandwidth list in m3u8:</li>
  <li>Specify the stream resolution and bandwidth</li>
  </ol>
  
  <p>For 1. A workaround solution is to get <code>indicatedBitrate</code> of
      <code>AVPlayerItemAccessLogEvent</code>
  (<a href="https://stackoverflow.com/questions/36689135/get-bandwidth-of-stream-from-m3u-stream">Get bandwidth of stream from m3u stream</a>)
  The other possible solution is to download and parse m3u8, apart from the AVPlayer interface.</p>
  
  <p>For 2. A workaround solution to change the default adaptive behavior of AVPlayer is to use <code>preferredPeakBitRate</code> or <code>preferredMaximumResolution</code>. But video quality might still get lower if network gets slower. (<a href="https://stackoverflow.com/questions/22039484/change-hls-bandwidth-manually">Change HLS bandwidth manually?</a>)</p>
  
  <p>Thank you.</p>