我使用的是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"});我想在控制栏上显示当前的视频质量标签-我该怎么做?
发布于 2016-01-27 01:41:24
使用新的版本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
}希望这能有所帮助!
https://stackoverflow.com/questions/34956441
复制相似问题