我正在使用 JWplayer 7.2.3,我有几个视频质量,我使用以下代码显示播放器:
jwplayer("myElement").setup({image: preview, sources: [{
file: "http://video6.net/hd1/2829.mp4?st=IxbKO3FEtTPi8Pr0hvufFw&e=1453509476",
label: "720p HD",
"default": true
},{
file: "http://video6.net/sd1/2829.mp4?st=IxbKO3FEtTPi8Pr0hvufFw&e=1453509476",
label: "360p SD",
"default": false
},{
file: "http://video6.net/lq1/2829.mp4?st=IxbKO3FEtTPi8Pr0hvufFw&e=1453509476",
label: "240p LQ",
"default": false
}],width: "100%",aspectratio: "16:9",skin: {url:"/jwplayer/skins/glow.css",name: "glow"},tracks: [{
file: "http://video8.net/timelines/2/8/2829/thumbnails.vtt",
kind: "thumbnails"
}],startparam: "starttime"});
我想在控制栏上显示当前的视频质量标签 - 我该怎么做?
理论上,使用新版本 7 CSS 皮肤模型,您可以随意制作播放器。
对于初学者,您可以使用以下代码来确定当前质量。
jwplayer('myElement').setup({
...
events:
onQualityChange: function(callback) {
updateQuality();
},
function updateQuality() {
var curQual = jwplayer('myElement').getCurrentQuality();
//now you have a variable with the current quality at any given
time and you can build this variable into your custom skin, which
is beyond the scope of this question
}
希望这有帮助!