Home >Web Front-end >HTML Tutorial >How to play video in html

How to play video in html

藏色散人
藏色散人Original
2021-05-24 10:15:5127666browse

How to play video in html: 1. Use the d8e2720730be5ddc9c2a3782839e8eb6 tag to embed multimedia elements in the HTML page; 2. Use the 273238ce9338fbb04bee6997e5552b95 tag to insert a video; 3. Use the HTML5 39000f942b2545a5315c57fa3276f220 element definition A video.

How to play video in html

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

htmlPlay Video

Playing video in HTML is not easy!

You need to know a lot of techniques to ensure that your video files work in all browsers (Internet Explorer, Chrome, Firefox, Safari, Opera) and on all hardware (PC, Mac, iPad, iPhone) Play.

Use the d8e2720730be5ddc9c2a3782839e8eb6 tag

The d8e2720730be5ddc9c2a3782839e8eb6 tag is used to embed multimedia elements in HTML pages.

The following HTML code displays a Flash video embedded in a web page:

Example

<embed src="intro.swf" height="200" width="200">

Problem

HTML4 does not recognize the d8e2720730be5ddc9c2a3782839e8eb6 tag. Your page cannot pass verification.

If the browser does not support Flash, the video will not play

iPad and iPhone cannot display Flash videos.

If you convert the video to other formats, it still won't play in all browsers.

Use the 273238ce9338fbb04bee6997e5552b95 tag

The273238ce9338fbb04bee6997e5552b95 tag is used to embed multimedia elements in HTML pages.

The following HTML fragment displays a Flash video embedded in a web page:

Example

<object data="intro.swf" height="200" width="200"></object>

Problem:

If the browser does not support Flash, it will not play video.

iPad and iPhone cannot display Flash videos.

If you convert the video to other formats, it still won't play in all browsers.

Using the HTML5 39000f942b2545a5315c57fa3276f220 element

HTML5 39000f942b2545a5315c57fa3276f220 tag defines a video or movie.

39000f942b2545a5315c57fa3276f220 element is in Supported in all modern browsers.

The following HTML snippet displays a video in ogg, mp4 or webm format embedded in a web page:

Example

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.webm" type="video/webm">
您的浏览器不支持 video 标签。
</video>

Question:

You must put the video Convert to many different formats. The

39000f942b2545a5315c57fa3276f220 element is not valid in older browsers.

Recommended tutorials: html video tutorial, css video tutorial

The above is the detailed content of How to play video in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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