jump

HTML 5: The Markup Language (ARIA Edition)

sourcemedia source NEW # T

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

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
src = non-empty URL potentially surrounded by spaces #
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).
A string that identifies a valid MIME media type as defined in [RFC 2046].
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).
A valid media query list as defined in [Media Queries].

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;
};