Video poster property
Example
Modify the image displayed when the current video data is invalid:
document
.
getElementById
(
"
myVideo
"
)
.
poster
=
"
/images/logo2.png
"
;
Try it »
Definition and Usage
The poster property is used to set or return the value of the video's poster attribute.
The poster property 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 used instead.
Browser support





All major browsers support the poster property.
Note: Internet Explorer 8 and earlier IE versions do not support
Syntax
Return the poster property:
videoObject
.poster
Set the poster property:
videoObject
.poster=
URL
Attribute values
| Value | Description |
|---|---|
| URL | Describes the URL of the image file.
Possible values: |
Technical Details
| Return Value: | A string representing the URL of the preview image. Returns the actual URL including the protocol (http://) |
|---|
More examples
Example
Get the URL of the preview image:
var
x
=
document
.
getElementById
(
"
myVideo
"
)
.
poster
;
x
The output is:
http://www.runoob.com/images/logo.png
Try it »
Related pages
HTML Reference Manual: HTML
The Video object