HTML5 Video(vid...LOGIN

HTML5 Video(video)

HTML5 Video(Video)

Video on Web site

Until now, there is still no method for displaying on web pages Video standards.

Today, most videos are displayed through plug-ins (such as Flash). However, not all browsers have the same plugins.

HTML5 specifies a standard way to include video through the video element.

HTML5 (Video) - How it works

To display a video in HTML5, all you need is:

Example

<video width="320" height="240" controls>
  <source src="视频文件名称" type="视频格式">
  <source src="视频文件名称" type="视频格式">
您的浏览器不支持Video标签。
</video>

autoplay attribute

Instance

The video element set to automatically play:

<video controls="controls" autoplay="autoplay"> 
 <source src="视频文件名称" type="视频格式"> 
  <source src="视频文件名称" type="视频格式">
您的浏览器不支持Video标签。
</video>

controls: If this attribute appears, controls are displayed to the user, such as a play button. The

<video> element provides play, pause, and volume controls to control the video.

At the same time, the <video> element element also provides width and height attributes to control the size of the video. If the height and width are set, the required video space will be reserved when the page is loaded. . If these properties are not set and the browser does not know the size of the video, the browser will not be able to reserve a specific space when loading, and the page will change based on the size of the original video.

The content inserted between the <video> and </video> tags is provided for display by browsers that do not support the video element.

The<video> element supports multiple <source> elements. The <source> element can link different video files.

# video format and the support of the browser

Current, & lt; video & gt; Element supports three video formats: mp4, webm, and OGG:

## Browser mp4 webm ogg

## Internet Explorer Yes no nO

## chirome yes yes yes

## Firefox yes Yes yes

# Safari yes no no no no



################################11 Opera Yes File ###### Webm = Webm file with VP8 video coding and VORBIS audio encoding ####### OGG = OGG file with TheOora video coding and VORBIS audio encoding ############## ############Next Section
<video width="320" height="240" controls> <source src="视频文件名称" type="视频格式"> <source src="视频文件名称" type="视频格式"> 您的浏览器不支持Video标签。 </video>
submitReset Code
ChapterCourseware