Video poster Property
Example
Change the poster image of a video:
document.getElementById("myVideo").poster = "/images/w3schoolscomlogo.png";
Try it Yourself »
Definition and Usage
The poster property sets or returns the value of the poster attribute of a video.
The poster attribute specifies an image to be shown while the video is downloading, or until the user hits the play button. If this is not included, the first frame of the video will be used instead.
Browser Support
Property | |||||
---|---|---|---|---|---|
poster | Yes | 9.0 | Yes | Yes | Yes |
Syntax
Return the poster property:
videoObject.poster
Set the poster property:
videoObject.poster = URL
Property Values
Value | Description |
---|---|
URL | Specifies the URL of the image file. Possible values:
|
Technical Details
Return Value: | A String, representing the URL of the poster image. Returns the entire URL, including the protocol (like http://) |
---|
More Examples
Example
Get the URL of the poster image:
var x = document.getElementById("myVideo").poster;
Try it Yourself »
Related Pages
HTML reference: HTML <video> poster attribute
❮ Video Object