Bug 151294 - HtmlMediaElement missing "crossOrigin" attribute therefore CORS does not work
Summary: HtmlMediaElement missing "crossOrigin" attribute therefore CORS does not work
Status: RESOLVED DUPLICATE of bug 103257
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-14 21:28 PST by Daniel Rossi
Modified: 2015-11-16 05:11 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Rossi 2015-11-14 21:28:37 PST
Hi I'm not sure if anyone has mentioned this but this standard has been around for a long time now. 

This is not implemented therefore this type of code will not work

this.canvas = document.createElement("canvas");
    this.canvas.setAttribute("width", width);
    this.canvas.setAttribute("height", height);
var ctx = this.canvas.getContext('2d');
 ctx.drawImage(video,0, 0, width, height, x, y, width, height);
var dataURL = this.canvas.toDataURL("image/" + this.type, this.quality);

Both Safari in OSX and IOS, Android default browser and IE11 suffer the same issue. 

It requires a proxy work around setting up a new video for capture or requires Flash to do the capture !   to think it needs a work around like this is silly considering Apple's stance against Flash but then requiring Flash to do captures of video frames. 

It is a fairly common requirement and the deviation from standards is troubling. 

I believe there is a ticket in regards to the 360 webGL CORS which is quickly becoming popular and will be needed. But this is not just drawing to the canvas but "toDataUR" to get the image data uri also. 

Let me know.
Comment 1 Daniel Rossi 2015-11-14 21:31:15 PST
The video object is 

<video crossOirign="anonymous" src="source.mp4"/> 

btw
Comment 2 Daniel Rossi 2015-11-15 00:14:58 PST
drawImage for video is reported to be intentionally disabled on IOS so this only applies to desktop Safari. 

I just checked, even with the proxy work around, its a blank image, nothing gets drawn. 

What a croc html5 has become. So basically this feature so far doesn't even work on IOS or Android.
Comment 3 Alexey Proskuryakov 2015-11-15 13:09:35 PST
Duping this to an earlier bug about HTMLMediaElemant and crossOrigin, although I'm not sure what you mean by "capture". HTML Media Capture <http://www.w3.org/TR/html-media-capture/> doesn't look like this.

*** This bug has been marked as a duplicate of bug 103257 ***
Comment 4 Daniel Rossi 2015-11-15 23:05:18 PST
Sorry mate I didn't see that I would have assumed there is something.
Comment 5 Daniel Rossi 2015-11-16 05:11:06 PST
The requirement is pretty redundant on Iphone for now because I can't even get any html controls over the native player and it has no inline support. So no capture button is possible for end users. I'm trying to figure out a work around solution.