1

我正在使用 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"});

我想在控制栏上显示当前的视频质量标签 - 我该怎么做?

4

1 回答 1

0

使用新的第 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
}

希望这可以帮助!

于 2016-01-26T17:41:24.213 回答