Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the position of videojs Control bar elements order

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.

How can I able to change order?

I have my code below:

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;
   ......
like image 919
sankar.suda Avatar asked Dec 13 '22 21:12

sankar.suda


1 Answers

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.

Taken idea from JS Bin

like image 72
sankar.suda Avatar answered Dec 21 '22 09:12

sankar.suda