HTML: The Markup Language

sourcemedia source NEW # T

The source element enables multiple media sources to be specified for audio and video elements.

Permitted content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

src = URI
The address of the media source.
type = MIME type
The type of the media source (used for helping the UA determine, before fetching this media source, if it can play it).
media = media-query list
The intended media type of the media source (used for helping the UA determine, before fetching this media source, if it is useful to the user).

Tag omission #

The source element is a void element. A source element must have a start tag but must not have an end tag.

Permitted parent elements #

audio, video

Details #

Each separate media source specified within a source element is a complete set of media data — for example, a complete video file, or a complete audio file).

DOM interface #

interface HTMLSourceElement : HTMLElement {
           attribute DOMString src;
           attribute DOMString type;
           attribute DOMString media;
};