I'm able to play a normal HLS video in AV Player without any trouble. But how do I play a AES-128 encrypted HLS Video?
To decode an AES-128/similar encrypted HLS Video, just add 'Authorization' to your header.
let headers = ["Authorization": "Bearer xxxxxxxxxxxxxxxx..."]
let avAsset = AVURLAsset(url: videoURL, options: ["AVURLAssetHTTPHeaderFieldsKey": headers])
let avItem = AVPlayerItem(asset: avAsset)
let avPlayer = AVPlayer(playerItem: avItem)
.
.
.
Thanks @SeanLintern88 for helping me out on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With