HTML and CSS Reference
In-Depth Information
Table 8-1. List of Common Attributes for Media Elements (Audio and Video)
Attribute
Type
Default Value
Description
Src
URL
Unspecified
URL specifying the address of the media file.
Crossorigin CORS settings
enumeration
anonymous
Enumerated value ( anonymous or use-credentials ) specifying how
to deal with cross origin requests.
Preload
auto
Enumerated value ( none , metadata , or auto ) specifying if the media
source should be preloaded. “ none ” will not preload any data and will
minimize unnecessary traffic to the server. “ metadata ” will attempt to
fetch the metadata of the media source (duration, dimensions, etc.)
prior to playing back the file. During playback the slowest possible
download rate will be used while still maintaining consistent
playback to save bandwidth. “ auto ” leaves the download strategy
to the browser and may use excessive bandwidth as the browser
may attempt to aggressively download the whole media file prior to
playback.
Preload
enumeration
Autoplay
false
Boolean
Boolean value specifying if the media file should automatically start
playback when the page has been loaded.
Mediagroup
String
Unspecified
String value that serves as a name for grouping and synchronizing
video and audio clips. Audio and video elements with the same string
value in the mediagroup attribute will be synchronized and managed
from the same network request. When the mediagroup attribute is
used, a MediaController object is created and set in the controller
property of the HTMLMediaElement . The property can be fetched using
JavaScript and used to manipulate all the media elements using the
same controller (i.e., with the same mediagroup name).
Loop
false
Boolean
Boolean value that indicates if the media element should start over
once it reaches the end of the clip.
Muted
false
Boolean
Boolean value that indicates if the audio should be muted during
playback.
Controls
false
Boolean
Boolean value that indicates if the user controls (play, pause, seeker, etc.)
should be displayed.
The video element contains a few additional attributes for specifying the dimensions of the video and the poster
to appear (if any) before playback of the video begins. The additional video attributes are listed in Table 8-2 .
Table 8-2. List of Additional Attributes That Apply to Video Elements Only
Attribute
Type
Default Value
Description
width
Dimension
300px
Width of the video playing area.
height
150px
Dimension
Height of the video playing area.
poster
URL
Unspecified
URL of the still image that should appear as the poster for the video
before playback starts.
 
 
Search WWH ::




Custom Search