Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/videojs-resolution-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@

groupedSrc = bucketSources(_sources);

// Overwrite defualt sourcePicer function
// Overwrite default sourcePicker function
var _customSourcePicker = function(_player, _sources, _label){
player.tech_.ytPlayer.setPlaybackQuality(_sources[0]._yt);
return player;
Expand Down Expand Up @@ -352,10 +352,12 @@
});

player.one('loadedmetadata', function(){
var playlists = hls.playlists.master.playlists;

var playlists = hls.playlists.master.playlists.sort(function (a, b) {
return b.attributes.RESOLUTION.height - a.attributes.RESOLUTION.height;
});

var _sources = [{ src: 'auto', type: 'application/x-mpegURL', label: 'auto', res: 'auto'}];

playlists.map(function(value){
_sources.push({
src: value.uri,
Expand Down Expand Up @@ -383,7 +385,7 @@
return _selectPlaylist;
};

// Overwrite defualt sourcePicer function
// Overwrite default sourcePicker function
var _customSourcePicker = function(_player, _sources, _label){
var selectedRes = _sources[0].res;
hls.selectPlaylist = selectPlaylist(selectedRes);
Expand Down