Home >Web Front-end >H5 Tutorial >Detailed explanation of html5 video and audio
[Introduction] Detailed explanation of html5 video and audio audio. Some new features have appeared in html5: canvas element video video and audio audio element; support for local offline storage (localstorage, sessionstorage); new special content elements: article , footer
html5 video video and audio audio detailed explanation
Some new features have appeared in html5:
canvas element
Video video and audio audio element;
Support for local offline storage (localstorage, sessionstorage);
New special content elements: article, footer, header, nav, section;
New form controls: calendar, date, time, email, url, search.
Today, let’s take a look at video and audio: The standard method for video is specified in HTML5: video
We can also set multiple sources, and the browser will select the first identifiable video for us to play, in the form: The video attributes are: attribute value description
autoplay autoplay If this attribute appears, the video will be played immediately after it is ready.
controls controls If this attribute appears, controls are displayed to the user, such as a play button.
height pixels Set the height of the video player.
loop loop If this attribute appears, playback will start again after the media file completes playback.
preload preload If this attribute appears, the video will be loaded when the page loads and is ready to be played.
If "autoplay" is used, this attribute is ignored.
src url video address The url of the video to be played.
width pixels Set the width of the video player.
autobuffer
autobuffer
(Autobuffer)
When the web page is displayed, this binary attribute indicates whether the content is automatically buffered by the user agent (browser) or by the user using the relevant API. Content buffering
poster
url image address
This attribute value is linked to an image when the video is unresponsive or insufficiently buffered. The image will be displayed at a certain proportion
In HTML5, the audio standard is specified as the audio element. The audio element can play sound files or audio streams.
The audio format is similar to video: direct multiple sources:
Its attributes are better than video Missing height, width and poster. Multimedia is becoming more and more important in our development, and these videos and audio appear in html5.
The above is the detailed content of Detailed explanation of html5 video and audio. For more information, please follow other related articles on the PHP Chinese website!