diff --git a/lib/videojs-resolution-switcher.js b/lib/videojs-resolution-switcher.js index 85db9f7..6daf03e 100644 --- a/lib/videojs-resolution-switcher.js +++ b/lib/videojs-resolution-switcher.js @@ -357,13 +357,14 @@ player.one('loadedmetadata', function(){ var representations = hls.representations(); var _sources = [{ src: 'auto', type: 'application/x-mpegURL', label: 'auto', res: 0}]; + var i = 1; representations.map(function(representation){ _sources.push({ src: representation, type: 'application/x-mpegURL', - label: representation.height, - res: representation.height + label: typeof representation.height != 'undefined' ? representation.height : '#'+(i++), + res: typeof representation.height != 'undefined' ? representation.height : 0 }); });