Comment: As the next generation of web standards, html5 has been hilarious in the html5 craze a year ago; html5 audio audio and video video have always been paid attention to by netizens, and I am also curious, so I collected and sorted out some related things. Friends who need to know can refer to it.
As the next generation of web standards, html5 has launched a html5 craze in the new year. For html5, I just look at it based on understanding. Regarding html5 and RIA (silverlight, flash, JavaFx, etc.) I don’t want to say anything, and there is nothing to say. There is a reason for existence. Which one is better or worse is left to facts and time to prove it.Some new features have emerged in html5:
canvas element video video and audio audio element;
Support for local offline storage (localStorage, sessionStorage);
Added special content elements: article, footer, header, nav, section;
Added form controls: calendar, date, time, email, url, search.
Check out videos and audio today: The standard method for video is specified in html5: video
<video src=xxx.ogg controls=controls>Your browser does not support it</video> We can also set multiple sources, and the browser will select the first recognizable video for us to play, such as: <video width=320 height=240 controls=controls> <source src=xxx.ogg type=video/ogg> <source src=xx1.mp4 type=video/mp4>Your browser does not support it</video>video attributes include:
Property value description
autoplay If this property appears, the video will be played immediately after it is ready.
controls If this property appears, the controls are displayed to the user, such as the play button.
height pixel sets the height of the video player.
loop If this property appears, playback starts again when the media file has finished playing.
preloadpreload
If this property appears, the video is loaded when the page is loaded and ready to be played.
If autoplay is used, this property is ignored.
src url video address URL of the video to be played.
width pixel sets the width of the video player.
autobuffer
Autobuffer
(Auto-buffer)
When the web page is displayed, this binary attribute indicates whether the content is automatically buffered by the user agent (browser), or the user uses the relevant API for content buffering.
Poster
url picture addressWhen the video is not responding or is under buffered, the property value is linked to an image. The image will be displayed at a certain scale
HTML5 specifies the audio standard as an audio element, which can play sound files or audio streams.
Audio format is similar to video: Direct line multiple sources:
<audio controls="controls">
<source src="xx.ogg" type="audio/ogg">
<source src="xx1.mp3" type="audio/mpeg">
Your browser does not support it yet
</audio>Its attributes are less height, width, and poster than video. Multimedia is becoming more and more important in our development, and these videos and audios appear in html5.