Element-Specific Attributes
The following table shows the attributes that are specific to this tag/element.
Attribute | Description | ||||||
---|---|---|---|---|---|---|---|
src | Specifies the location of the video file. Its value must be the URI of a video file. | ||||||
crossorigin | This attribute is a CORS settings attribute. CORS stands for Cross-Origin Resource Sharing. The purpose of the crossorigin attribute is to allow you to configure the CORS requests for the element's fetched data. The values for the crossorigin attribute are enumerated. Possible values:
If this attribute is not specified, CORS is not used at all. An invalid keyword and an empty string will be handled as the | ||||||
poster | Specifies an image to use while the video is unavailable (i.e. it hasn't loaded yet). This is typically an image of one of the first frames of the video. If supplied, the value must be a valid URL of an image. | ||||||
preload | Specifies whether the video should be preloaded or not, and if so, how it should be preloaded. This attribute allows the author to provide a hint to the browser/user agent about what the author thinks will lead to the best user experience. This attribute may be ignored in some instances. For example, if the user has disabled preloading or if there are network connectivity issues. Possible values:
Note that the | ||||||
autoplay | Specifies whether or not to start playing the video as soon as it can do so without stopping. This attribute is a boolean attribute. Therefore, the mere presence of this attribute equates to a true value. You can also specify a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either Possible values:
| ||||||
mediagroup | For synchronizing playback of videos (or media elements). Allows you to specify media elements to link together. The value is a string of text, for example: mediagroup=movie . Videos/media elements with the same value are automatically linked by the user agent/browser. An example of where the | ||||||
loop | Specifies whether to keep re-playing the video once it has finished. This attribute is a boolean attribute. Therefore, the mere presence of this attribute equates to a true value. You can also specify a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either Possible values:
| ||||||
muted | Controls the default state of the video's audio output. If present, this attribute results in the audio output being muted (i.e. there is no sound) upon loading. This attribute will override the users' preferences. The user can then choose to turn on the sound if he/she so wishes. This helps users from being annoyed by loud sounds coming from the video as soon as the page/video starts loading. Users often close their browser when this happens. The 'mute' attribute aims to overcome this issue by having the video start off silently instead of loudly. This attribute is a boolean attribute. Therefore, the mere presence of this attribute equates to a true value. You can also specify a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either Possible values:
| ||||||
controls | Specifies whether or not to display video controls (such as a play/pause button etc). This attribute is a boolean attribute. Therefore, the mere presence of this attribute equates to a true value. You can also specify a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either Possible values:
| ||||||
width | Specifies the width, in pixels, to display the video. Possible values: [Non-negative integer] (for example, 300) | ||||||
height | Specifies the height, in pixels, to display the video. Possible values: [Non-negative integer] (for example, 150) |