Search code examples
encryptionmpmovieplayercontrollerm3u8

MPMoviePlayerController - modify m3u8 file before playing


I have a URL for a m3u8 file. It lists all the .ts files which are encrypted using AES-128 encryption. The m3u8 file also contains URI for the decryption keys.

Here's where it gets tricky. The URI for the keys is inside a corporate firewall that my app can't access without a VPN. To solve this, I have a proxy server setup which can tunnel HTTP requests of my app to this URI, so this usable even outside the VPN. I am trying to figure out a way I can replace the URI for the keys in the m3u8 file with my proxy servers URL and make it work.

Any ideas?

Thanks in advance!


Solution

  • I was able to solve this by using NSURLProtocol and handling all HTTP requests made by the MPMoviePlayerController and tunneling them to my own web server.