Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video Tag of HTML5 (default image)

Tags:

html

I am using video tag of HTML5 (http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_all). But before playing the video it shows the very first second of the video as the image; however, that image is solid black for my case; so I would like to know if I can have the default image (before hitting the play button) from somewhere of the middle of the video?

I hope my question is clear, if it is not clear please ask me what part is ambiguous and I will provide more clarification

Appreciate it in advance.

like image 943
user385729 Avatar asked Dec 20 '22 23:12

user385729


1 Answers

Assuming you have an image file with the part of the video you want yo show, you can use the poster attribute on the <video> tag, in your case it'd be:

<video width="320" height="240" poster="<default image url>" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>
like image 174
DarkAjax Avatar answered Jan 06 '23 21:01

DarkAjax