HTML <audio> crossorigin Attribute
The HTML crossorigin Attribute is used in the <audio> element that supports a CORS request when we tried to fetch out the audio files from the third-party servers or from another domain.
<audio crossorigin="anonymous | use-credentials">
- anonymous: It has a Default value. It defines a CORS request will be sent without passing the credentials information.
- use-credentials: A cross-origin request will be sent with credentials, cookies, and certificate.
Example: The below code illustrates the use of crossorigin attribute in <audio> element. It is set to “anonymous” value which retrieved the audio files without passing credentials information.
- Google Chrome 94.0 & above
- Firefox 92.0 & above
- Microsoft Edge 93.0
- Opera 79.0