Video posterProperty
Example
Change the image displayed when the current video data is invalid:
document.getElementById("myVideo").poster="/images/logo2.png";
Try it Yourself »
Definition and Usage
The poster property is used to set or return the poster attribute value of a video.
The poster attribute describes the image displayed while the video is loading or before the user clicks the play button. If this attribute is not included, the first frame of the video will be displayed instead.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the poster attribute.
Note:Internet Explorer 8 and earlier IE versions do not support the <video> element.
Syntax
Return the poster property:
videoObject.poster
Set the poster property:
videoObject.poster=URL
Property Values
| Value | Description |
|---|---|
| URL | Describes the URL address of the image file. Possible values:
|
Technical Details
| Return value: | A string representing the URL of the preview image. Returns an absolute URL, including the protocol (http://). |
|---|
More Examples
Example
Get the URL of the preview image:
var x = document.getElementById("myVideo").poster;
http://www.example.com/images/logo.png
Try it Yourself »
Related Pages
HTML Reference Manual:HTML <video> poster Attribute
Video Object Other Extensions