An audio player with two source files. The browser should choose which file (if any) it has support for:
The <source> tag is used to specify multiple media resources for media elements, such as <video> and <audio>.
The <source> tag allows you to specify alternative video/audio files which the browser may choose from, based on its media type or codec support.
The numbers in the table specify the first browser version that fully supports the element.
Element | |||||
---|---|---|---|---|---|
<source> | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
The <source> tag is new in HTML5.
= New in HTML5.
Attribute | Value | Description |
---|---|---|
media | media_query | Specifies the type of media resource |
src | URL | Specifies the URL of the media file |
type | media_type | Specifies the media type of the media resource |
The <source> tag also supports the Global Attributes in HTML.
The <source> tag also supports the Event Attributes in HTML.
HTML tutorial: HTML5 Video
HTML tutorial: HTML5 Audio
HTML DOM reference: Source Object
None.