<audio crossorigin="anonymous" controls> <source src="/media/epic.mp3" type="audio/mpeg"> <source src="/media/epic.wav" type="audio/wav"> </audio>
Note: the example audio files are not retrieved from a third party server, but you get the idea.
The crossorigin attribute specifies that the audio element supports CORS.
CORS stands for Cross Origin Resource Sharing.
CORS is a standard mechanism to retrieve audio files from a third party domain or server.
If specified, the audio file request will be sent with or without credentials.
Note: This attribute is only relevant when the audio file is retrieved from a third party server or domain.
<audio crossorigin="anonymous | use-credentials">
|anonymous or "" or blank||
A cross-origin request will be sent without credentials and performs basic HTTP authentication.
This is the default. Note:
|use-credentials||A cross-origin request will be sent with credentials, cookies, and certificate.|
Here is when crossorigin support started for each browser:
Back to <audio>