问题描述:


I not sure how to explain. It is regarding about html5 video tag. I had setted it prefect except one. When my video is loaded (not playing. only display on html), its show white background. It is because video 00:00 is white background. Can I set to 05.23 (which show more interesting view.)?

Need help. Many thanks.

网友答案:

You can add "posters" to your video tags, which are like default backgrounds before the video starts, see:

<video controls poster="/images/w3html5.gif">
    <source src="movie.mp4" type="video/mp4">
    <source src="movie.ogg" type="video/ogg">
    Your browser does not support the video tag.
</video>

So then you could save a screenshot from your video as an image, and add it as a poster.

Maybe consider using a library like Video.js, which gives you lots of additional functionality. https://github.com/videojs/video.js/blob/stable/docs/guides/setup.md

网友答案:

You can specify the start position within the <source> tag itself.

<video controls>
  <source src="blah.mp4#t=323" type="video/mp4">
  <source src="blah.ogg#t=323" type="video/ogg">
</video>

That #t=323 will provide the start point to the html video player in seconds.

相关阅读:
Top