|Summary:||iOS 11.4 breaks video playback in Cordova apps|
|Product:||WebKit||Reporter:||Ashley Gullen <ashley>|
|Component:||WebKit Misc.||Assignee:||Nobody <webkit-unassigned>|
|Severity:||Major||CC:||beidson, bfulgham, cdumez, dbates, eric.carlson, jer.noble, webkit-bug-importer, youennf|
|Hardware:||iPhone / iPad|
Description Ashley Gullen 2018-06-06 09:21:58 PDT
Cordova apps on iOS run on the file:// protocol in WKWebView. Because there is still no solution to issue 154916, some subresources unnecessarily count as cross-origin. One example is rendering video in WebGL. The video must count as same-origin to be able to upload to a texture. To work around this, our framework (construct.net) previously would use cordova-plugin-file to read the video file as a blob, use URL.createObjectURL(blob), and then assign that to the video source. However as of iOS 11.4, this now appears to create a blob with an origin of 'null', which *still* counts as a cross-origin resource. Therefore video uploads to textures fail with a SecurityError. As a result all existing iOS apps made using our framework are no longer able to display video in iOS 11.4. I cannot even find any work around to make the video count as same-origin, so I don't even know if we can update our framework. Please at least allow video playback from a blob URL in this case. To demonstrate the problem, here is a Cordova iOS project that plays video in a WebGL context: https://www.dropbox.com/s/izhjf84abzvztqb/ios-local-video-test.zip?dl=0 The video plays and the audio track can be heard, but it does not appear, because it is throwing a SecurityError every frame trying to update the texture.
Comment 2 Brent Fulgham 2018-06-15 08:44:37 PDT
Could you attach some logging showing the security exceptions being generated? We are not familiar with Cordova building and debugging, so need some additional context. Is it possible to create a test case outside of Cordova that demonstrates the CORS issue you think is happening?
Comment 3 Brent Fulgham 2018-06-15 11:22:23 PDT
This behavior change started with Bug 178573, where we began supporting createImageBitmap. That caused this test app to not display audio or video. Later, in Bug 183247, audio began working again when Blob support was added. I think we actually have an issue where an underling Cordova component sees that 'createImageBitmap' is available and tries to use it. Unfortunately, createImageBitmap with ImageData is not currently implemented, which causes us to return a blank ImageBitmap. I don't know how to do further debugging in Cordova, but I think this is just a compatibility issue due to the incomplete createImageBitmap implementation.
Comment 4 Ashley Gullen 2018-06-19 07:55:06 PDT