diff --git a/lib/videojs-resolution-switcher.js b/lib/videojs-resolution-switcher.js index eae1c38..c457c60 100644 --- a/lib/videojs-resolution-switcher.js +++ b/lib/videojs-resolution-switcher.js @@ -270,9 +270,10 @@ // Select low-res if default is low or not set selectedRes = src[src.length - 1].res; selectedLabel = src[src.length -1].label; - } else if (groupedSrc.res[selectedRes]) { - selectedLabel = groupedSrc.res[selectedRes][0].label; - } + } else if (groupedSrc.label[selectedRes]) { + selectedLabel = selectedRes; + selectedRes = undefined; + } return {res: selectedRes, label: selectedLabel, sources: groupedSrc.res[selectedRes]}; }