HTML videos (Videos)


There are many ways to play videos in HTML.


HTML video (Videos) playback

Instance

    php中文网(php.cn) 

Run instance»

Click the "Run Example" button to view the online example



#Problems and Solutions

Playing videos 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.

In this chapter, W3CSchool summarizes the problems and solutions for you.


Use the tag

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

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

Example

    php中文网(php.cn) 

Playing the Object

如果你无法看到该视频,那么可能你的电脑不支持该文件格式。


Run Example»

Click the "Run Instance" button to view the online instance

Problem

  • ##HTML4 cannot recognize the tag. Your page cannot pass verification.

  • If the browser does not support Flash, the video will not playback

  • iPad and iPhone cannot display Flash videos.

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

##Use the tag

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

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

Example Problem:

    If the browser does not support Flash, it will not work Play video.
  • iPad and iPhone cannot display Flash videos.
  • If you convert the video to other formats, then it still won't play in all browsers.
  • ##Using the HTML5

HTML5