The best HTML Video (Videos) Play Tutorial In 2024, In this tutorial you can learn HTML Video (Videos) Play,Examples,Problems and solutions,Using the <embed> tag,Examples,Using the <object> tag,Examples,Using the HTML5 <video> element,Examples,Best HTML Solution,HTML 5 + <object> + <embed>,Youku Solutions,Using hyperlinks,Examples,On inline video description,HTML multimedia tag,
There are many ways to play the video in HTML method.
Play Video in HTML is not easy!
You need a lot of familiar tips to ensure that your video file in all browsers (Internet Explorer, Chrome, Firefox, Safari, Opera), and all hardware (PC, Mac, iPad, iPhone) can be played.
In this chapter, W3CSchool you summarize the problems and solutions.
Role <embed> tag is to embed multimedia elements in HTML pages.
The following HTML code to display Flash video embedded in the page:
problem
Role <object> tag is to embed multimedia elements in HTML pages.
The following HTML snippet shows some Flash video embedded in the page:
problem:
HTML5 <video> tag defines a video or movie.
<Video> element in all modern browsers are supported.
The following HTML fragment will display a web page embedded ogg, mp4, or webm format video:
problem:
The following example uses four different video formats. HTML 5 <video> element tries to play mp4, ogg, or webm formats is to play the video. If all fails, then fall back to <embed> element.
problem:
The easiest way to display videos in HTML is to use Youku and other video sites.
If you want to play video in a web page, you can upload a video to Youku and other video sites, and then insert the HTML code to play the video in your page:
If the page contains a hyperlink pointing to media files, most browsers will use "helper application" to play the file.
The following code fragment shows links to AVI file. If the user clicks on the link, the browser will start the "Helper Applications", such as Windows Media Player to play the AVI file:
When a video is included in the web page, it is called inline video.
If you plan to use inline video in a web application, you need to realize that many people find inline videos annoying.
Also note that users may have closed your browser inline video option.
Our best advice is to only when the user wants to see the place inline video contains them. A positive example is that when the user needs to see the video and click on a link will open the page and play the video.
New: HTML5 new tags.
标签 | 描述 |
---|---|
<embed> | 定义内嵌对象。HTML4 中不赞成,HTML5 中允许。 |
<object> | 定义内嵌对象。 |
<param> | 定义对象的参数。 |
<audio> New | 定义了声音内容 |
<video> New | 定义一个视频或者影片 |
<source> New | 定义了media元素的多媒体资源(<video> 和 <audio>) |
<track> New | 规定media元素的字幕文件或其他包含文本的文件 (<video> 和<audio>) |