Video poster attribute

Definition and usage

poster The 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";

Try it yourself

Example 1

Get the URL of the cover image:

var x = document.getElementById("myVideo").poster;

Try it yourself

Syntax

Return poster attribute:

videoObject.poster

Set poster attribute:

videoObject.poster = URL

Attribute value

Value Description
URL

Specify the URL of the image file.

Possible values:

  • Absolute URL - Pointing to another website (for example, href="http://www.example.com/poster.jpg")
  • Relative URL - na tumutukoy sa file sa loob ng website ( tulad ng href="poster.jpg").

Detalye ng Teknolohiya

Ibalik na Halaga: String na halaga, naglalarawan ng URL ng pabalikat na imahe. Ibabalik ang buong URL, kasama ang protocol ( tulad ng http://).

Suporta ng Browser

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta 9.0 Suporta Suporta Suporta

Sanggunian ng Pahina

HTML Taglapag:HTML <video> poster Atribute