HTMLMediaElement: crossOrigin property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2016⁩.

The HTMLMediaElement.crossOrigin property is the CORS setting for this media element. See CORS settings attributes for details.

Value

A string of a keyword specifying the CORS mode to use when fetching the resource. Possible values are:

anonymous or the empty string ("")

Requests sent by the credentials mode. This means that CORS is enabled and credentials are sent if the resource is fetched from the same origin from which the document was loaded.

use-credentials

Requests sent by the credentials mode. All resources requests by the element will use CORS, regardless of what domain the fetch is from.

If the crossOrigin property is specified with any other value, it is the same as specifying as the anonymous.

If the crossOrigin property is not specified, the resource is fetched without CORS (the no-cors credentials mode).

Specifications

Specification
HTML
# dom-media-crossorigin

Browser compatibility

See also

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant