Cross-Origin Data in HTML5 Canvas



For cross-origin data in canvas, add the following attribute to the <audio? or <video> element −

<img src="..." crossorigin="Anonymous" />
<video src="..." crossorigin="Anonymous"></video>

To enable cross-origin resource sharing, use the following. It allows the images to pass the HTTP header with an image response.

Access-Control-Allow-Origin: *

Or to solve the cross-origin data issue, use the following parameter −

--allow-file-access-from-files
Updated on: 2020-06-25T06:39:27+05:30

364 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements