Xcode 7.2: WKWebview local file playback issues

Originator:paul
Number:rdar://24281444 Date Originated:21-Jan-2016 11:52 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7.2 (7C68)
Classification:Other Bug Reproducible:Always
 
Summary:
With a WKWebview you are supposed to be able to use loadFileURL(url, allowingReadAccessToURL:) to make local files accessible.  This works for some file types (pdfs for example) but is not working properly for videos.  Furthermore we found that if we play a video in a separate UIWebview first then video playbacks work in WKWebview!!!????  Note this issue does not exist in the simulator, just device

Steps to Reproduce:
1) Run the attached project on an iPad in landscape. 
2) The top half is a WKWebView and bottom half is UIWebview.  If you scroll the top web view you will see a few videos.  Trying playing them and they will fail and have a strike through even though read access has been given in code. 
3) kill the app and run it again,
4) now tap one of the upper videos to get the failed play, then tap one of the videos on the bottom UIWebview which will play.  
5) after playing a video in the UIWebView then go back up to the WKWebview and tap the second video which will now play.

Expected Results:
The videos should play in the WKWebview because they have read access.  You should not have to use a uiwebview to kludge access to those videos.

Actual Results:
Videos only worked in WKWebview after being played in a UIWebView

Duplicates

Number Status Originator Product Title
rdar://24281904 Duplicate/24281444 sam.lu iOS SDK WKWebView can't access local videos after given read access

Comments

I can confirm this problem exists. It indeed works from the simulator, but not from a device.


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!