简体   繁体   中英

How to implement 'Adaptive Bit Rate' (HLS) with AVPlayer in iOS 9+

I am trying to implement adaptive bit rate with AVPlayer but i don't know how to switch between a low/high stream. I am a bit confused and have few questions:

  1. Is it the sole responsibility of the server to implement HLS on its side OR the client also has to do something about it OR the client handles it automatically?

  2. I am getting the following URLs from server, can someone tell me how to switch between the them based on network speed and what other steps are involved?

{ "VideoStreamUrl": " http://50.7.149.74:1935/pitvlive/aplus3.stream/playlist.m3u8 ?", "VideoStreamUrlLow": " http://50.7.149.74:1935/pitvlive/aplus3_240p.stream/playlist.m3u8 ?", "VideoStreamUrlHD": null }

AVPlayer supports HLS natively from the framework so you shouldnt need to do anything to support this.

The framework will automatically switch between low and high streams according to the current available bandwidth, so you dont actually need to pick a stream.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM