Haha, I plan to write some HTML5ArticleIt is not well written. Please forgive me. Let's get started.
I 'd like to see that my children's shoes in the tutorial should have some knowledge of HTML5, so I will not be so arrogant about HTML5's "yesterday", "today", and "tomorrow ".
Well, first of all, we use any text editor to create a new webpage. I use Notepad ++. If you're too lazy to find it, it doesn't matter if you use notepad. Oh ~~~
Currently, the browser supports HTML5 in different ways. We recommend that you use chrome and Firefox, and Microsoft's ie9 is not very well supported, so you are still waiting for a while to test.
HTML5 supports video elements in Video Format
Currently, video supports the following formats:
Ogg = Ogg file with theora video encoding and Vorbis Audio Encoding
MPEG4 = MPEG 4 files with H.264 video encoding and AAC audio encoding
Webm = A webm file with Vp8 video encoding and Vorbis Audio Encoding
Haha, have you ever seen the second file in MP4 format? Oh, download an MP4 file from the Internet and start our
HTML5 path.
The support for these files is as follows:
Video Format |
IE |
FF |
Chrome |
Opera |
Safari |
Ogg |
Not Supported |
Version 3.5 or later |
Version 5.0 or later |
Version 10.5 or later |
Not Supported |
MPEG 4 |
Version 9.0 or later |
Not Supported |
Version 5.0 or later |
Not Supported |
Version 3.0 or later |
Webm |
Not Supported |
Version 4.0 or later |
Version 6.0 or later |
Version 10.6 or later |
Not Supported |
Now, let's continue. Next I will display a video and watch it on the webpage.
<! Doctype Html > < Html > < Body > < Video SRC = 'C: \ Text \ 1.mp4' Width = "320" Height = "240" Controls = "Controls" Autoplay = "True"> < Video > < Body > </ Html >
Okay, the first page is over.Code.
The first is controls = "controls", which represents the playback, pause, and volume controls.
The effect is that I circled the place with a red frame.
Of course, if you set it to false or, without this attribute, it will be gone.
Then
Autoplay has the following two values:
True | false
If it is true, the video will be played immediately after it is ready. Otherwise, you must click it to play the video.
Of course, there are the three attributes of width height SRC mentioned above. Haha, you can play videos on HTML5 pages.
Loop = "loop" indicates whether loop playback is enabled.
Of course, for compatibility, you can write the following
<! Doctype Html > < Html > < Body > < Video Width = "320" Height = "240" Controls = "Controls"> < Source SRC = 'C: \ Text \ 1.mp4' Type = "Video/MP4"> Your browser does not support this label </ Video > < Body > </ Html >
The results are correct.
HTML5 specifies a standard method to include audio through the audio element. The usage of this video is no different from that of the video above. It is only a video and an audio.
Audio Format |
Ie9 |
Ff3.5 |
Opera10.5 |
Chrome3.0 |
Safari3.0 |
Ogg Vorbis |
Not Supported |
Supported |
Supported |
Supported |
Not Supported |
MP3 |
Supported |
Not Supported |
Not Supported |
Supported |
Supported |
Wav |
Not Supported |
Supported |
Supported |
Not Supported |
Supported |
<! Doctype Html > < Html > < Body > < Audio SRC = "C: \ Text \ 2.mp3" Width = "320" Height = "240" Autoplay = "True" Controls = "Controls"> Your browser does not support this label </ Audio > < Body > </ Html >
The above two labels have the same usage. Therefore, I will not repeatedly write many attributes.