Video poster attribute
Definition and usage
poster
Attribute sets or returns the value of the video poster attribute.
poster
The attribute specifies the image to be displayed when the video is downloaded or before the user clicks the play button. If not set, the first frame of the video will be used.
Example
Example 1
Change the cover image of the video:
document.getElementById("myVideo").poster = "/images/w3logo.png";
Example 1
Get the URL of the cover image:
var x = document.getElementById("myVideo").poster;
Syntax
Return the poster attribute:
videoObject.poster
Set the poster attribute:
videoObject.poster = URL
Attribute value
Value | Description |
---|---|
URL |
Specifies the URL of the image file. Possible values:
|
Technical Details
Return Value: | String value, representing the URL of the cover image. Returns the entire URL, including the protocol (such as http://). |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <video> poster Attribute