如何更改videojs控件栏元素顺序的位置 [英] How to change the position of videojs Control bar elements order

查看:435
本文介绍了如何更改videojs控件栏元素顺序的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的网站使用video.js播放器。我想更改控制栏元素的位置。

I am using the video.js player for my website. I want to change the position of control bar elements.

当前,它显示播放/暂停,音量,进度条和全屏显示。

Presently, it shows play/pause, volume, progress bar and full screen.

如何更改订单?

我的代码如下:

var videojs = videojs('video-player', {
    techOrder:  ["youtube", "html5"],
    preload: 'auto',
    controls: true,
    autoplay: true,
    fluid: true,
    controlBar: {
        CurrentTimeDisplay: true,
        TimeDivider: true,
        DurationDisplay: true
    },
    plugins: {
        videoJsResolutionSwitcher: {
            default: 'high',
            dynamicLabel: true
        }
    }
}).ready(function() {
    var player = this;
   ......


推荐答案

我可以通过以下更改来解决:

I could able resolve by making changes as below:

    var videojs = videojs('video-player', {
    techOrder:  ["youtube", "html5"],
    preload: 'auto',
    controls: video.player.controls,
    autoplay: video.player.autoplay,
    fluid: true,
    controlBar: {
        children: [
            "playToggle",
            "volumeMenuButton",
            "durationDisplay",
            "timeDivider",
            "currentTimeDisplay",
            "progressControl",
            "remainingTimeDisplay",
            "fullscreenToggle"
        ]
    },
    plugins: {
        videoJsResolutionSwitcher: {
            default: 'high',
            dynamicLabel: true
        }
    }
}).ready(function() {
    var player = this;

我认为这会在将来对某人有所帮助。

I thought it will help somebody in future.

JS Bin

这篇关于如何更改videojs控件栏元素顺序的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆