- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
- Related Articles
- Is their a cross-origin attribute in HTML5?
- Rotate HTML5 Canvas around the current origin
- How to fix getImageData() error ‘The canvas has been tainted by cross-origin data’ in HTML?
- What is the usage of the cross-origin attribute in HTML5?
- How to save canvas data to file in HTML5?
- How to save HTML5 canvas data to file?
- Translating HTML5 canvas
- HTML5 Canvas distorted
- HTML5 Canvas Transformation
- Cross origin HTML does not load in Google Chrome
- Composition attribute in HTML5 Canvas?
- Drawing an image from a data URL to a HTML5 canvas
- HTML5 Canvas Transformation Matrix
- HTML5 Canvas Circle Text
- HTML5 Canvas Degree Symbol

Advertisements