Video poster
Attribute
Example
Modify the image displayed when the current video data is invalid:
document.getElementById("myVideo").poster = "/images/logo2.png";
Definition and Usage
The poster
attribute is used to set or return the value of the video's poster
attribute.
The poster
attribute describes the image displayed before the video is loaded or when 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
attribute.
Note: Internet Explorer 8 and earlier versions do not support the <video>
element.
Syntax
Return the poster
attribute:
Set the poster
attribute:
Attribute Values
Value | Description |
---|---|
URL | Describes the URL address of the image file. Possible values: Absolute URL - Points to another site (e.g., href="http://www.example.com/poster.jpg")<br>Relative URL - Points to a file within the site (e.g., href="poster.jpg") |
Technical Details
| Return Value: | String, representing the URL address of the preview image. Returns the actual URL, including the protocol (http://) | | --- | --- |
More Examples
Example
Get the URL address of the preview image:
var x = document.getElementById("myVideo").poster;
http://www.tutorialpro.org/images/logo.png
Related Pages
HTML Reference: HTML <video> poster Attribute