Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems that until Apple lets us control what NSURLConnections the AVPlayer uses the only answer seems to be to implement a HTTP loopback server.</p> <p>To quote the apple representative that answered our support question:</p> <blockquote> <p>Another option is to implement a loopback HTTP server and point client objects at that. The clients can use HTTP (because their requests never make it off the device), while the loopback HTTP server itself can use HTTPS to connect to the origin server. Again, this gives you access to the underlying NSURLConnections, allowing you to do custom server trust evaluation.</p> <p>Using this technique with UIWebView is going to be tricky unless you completely control the content at the origin server. If the origin server can return arbitrary content, you have to grovel through the returned HTTP and rewrite all the links, which is not much fun. A similar restriction applies to MPMoviePlayerController/AVPlayer, but in this case it's much more common to control all of the content and thus be able to avoid non-relative links.</p> </blockquote> <p>EDIT: I managed to implement a loopback server using custom implemenations of the HTTPResponse and HTTPConnection classes found in <a href="https://github.com/robbiehanson/CocoaHTTPServer" rel="nofollow noreferrer">CocoaHTTPServer</a></p> <p>I can´t disclose the source, but I used NSURLConnection together with a mix of the AsyncHTTPResponse and DataHTTPResponse demonstration responses.</p> <p>EDIT: Remember to set <code>myHttpServerObject.interface = @"loopback";</code></p> <p>EDIT: WARNING!!! This approach does not seem to work with airplay since the airplay device will ask 127.1.1.1 for encryption keys. The correct approach seems to be defined here: <a href="https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AirPlayGuide/EncryptionandAuthentication/EncryptionandAuthentication.html#//apple_ref/doc/uid/TP40011045-CH5-SW1" rel="nofollow noreferrer">https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AirPlayGuide/EncryptionandAuthentication/EncryptionandAuthentication.html#//apple_ref/doc/uid/TP40011045-CH5-SW1</a></p> <p>"Specify the keys in the .m3u8 files using an application-defined URL scheme."</p> <p>EDIT: <strong>An apple TV and iOS update has resolved the issue mentioned in the edit above!</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload