The early Internet was mainly used to share academic results, but for ordinary people, they were more willing to share some more interesting content on it, such as
html5video
,audio
, these technologies were not solved by the# web audio and video provided by the
html tag before
Although the early
html
did not provide tags to support video or audio playback, this does not affect people's desire to share
Supported method 1:
Useembed
to directly insert the video into the page, and then you can useWindows Media Player
,Apple QuickTime
or actual video player to create a playback window
But this method is not controllable for the video itself. Compatibility issues cannot be taken into account
##Support method 2
, and the most commonly usedAdobe Flash
not only completely solves the problem of browsing There are server support issues, and the installation rate is staggeringly high (basically 99% of computers have Flash player installed)
except for In addition to learningFlash
this technology itself, the more important thing is thatiPhone
,ipad
does not support this technology
, then the website uses the Flash plug-in
Flash Various issues ofhave introduced multimedia tags
in
src: Audio address
Since audio formats are supported differently in different browsers, considering compatibility issues, we need to use the following code
source: Specify multiple audios. If one is found that is supported by the current browser, it will be used directly. If all
source##
Video tag<audio controls="controls"> <source src="song.ogg" type="audio/ogg"> <source src="song.mp3" type="audio/mpeg"> 你的浏览器不支持此种格式 </audio>
The tags are very similarSample code 1:
src: video address
##src:
The address of the videoSince video support is different in different browsers, considering compatibility issues, we need to use the following code
source:指定多个视频,如果找到了当前浏览器支持的,那么会直接使用,如果所有的source
标签格式都不支持,会显示最后的文本内容
在html5之前如果我们想要使用进度条,可以通过一些前端框架,或者自己使用控件搭建出类似的外观,但是在html5中推出了两个进度条控件,接下来就让我们来看看如何使用它们
外观
如果只是定义该元素不设置任何内容,显示效果如下图
作用:
用来显示任务的进度(进程)
如果想要用来显示度量值
(比如容量使用情况)请使用meter
标签
属性:
max:总工作量
value:已完成工作量
兼容性:
为了保证显示效果,可以再progress
标签中写入内容,在当前浏览器无法显示该控件时,会转而显示内容
外观:
通过属性值的搭配能够显示出多重不同的变化
常见属性:
high:规定较高的值
low:规定较低的值
max:规定最大值(可以超过,但是进度条已经满了)
min:规定最小值
value:规定度量的值
示例代码:
显示效果即截图
两种进度条都能够用来显示进度,由于兼容性以及语义性的问题,在实际开发中需要
结合实际情况
决定是否使用它们(或者是使用对应的前端框架)。
【相关推荐】
The above is the detailed content of HTML5--detailed explanation of multimedia tags. For more information, please follow other related articles on the PHP Chinese website!