UIWebView fails to play inline media using a custom URL protocol

Originator:michael
Number:rdar://8692954 Date Originated:11/21/2010
Status:Open Resolved:
Product:iPhone SDK Product Version:4.1
Classification:Serious Bug Reproducible:Always
 
Our OS X software can generate static self-contained web sites that mimic the look and feel of our documents.  Currently users locate these in the root folder of their local web server for sharing with other users.   Now we are developing an iOS app that allows the user to connect directly to the OS X app, select the desired document, and display the HTML version in a UIWebView.    We do this using a custom NSURLProtocol subclass that fetches the pages from the OS X app as they are requested by the UIWebView.

The original documents accept audio and video media as attachments, such as mp3 and mov files, allowing them to be played inline using embedded QuickTime views.  The web versions emulate this by using <embed> tags.   The problem is that the <embed> tags, or even just <a> links, do not seem to work in the UIWebView if they are resolved against the base URL which uses our custom protocol.    They work if the src URL uses an http protocol addressing a web server, but not our custom protocol.    The protocol handler does get a -canInitWithRequest: call, but an instance is never created.

The custom protocol handler works great for all other files, including html, css, js, and all other non-Quicktime media types.

Steps to Reproduce:

Create a custom subclass of NSURLProtocol and use it in an <embed> or <a> tag in a UIWebView to reference some QuickTime-playable movie or audio.

Expected Results:

Embedded media and links to media using a custom URL protocol would result in the creation of a protocol instance and a call to -startLoading, and the plugin uses the data provided by -URLProtocol:didLoadData:

Actual Results:

+canInitWithRequest: is called but no instance is ever created.

Regression:

Notes:

This may be a duplicate of bug #8446587

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!