HTMLMediaElement

An abstract interface — no tag creates one directly. Extends HTMLElementElement.

Reflected properties

All setters are guarded and throw NoModificationAllowedError on a read-only document.

Property Attribute Type Notes
src src string Reflects verbatim — no base-URL resolution.
crossOrigin crossorigin nullable enum Keywords: anonymous · use-credentials. Missing attribute → null; any other present value → "anonymous"; assigning null removes the attribute.
preload preload string Reflects the content attribute verbatim.
autoplay autoplay boolean (presence) Reading reflects whether the attribute is present; writing false removes it, any other value sets it present.
loop loop boolean (presence) Reading reflects whether the attribute is present; writing false removes it, any other value sets it present.
controls controls boolean (presence) Reading reflects whether the attribute is present; writing false removes it, any other value sets it present.

See also