Advertisement
Home Open Editor ❯

HTML <audio> crossorigin Attribute

Example

<audio control crossorigin="anonymous">
  <source src="cat.mp3" type="audio/mpeg">
  <source src="cat.ogg" type="audio/ogg">
  Your browser does not support the audio tag.
</audio>

Try this code ❯

Meaning

The crossorigin attribute specifies the fetching of the audio must be done using a Cross-Origin Resource Sharing request.

Audio data from a Cross-Origin Resource Sharing enabled audio returned from a Cross-Origin Resource Sharing request can be reused in the <canvas> element without being marked "tainted".


Standard Syntax

<audio crossorigin="anonymous|use-credentials">
  <source src="Source(URL)" type="mediaType">
  Your browser does not support the audio tag.
</audio>


Advertisement

Attribute Values

Value Description
anonymous A Cross-Origin Resource Sharing request is sent with credentials omitted.
use-credentials The Cross-Origin Resource Sharing request is sent with any credentials included.
Home Open Editor ❯
Advertisement