Html 5 video playback: <! Doctype html>
~ After playing the above code, you can embed a video in the webpage. The src content is the address of your video. The role of controls = "controls" is to add a control for playing pause and music, you can set the size through width and height. <Video width = "320" height = "240" controls = "controls"> <source src = "movie.ogg" type = "video/ogg"> <source src = "movie.mp4" type = "video/mp4"> Your browser does not support the video tag. </video> You can also design a video control to play multiple audio and video simultaneously. You only need to add source to the video label to specify the file address and type.
<Video> tag attributes
Attribute value description
Autoplay
If autoplay displays this attribute, the video will be played immediately after it is ready.
Controls
If this attribute is displayed in controls, the control, such as the play button, is displayed to the user.
Height
Pixels sets the height of the video player.
Loop
If this attribute appears in loop, the media file starts playing again after being played.
Preload
If this attribute is displayed in preload, the video is loaded when the page is loaded and ready to play.
If "autoplay" is used, this attribute is ignored.
Src
The url of the video to be played.
Width
Pixels sets the width of the video player.
HTML 5 Global attributes
NEW: the NEW Global attribute in HTML 5.
Attribute value description
Accesskey
Character specifies the keyboard shortcut for the access element
Class
The Class Name of the element specified by classname (used to specify the class in the style sheet ).
Contenteditable
• True
• False indicates whether users are allowed to edit content.
Contextmenu menu_id specifies the context menu of the element.
Dir
• Ltr
• Rtl specifies the text direction of the content in the element.
Draggable • true
• False
• Auto specifies whether to allow users to drag elements.
Dropzone • copy
• Move
• Link specifies what happens when the dragged Project/data is dragged to an element.
Hidden
Hidden specifies that this element is irrelevant. Hidden elements are not displayed.
Id
The unique id of the element specified by ID.
Lang
The language_code specifies the language code of the content in the element. Language code reference manual http://www.w3school.com.cn/tags/html_ref_language_codes.asp.
Spellcheck
• True
• False specifies whether spelling or syntax checks must be performed on elements.
Style
Style_definition specifies the row style of the element.
Tabindex
Number specifies the order in which the tab key of the element is controlled.
Title
Text specifies additional information about the element.
Music Tag:
The tag is similar to the video above.
<Audio src = "song.ogg" controls = "controls"> </audio>
For more information, see http://www.w3school.com.cn/html5/html_5_audio.asp.
From Wen Changshou 2