Home > Web Front-end > HTML Tutorial > 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?

王林
Release: 2023-09-12 22:45:03
forward
716 people have browsed it

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">
Copy after login

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>
Copy after login

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>
Copy after login

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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template