The HTML5 source Tag
The <source> tag is applicable for media sources that have to work along with the media elements. For authors who need to put <video> or <audio> elements within the HTML document, the HTML5 <source> tag has to be placed too. By doing this, the alternate audio or video sources that can be used by the web browsers are specified. It has to be noted though that selection may depend on the codec support or media type.
The HTML5 <source> tag is newly introduced in HTML5. This is not used in HTML4.01. The good thing about <source> tag is that even if it is new in HTML5, this is well-accepted in Google Chrome, Safari, Opera, Internet Explorer and Firefox. The HTML5 <source> tag has support for Event Attributes and Global Attributes too.
The attributes for the HTML5 <source> tag are provided below.
Attribute |
Value |
Description |
media (New) |
media_query |
Determines the type of media that is used as resource |
src (New) |
URL |
Provides information about the URL of the media file |
type (New) |
MIME_type |
This is the indicator of the MIME type for the media resource |