![](/img/trans.png)
[英]Canvas that created from video raising "Tainted canvases may not be exported." error when saving
[英]CORS error when reading video from canvas (tainted canvas)
我正在運行一個我要寫入畫布的HLS流; 然后從畫布中讀取像素。
視頻會被渲染到畫布A-ok,但它會在以下位置啟動:
myPixel = c.getImageData(200, 200, 1, 1).data;
失敗的地方:
[Error] SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
[Error] Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
我已將Wowza流媒體服務器上的跨域設置設置為:
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
客戶端視頻元素上的crossOrigin="anonymous"
。
它在同一網絡上的不同計算機上運行並失敗,所有計算機都運行Safari 7.0.2 / Mac。
調試這個有什么好主意嗎?
如果您的修改適用於某些計算機而不適用於其他配置相同的計算機,請嘗試清除行為不當的計算機上的緩存。
強制重新加載行為不端的mac,如下所示:
按住Shift
和Cmd
並按R
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.