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.
I then draw the video to a canvas and get the image from the canvas using
<video controls crossorigin="anonymous" src="http://example.com/movie.mp4">
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?
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.
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.
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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With