Home > Article > Web Front-end > HTML learning summary 9_html/css_WEB-ITnose
1. Embed audio and video
For audio clips, the traditional delivery method is to use the
2. Introduction of the
(1) A simple
Depending on the needs of website visitors, different attributes and methods can be used. Use the
We use the width and height attributes to set the width and height of the video displayed on the web page, for example:
(2) The controls attribute determines whether to display a series of default playback controls in the browser. In fact, if the controls attribute is not applied, web page visitors will not be able to reprint the entire webpage, otherwise the video cannot be replayed.
An example of the controls attribute is as follows:
(3) The preload attribute tells the browser The browser, once it encounters this element, immediately starts downloading the video file.
(4) The loop attribute tells the browser to replay the video immediately after it has finished playing, as shown below:
(5) The autoplay attribute causes the video to start playing immediately after loading on the web page.
Putting the previous attributes together, the video factors in practical applications are generated:
3.
If visitors use an old version of the browser that does not support HTML5, in this case, they cannot watch the video through the
4. Play audio through the
(1) Like the
controls, autoplay, loop, and preload. Therefore, the syntactic essence of the
Like video files, audio streams also need to be embedded into Flash objects to meet the needs of users of older versions of IE.
(2) Playing audio in older browsers
Like video, playing audio in older browsers requires the use of
By default Next,
In addition A commonly used attribute of the