Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cross-origin video in Safari

Does anyone know if Safari supports crossorigin attribute on the HTML5 <video> tag? I serve video from a server that responds with all needed CORS headers, and I use the markup below to embed the video to my page. The page is served from a different domain.

<video controls crossorigin="anonymous" src="http://example.com/movie.mp4">
I then draw the video to a canvas and get the image from the canvas using toDataURL API. This works in Chrome and Firefox, but Safari throws the security error as if there were no crossorigin attribute on the video.

Any ideas?

like image 572
akonsu Avatar asked Aug 10 '12 17:08

akonsu


People also ask

How do I turn off cross-origin restrictions in Safari?

Open the Safari browser. From the menu bar, go to Safari > Preferences. In the preferences dialog, go to the Privacy tab and disable the Prevent cross-site tracking permission.

How do I set crossorigin anonymously?

Setting the attribute name to an empty value, like crossorigin or crossorigin="" , is the same as anonymous . An invalid keyword and an empty string will be handled as the anonymous keyword.

What is crossorigin anonymous mean?

Specifies the mode of the CORS request: anonymous - A cross-origin request is performed. No credentials are sent. use-credentials - A cross-origin request is performed. Credentials are sent (e.g. a cookie, a certificate, a HTTP Basic authentication)


1 Answers

It appears that Safari does not support the crossorgin attribute, but I can't find anything official. There is this tweet https://twitter.com/sonnypiers/status/187513545397776384 with a work-around for images, but I don't think it helps for video.

like image 152
Sean Gilligan Avatar answered Oct 22 '22 11:10

Sean Gilligan