streamroot / videojs-hlsjs-plugin

hls.js Source Handler for video.js 5
http://www.streamroot.io
MIT License
155 stars 80 forks source link

Change order of quality icon #37

Closed elhampour closed 5 years ago

elhampour commented 7 years ago

I want to put this plugin before full screan icon, but there is not any option, i want to put this plugin in this code :

children: [ { name: 'liveDisplay' }, { name: 'playToggle' }, { name: 'currentTimeDisplay' }, { name: 'timeDivider' }, { name: 'durationDisplay' }, { name: 'remainingTimeDisplay' }, { name: 'progressControl' }, { name: 'fullscreenToggle' }, { name: 'volumeMenuButton', volumeBar: { vertical: true } } ]

elhampour commented 7 years ago

you have to make this code optional, for example get the place of quality button from user through options.

i have to comment this in your code in order to get what i need.

    var fullscreenToggle = player.controlBar.getChild('fullscreenToggle');
    player.controlBar.removeChild(fullscreenToggle);

    for (var i = 0; i < SUPPORTED_TRACKS.length; i++) {
        var track = SUPPORTED_TRACKS[i];
        var name = track + "PickerButton";
        var qualityPickerButton = player.controlBar.getChild(name);
        if (qualityPickerButton) {
            qualityPickerButton.dispose();
            player.controlBar.removeChild(qualityPickerButton);
        }

        if (qualityData[track] && qualityData[track].length > 1) {
            qualityPickerButton = new _qualityPickerButton2.default(player, { name: name, qualityList: qualityData[track], qualitySwitchCallback: qualitySwitchCallback, trackType: track });
            qualityPickerButton.addClass(TRACK_CLASS[track]);

            player.controlBar.addChild(qualityPickerButton);
        }
    }

    if (fullscreenToggle) {
        player.controlBar.addChild(fullscreenToggle);
    }
Awais-cb commented 7 years ago

Hi is this plugin working on your side?

sdahdaah commented 6 years ago

not working for me on VideoJS6 working for VideoJS5

tri170391 commented 5 years ago

We now supported https://github.com/videojs/videojs-contrib-quality-levels API and thus any quality picker supporting this API should work. 🎉