Let's dive into the following example where you can learn more about HTML attributes. Example 1 In the following example we use element and poster attributes. <"/> Let's dive into the following example where you can learn more about HTML attributes. Example 1 In the following example we use element and poster attributes. <">

Home  >  Article  >  Web Front-end  >  In HTML, how can we set the image to be displayed while the video is downloading?

In HTML, how can we set the image to be displayed while the video is downloading?

王林
王林forward
2023-09-12 22:45:03705browse

In HTML, how can we set the image to be displayed while the video is downloading?

In this article, we will learn how to set the image that displays when downloading a video in HTML format.

HTML

grammar

The following is the syntax of HTML attributes.

<video poster="URL">

Let's dive into the following example where you can learn more about HTML attributes.

Example 1

In the following examples, we use the

<!DOCTYPE html>
<html>
<body>
   <center>
      <video width="340" height="220" controls poster="https://www.tutorialspoint.com/static/images/logo-color.png">
      <source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4" type="video/mp4">
      </video>
   </center>
</body>
</html>

When the above script is executed, it will generate an output containing the uploaded video and the image added to the video as a poster using the

Example 2

Consider the following example where we use two videos, one with the attribute.

<!DOCTYPE html>
<html>
<body>
   <center>
   <video width="340" height="220" controls poster="https://www.tutorialspoint.com/images/logo.png">
      <source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4">
   </video>
   <video width="320" height="240" controls>
      <source src="https://samplelib.com/lib/preview/mp4/sample-30s.mp4">
   </video>
   </center>
</body>
</html>

When the script executes, it generates an output consisting of two videos uploaded to the web page, one with the HTML attribute added and the other normal.

The above is the detailed content of In HTML, how can we set the image to be displayed while the video is downloading?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete