This page is describing the attributes assigned only to media group of HTML5 elements.
Attributes and related elements:
src attribute:
<video>, <audio>, <source>, <track>, <embed />
type attribute:
<video>, <audio>, <source>, <embed />
srclang attribute:
autoplay attribute:
controls attribute:
muted attribute:
loop attribute:
preload (metadata, auto, none) attribute:
poster attribute:
media attribute:
kind (captions, chapters, subtitles, descriptions, metadata) attribute:
label attribute:
default attribute:
width and height attributes:
Attribute characteristics and purpose:
- <video>: provides the path of the video file in form of URL
- <audio>: provides the path of the audio file in form of URL
- <source>: provides the path of the media (video or audio) file in form of URL
- <track>: provides the path of the text track data file in form of URL; the file has to be in a specific format, such as a WebSRT or WebVTT; this attribute is required
- <embed />: provides the path of the external file to be used; it has to be in a form of URL
- <video>: defines MIME-type of the media source
- <audio>: defines MIME-type of the media source
- <source>: defines a valid MIME-type of the media source (.mp3, .ogg. wav...); browser determines whether to play it or not
- <embed />: specifies the media type that of the embedded object
- <video>: tells a browser whether to start playing the video as soon as it loads or not; value is Boolean
- <audio>: tells a browser whether to start playing the audio as soon as it loads or not; value is Boolean
- <video>: if enabled, provides a browser default video controls; a Boolean value
- <audio>: if enabled, provides a browser default audio controls; a Boolean value
- <video>: used to mute an automatic play during loading or other states; not well supported by browsers
- <audio>: used to mute an automatic play during loading or other states; not well supported by browsers
- <video>: makes video play in an infinite loop (repentance); a Boolean value.
- <audio>: makes audio play in an infinite loop (repentance); a Boolean value
preload (metadata, auto, none) attribute:
- <video>: suggests a browser how to preload a video; ultimately it depends on browser how to do it
- <audio>: suggests a browser how to preload a audio; ultimately it depends on browser how to do it
- <video>: if there is no video data available, this attribute will replace a first frame of the video (if available) with an image of your choice; a value must be a URL source of the image.
- <source>: specifies resources to be used for the intended media type; typical resource data may be a device type (screen, braille...), width and height, or a certain ratio
kind (captions, chapters, subtitles, descriptions, metadata) attribute:
- <track>: specifies what kind of data the track provides for the specific media element
- <track>: defines a title for the track; this title will be readable by users and will carry unique across track elements
- <track>: if selected it will tell the browser that the track must be enabled (unless user preferences indicate otherwise)
- <video>: define width / height of the video element in pixels
- <embed />: define the width / height of the embedded object in pixels
Examples
Example with video, source and track elements attributes:
Example with audio element attributes:
Comments
No comments have been made yet.
Please login to leave a comment. Login now