Conversation
…pect the crossOrigin setting (video's can be used in canvasses)
| } | ||
|
|
||
| var crossOrigin = this._item.crossOrigin; | ||
| if (crossOrigin == true) { crossOrigin = "Anonymous"; } |
There was a problem hiding this comment.
should this be ===, otherwise it's possible to coerce to true under certain conditions, or is that the intent?
There was a problem hiding this comment.
I copied it from the ImageLoader:
Not sure if there is a reason, I just wanted to make it follow the same logic :-)
There was a problem hiding this comment.
Actually I think you are right, it should be === in both places. I'll add it to this PR.
There was a problem hiding this comment.
Just getting to this late... is there really any way around crossOrigin issues... I have always found them not to work - or has the what you are solving here been the problem all along? Anyway, has this worked out for you guys? Thanks.
There was a problem hiding this comment.
Hi Danzen
Not entirely sure what you mean, crossOrigin on images has always worked for me (note that you need to setup cors headers in your image responses in order to get it to work). This pull request adds the ability to request crossOrigin resources for both audio and video.
Audio is probably not really relevant, as for video: I'm drawing a video on my canvas (frame per frame) through createjs. If my video is not loaded from the same domain or crossOrigin isn't set, it throws security warnings. That's why my PR adds the crossOrigin parameter to all media items.
As for the 'strict equal': I don't really think it matters a lot as I can't imagine anyone setting the crossorigin for these types of things to anything other than 'anonymous'. However, maybe someone has a use-case for this, so changing it to strict equal seems to be the right thing to do. (Setting crossOrigin to 'use-credentials' would evaluate to 'true' and would thus set the html property to 'anonymous' :-))
My build is live at https://client.quizwitz.com/test.html, testMultipleChoiceWithVideoAttachment uses a cross domain video and testMultipleChoiceWithAttachment uses a cross domain image.
There was a problem hiding this comment.
Yikes - sorry missed this again. I meant, I had never been able to get crossorigin on video to work and reading this again, that is what you are solving. Accepting...
…true, to allow setting it to other values than Anonymous by providing a string.
danzen
left a comment
There was a problem hiding this comment.
Updated with provided code.
| } | ||
|
|
||
| var crossOrigin = this._item.crossOrigin; | ||
| if (crossOrigin == true) { crossOrigin = "Anonymous"; } |
There was a problem hiding this comment.
Yikes - sorry missed this again. I meant, I had never been able to get crossorigin on video to work and reading this again, that is what you are solving. Accepting...
Video and audio (= media) should also use the crossOrigin property, as otherwise they could taint canvases and probably other things.