跨源视频在Safari [英] cross-origin video in Safari

查看:318
本文介绍了跨源视频在Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道Safari是否支援HTML5 < video> 标记上的 crossorigin 我从服务器提供视频,响应所有需要的CORS头,我使用下面的标记将视频嵌入到我的页面。该网页是从其他网域投放的。

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">


然后将视频绘制到画布上,并使用 toDataURL API从画布中获取图像。这可以在Chrome和Firefox中使用,但Safari会抛出安全错误,就像视频上没有 crossorigin 属性。

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.

任何想法?

推荐答案

看起来Safari不支持crossorgin属性,有一个推文 https://twitter.com/sonnypiers/status/187513545397776384 ,周围的图像,但我不认为它有助于视频。

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.

这篇关于跨源视频在Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆