mediaelement-plugins
Advanced tools
Comparing version 2.6.1 to 2.6.2
# Version History | ||
## *2.6.2 (2021/11/04)* | ||
### QUALITY PLUGIN | ||
Improvements to the last quality-plugin update: | ||
* Adds qualities-selected-input class to selected input element and removes it from formerly selected | ||
* Removes focus from the container for the input elements and now directly focuses the currently selected input element, reducing necessary tabs by one | ||
## *2.6.1 (2021/10/08)* | ||
### QUALITY PLUGIN | ||
### QUALITY PLUGIN | ||
* Adds aria-controls and aria-expanded status. | ||
@@ -7,0 +14,0 @@ * Rewrites EventListeners to handle showing/hiding the flyout with keyboard and mouse events. |
@@ -134,3 +134,3 @@ /*! | ||
inputId = t.id + '-qualities-' + quality; | ||
player.qualitiesContainer.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'qualities-selector-list-item">' + ('<input class="' + t.options.classPrefix + 'qualities-selector-input" type="radio" name="' + t.id + '_qualities" disabled="disabled"') + ('value="' + quality + '" id="' + inputId + '" ' + (quality === defaultValue ? ' checked="checked"' : '') + ' />') + ('<label for="' + inputId + '" class="' + t.options.classPrefix + 'qualities-selector-label ' + (quality === defaultValue ? ' ' + t.options.classPrefix + 'qualities-selected' : '') + '">') + ((src.title || quality) + ' </label></li>'); | ||
player.qualitiesContainer.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'qualities-selector-list-item">' + ('<input class="' + t.options.classPrefix + 'qualities-selector-input ' + (quality === defaultValue ? t.options.classPrefix + 'qualities-selected-input' : '') + '" type="radio" name="' + t.id + '_qualities" disabled="disabled" ') + ('value="' + quality + '" id="' + inputId + '" ' + (quality === defaultValue ? ' checked="checked"' : '') + ' />') + ('<label for="' + inputId + '" class="' + t.options.classPrefix + 'qualities-selector-label ' + (quality === defaultValue ? ' ' + t.options.classPrefix + 'qualities-selected' : '') + '">') + ((src.title || quality) + ' </label></li>'); | ||
} | ||
@@ -149,3 +149,2 @@ }); | ||
mejs.Utils.addClass(qualitiesSelector, t.options.classPrefix + 'offscreen'); | ||
qualityButton.removeAttribute('aria-expanded'); | ||
qualityButton.setAttribute('aria-expanded', 'false'); | ||
@@ -161,3 +160,3 @@ qualityButton.focus(); | ||
qualityButton.setAttribute('aria-expanded', 'true'); | ||
qualitiesList.focus(); | ||
qualitiesSelector.querySelector('.' + t.options.classPrefix + 'qualities-selected-input').focus(); | ||
isHidden = false; | ||
@@ -336,13 +335,15 @@ } | ||
var selected = player.qualitiesContainer.querySelectorAll('.' + t.options.classPrefix + 'qualities-selected'); | ||
for (var i = 0, total = selected.length; i < total; i++) { | ||
mejs.Utils.removeClass(selected[i], t.options.classPrefix + 'qualities-selected'); | ||
var formerSelected = player.qualitiesContainer.querySelectorAll('.' + t.options.classPrefix + 'qualities-selected'); | ||
for (var i = 0, total = formerSelected.length; i < total; i++) { | ||
mejs.Utils.removeClass(formerSelected[i], t.options.classPrefix + 'qualities-selected'); | ||
formerSelected[i].parentElement.querySelector('input').classList.remove(t.options.classPrefix + 'qualities-selected-input'); | ||
} | ||
self.checked = true; | ||
var siblings = mejs.Utils.siblings(self, function (el) { | ||
var currentSelected = mejs.Utils.siblings(self, function (el) { | ||
return mejs.Utils.hasClass(el, t.options.classPrefix + 'qualities-selector-label'); | ||
}); | ||
for (var j = 0, _total2 = siblings.length; j < _total2; j++) { | ||
mejs.Utils.addClass(siblings[j], t.options.classPrefix + 'qualities-selected'); | ||
for (var j = 0, _total2 = currentSelected.length; j < _total2; j++) { | ||
mejs.Utils.addClass(currentSelected[j], t.options.classPrefix + 'qualities-selected'); | ||
currentSelected[j].parentElement.querySelector('input').classList.add(t.options.classPrefix + 'qualities-selected-input'); | ||
} | ||
@@ -349,0 +350,0 @@ |
@@ -12,2 +12,2 @@ /*! | ||
*/ | ||
!function s(l,o,r){function u(t,e){if(!o[t]){if(!l[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(c)return c(t,!0);var a=new Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}var n=o[t]={exports:{}};l[t][0].call(n.exports,function(e){return u(l[t][1][e]||e)},n,n.exports,s,l,o,r)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e<r.length;e++)u(r[e]);return u}({1:[function(e,t,i){"use strict";mejs.i18n.en["mejs.quality-chooser"]="Quality Chooser",Object.assign(mejs.MepDefaults,{defaultQuality:"auto",qualityText:null,autoGenerate:!1,autoDash:!1,autoHLS:!1,qualityChangeCallback:null}),Object.assign(MediaElementPlayer.prototype,{buildquality:function(i,e,t,a){for(var n=this,s=n.mediaFiles?n.mediaFiles:n.node.children,l=new Map,o=0,r=s.length;o<r;o++){var u=s[o],c=u instanceof HTMLElement?u.getAttribute("data-quality"):u["data-quality"];if("undefined"===c&&(c="Auto",n.options.autoGenerate=!0),n.mediaFiles){var d=document.createElement("source");d.src=u.src,d.type=u.type,n.addValueToKey(l,c,d)}else"SOURCE"===u.nodeName&&n.addValueToKey(l,c,u)}if(!(l.size<=1)){var f=0;a.addEventListener("error",function(e){if("No renderer found"===e.message&&l.get("").length>f+1){f+=1;var t=l.get("")[f].src;a.setSrc(t),a.load()}}),a.addEventListener("loadedmetadata",function(){if(a.hlsPlayer){var e=a.hlsPlayer.levels;n.options.autoGenerate&&1<e.length&&(e.forEach(function(e){var t=e.height,i=n.getQualityFromHeight(t);n.addValueToKey(l,i,"")}),n.options.autoHLS=!0,n.generateQualityButton(n,i,a,l,""))}else if(a.dashPlayer){var t=a.dashPlayer.getBitrateInfoListFor("video");n.options.autoGenerate&&1<t.length&&(t.forEach(function(e){var t=e.height,i=n.getQualityFromHeight(t);n.addValueToKey(l,i,"")}),n.options.autoDash=!0,n.generateQualityButton(n,i,a,l,""))}}),n.generateQualityButton(n,i,a,l,"")}},generateQualityButton:function(s,l,i,a,n){s.cleanquality(l);var e=mejs.Utils.isString(s.options.qualityText)?s.options.qualityText:mejs.i18n.t("mejs.quality-chooser"),o=function(e){var t=void 0;t="auto"===e?s.keyExist(a,e)?e:s.getMapIndex(a,0).key:e;return t}(s.options.defaultQuality);n=o;var t=Math.floor(100*Math.random());l.qualitiesContainer=document.createElement("div"),l.qualitiesContainer.className=s.options.classPrefix+"button "+s.options.classPrefix+"qualities-button",l.qualitiesContainer.innerHTML='<button type="button" title="'+e+'" aria-label="'+e+'" aria-controls="qualitieslist-'+t+'" aria-expanded="false">'+o+'</button><div class="'+s.options.classPrefix+"qualities-selector "+s.options.classPrefix+'offscreen"><ul class="'+s.options.classPrefix+'qualities-selector-list" id="qualitieslist-'+t+'" tabindex="-1"></ul></div>',s.addControlElement(l.qualitiesContainer,"qualities"),a.forEach(function(e,t){if("map_keys_1"!==t){var i=e[0],a=t,n=s.id+"-qualities-"+a;l.qualitiesContainer.querySelector("ul").innerHTML+='<li class="'+s.options.classPrefix+'qualities-selector-list-item"><input class="'+s.options.classPrefix+'qualities-selector-input" type="radio" name="'+s.id+'_qualities" disabled="disabled"value="'+a+'" id="'+n+'" '+(a===o?' checked="checked"':"")+' /><label for="'+n+'" class="'+s.options.classPrefix+"qualities-selector-label "+(a===o?" "+s.options.classPrefix+"qualities-selected":"")+'">'+(i.title||a)+" </label></li>"}});var r=!0,u=l.qualitiesContainer,c=l.qualitiesContainer.querySelector("button"),d=l.qualitiesContainer.querySelector("."+s.options.classPrefix+"qualities-selector"),f=l.qualitiesContainer.querySelector("."+s.options.classPrefix+"qualities-selector-list"),p=l.qualitiesContainer.querySelectorAll('input[type="radio"]'),h=l.qualitiesContainer.querySelectorAll("."+s.options.classPrefix+"qualities-selector-label");function y(){mejs.Utils.addClass(d,s.options.classPrefix+"offscreen"),c.removeAttribute("aria-expanded"),c.setAttribute("aria-expanded","false"),c.focus(),r=!0}function v(){mejs.Utils.removeClass(d,s.options.classPrefix+"offscreen"),d.style.height=d.querySelector("ul").offsetHeight+"px",d.style.top=-1*parseFloat(d.offsetHeight)+"px",c.setAttribute("aria-expanded","true"),f.focus(),r=!1}c.addEventListener("click",function(){!0===r?v():y()}),f.addEventListener("focusout",function(e){u.contains(e.relatedTarget)||y()}),c.addEventListener("mouseenter",function(){v()}),u.addEventListener("mouseleave",function(){y()}),u.addEventListener("keydown",function(e){"Escape"===e.key&&y(),e.stopPropagation()});for(var q=0,g=p.length;q<g;q++){var m=p[q];m.disabled=!1,m.addEventListener("change",function(){if(s.options.autoDash)s.updateQualityButton(this,l,n),s.switchDashQuality(l,i);else if(s.options.autoHLS)s.updateQualityButton(this,l,n),s.switchHLSQuality(l,i);else{s.updateQualityButton(this,l,n);var t=i.currentTime,e=i.paused;e||i.pause(),s.updateVideoSource(i,a,n),i.setSrc(a.get(n)[0].src),i.load(),i.dispatchEvent(mejs.Utils.createEvent("seeking",i)),e||i.play(),i.addEventListener("canplay",function e(){i.setCurrentTime(t),i.removeEventListener("canplay",e)})}s.options.qualityChangeCallback&&s.options.qualityChangeCallback(i,i.originalNode,newQuality)})}for(var x=0,C=h.length;x<C;x++)h[x].addEventListener("click",function(){var e=mejs.Utils.siblings(this,function(e){return"INPUT"===e.tagName})[0],t=mejs.Utils.createEvent("click",e);e.dispatchEvent(t)})},cleanquality:function(e){e&&e.qualitiesContainer&&e.qualitiesContainer.remove()},addValueToKey:function(e,t,i){e.has("map_keys_1")?e.get("map_keys_1").push(t):e.set("map_keys_1",[]),e.has(t)||e.set(t,[]),e.get(t).push(i)},updateVideoSource:function(i,e,t){this.cleanMediaSource(i);for(var a=e.get(t),n=function(e){var t=i.children[e];"VIDEO"===t.tagName&&a.forEach(function(e){t.appendChild(e)})},s=0;s<i.children.length;s++)n(s)},cleanMediaSource:function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if("VIDEO"===i.tagName)for(;i.firstChild;)i.removeChild(i.firstChild)}},getMapIndex:function(e,i){var a=-1,n={};return e.forEach(function(e,t){a===i&&(n.key=t,n.value=e),a++}),n},keyExist:function(e,t){return-1<e.get("map_keys_1").indexOf(t)},switchDashQuality:function(e,t){for(var i=e.qualitiesContainer.querySelectorAll('input[type="radio"]'),a=0;a<i.length;a++)i[a].checked&&(0===a?t.dashPlayer.setAutoSwitchQuality(!0):(t.dashPlayer.setAutoSwitchQuality(!1),t.dashPlayer.setQualityFor("video",a-1)))},switchHLSQuality:function(e,t){for(var i=e.qualitiesContainer.querySelectorAll('input[type="radio"]'),a=0;a<i.length;a++)i[a].checked&&(t.hlsPlayer.currentLevel=0===a?-1:a-1)},updateQualityButton:function(e,t,i){var a=this,n=e.value;for(var s=t.qualitiesContainer.querySelectorAll("."+a.options.classPrefix+"qualities-selected"),l=0,o=s.length;l<o;l++)mejs.Utils.removeClass(s[l],a.options.classPrefix+"qualities-selected");e.checked=!0;for(var r=mejs.Utils.siblings(e,function(e){return mejs.Utils.hasClass(e,a.options.classPrefix+"qualities-selector-label")}),u=0,c=r.length;u<c;u++)mejs.Utils.addClass(r[u],a.options.classPrefix+"qualities-selected");t.qualitiesContainer.querySelector("button").innerHTML=n},getQualityFromHeight:function(e){return 4320<=e?"8K UHD":2160<=e?"UHD":1440<=e?"QHD":1080<=e?"FHD":720<=e?"HD":"SD"}})},{}]},{},[1]); | ||
!function n(l,o,r){function u(t,e){if(!o[t]){if(!l[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(c)return c(t,!0);var a=new Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}var s=o[t]={exports:{}};l[t][0].call(s.exports,function(e){return u(l[t][1][e]||e)},s,s.exports,n,l,o,r)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e<r.length;e++)u(r[e]);return u}({1:[function(e,t,i){"use strict";mejs.i18n.en["mejs.quality-chooser"]="Quality Chooser",Object.assign(mejs.MepDefaults,{defaultQuality:"auto",qualityText:null,autoGenerate:!1,autoDash:!1,autoHLS:!1,qualityChangeCallback:null}),Object.assign(MediaElementPlayer.prototype,{buildquality:function(i,e,t,a){for(var s=this,n=s.mediaFiles?s.mediaFiles:s.node.children,l=new Map,o=0,r=n.length;o<r;o++){var u=n[o],c=u instanceof HTMLElement?u.getAttribute("data-quality"):u["data-quality"];if("undefined"===c&&(c="Auto",s.options.autoGenerate=!0),s.mediaFiles){var d=document.createElement("source");d.src=u.src,d.type=u.type,s.addValueToKey(l,c,d)}else"SOURCE"===u.nodeName&&s.addValueToKey(l,c,u)}if(!(l.size<=1)){var f=0;a.addEventListener("error",function(e){if("No renderer found"===e.message&&l.get("").length>f+1){f+=1;var t=l.get("")[f].src;a.setSrc(t),a.load()}}),a.addEventListener("loadedmetadata",function(){if(a.hlsPlayer){var e=a.hlsPlayer.levels;s.options.autoGenerate&&1<e.length&&(e.forEach(function(e){var t=e.height,i=s.getQualityFromHeight(t);s.addValueToKey(l,i,"")}),s.options.autoHLS=!0,s.generateQualityButton(s,i,a,l,""))}else if(a.dashPlayer){var t=a.dashPlayer.getBitrateInfoListFor("video");s.options.autoGenerate&&1<t.length&&(t.forEach(function(e){var t=e.height,i=s.getQualityFromHeight(t);s.addValueToKey(l,i,"")}),s.options.autoDash=!0,s.generateQualityButton(s,i,a,l,""))}}),s.generateQualityButton(s,i,a,l,"")}},generateQualityButton:function(n,l,i,a,s){n.cleanquality(l);var e=mejs.Utils.isString(n.options.qualityText)?n.options.qualityText:mejs.i18n.t("mejs.quality-chooser"),o=function(e){var t=void 0;t="auto"===e?n.keyExist(a,e)?e:n.getMapIndex(a,0).key:e;return t}(n.options.defaultQuality);s=o;var t=Math.floor(100*Math.random());l.qualitiesContainer=document.createElement("div"),l.qualitiesContainer.className=n.options.classPrefix+"button "+n.options.classPrefix+"qualities-button",l.qualitiesContainer.innerHTML='<button type="button" title="'+e+'" aria-label="'+e+'" aria-controls="qualitieslist-'+t+'" aria-expanded="false">'+o+'</button><div class="'+n.options.classPrefix+"qualities-selector "+n.options.classPrefix+'offscreen"><ul class="'+n.options.classPrefix+'qualities-selector-list" id="qualitieslist-'+t+'" tabindex="-1"></ul></div>',n.addControlElement(l.qualitiesContainer,"qualities"),a.forEach(function(e,t){if("map_keys_1"!==t){var i=e[0],a=t,s=n.id+"-qualities-"+a;l.qualitiesContainer.querySelector("ul").innerHTML+='<li class="'+n.options.classPrefix+'qualities-selector-list-item"><input class="'+n.options.classPrefix+"qualities-selector-input "+(a===o?n.options.classPrefix+"qualities-selected-input":"")+'" type="radio" name="'+n.id+'_qualities" disabled="disabled" value="'+a+'" id="'+s+'" '+(a===o?' checked="checked"':"")+' /><label for="'+s+'" class="'+n.options.classPrefix+"qualities-selector-label "+(a===o?" "+n.options.classPrefix+"qualities-selected":"")+'">'+(i.title||a)+" </label></li>"}});var r=!0,u=l.qualitiesContainer,c=l.qualitiesContainer.querySelector("button"),d=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector"),f=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector-list"),p=l.qualitiesContainer.querySelectorAll('input[type="radio"]'),y=l.qualitiesContainer.querySelectorAll("."+n.options.classPrefix+"qualities-selector-label");function h(){mejs.Utils.addClass(d,n.options.classPrefix+"offscreen"),c.setAttribute("aria-expanded","false"),c.focus(),r=!0}function q(){mejs.Utils.removeClass(d,n.options.classPrefix+"offscreen"),d.style.height=d.querySelector("ul").offsetHeight+"px",d.style.top=-1*parseFloat(d.offsetHeight)+"px",c.setAttribute("aria-expanded","true"),d.querySelector("."+n.options.classPrefix+"qualities-selected-input").focus(),r=!1}c.addEventListener("click",function(){!0===r?q():h()}),f.addEventListener("focusout",function(e){u.contains(e.relatedTarget)||h()}),c.addEventListener("mouseenter",function(){q()}),u.addEventListener("mouseleave",function(){h()}),u.addEventListener("keydown",function(e){"Escape"===e.key&&h(),e.stopPropagation()});for(var v=0,g=p.length;v<g;v++){var m=p[v];m.disabled=!1,m.addEventListener("change",function(){if(n.options.autoDash)n.updateQualityButton(this,l,s),n.switchDashQuality(l,i);else if(n.options.autoHLS)n.updateQualityButton(this,l,s),n.switchHLSQuality(l,i);else{n.updateQualityButton(this,l,s);var t=i.currentTime,e=i.paused;e||i.pause(),n.updateVideoSource(i,a,s),i.setSrc(a.get(s)[0].src),i.load(),i.dispatchEvent(mejs.Utils.createEvent("seeking",i)),e||i.play(),i.addEventListener("canplay",function e(){i.setCurrentTime(t),i.removeEventListener("canplay",e)})}n.options.qualityChangeCallback&&n.options.qualityChangeCallback(i,i.originalNode,newQuality)})}for(var x=0,C=y.length;x<C;x++)y[x].addEventListener("click",function(){var e=mejs.Utils.siblings(this,function(e){return"INPUT"===e.tagName})[0],t=mejs.Utils.createEvent("click",e);e.dispatchEvent(t)})},cleanquality:function(e){e&&e.qualitiesContainer&&e.qualitiesContainer.remove()},addValueToKey:function(e,t,i){e.has("map_keys_1")?e.get("map_keys_1").push(t):e.set("map_keys_1",[]),e.has(t)||e.set(t,[]),e.get(t).push(i)},updateVideoSource:function(i,e,t){this.cleanMediaSource(i);for(var a=e.get(t),s=function(e){var t=i.children[e];"VIDEO"===t.tagName&&a.forEach(function(e){t.appendChild(e)})},n=0;n<i.children.length;n++)s(n)},cleanMediaSource:function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if("VIDEO"===i.tagName)for(;i.firstChild;)i.removeChild(i.firstChild)}},getMapIndex:function(e,i){var a=-1,s={};return e.forEach(function(e,t){a===i&&(s.key=t,s.value=e),a++}),s},keyExist:function(e,t){return-1<e.get("map_keys_1").indexOf(t)},switchDashQuality:function(e,t){for(var i=e.qualitiesContainer.querySelectorAll('input[type="radio"]'),a=0;a<i.length;a++)i[a].checked&&(0===a?t.dashPlayer.setAutoSwitchQuality(!0):(t.dashPlayer.setAutoSwitchQuality(!1),t.dashPlayer.setQualityFor("video",a-1)))},switchHLSQuality:function(e,t){for(var i=e.qualitiesContainer.querySelectorAll('input[type="radio"]'),a=0;a<i.length;a++)i[a].checked&&(t.hlsPlayer.currentLevel=0===a?-1:a-1)},updateQualityButton:function(e,t,i){var a=this,s=e.value;for(var n=t.qualitiesContainer.querySelectorAll("."+a.options.classPrefix+"qualities-selected"),l=0,o=n.length;l<o;l++)mejs.Utils.removeClass(n[l],a.options.classPrefix+"qualities-selected"),n[l].parentElement.querySelector("input").classList.remove(a.options.classPrefix+"qualities-selected-input");e.checked=!0;for(var r=mejs.Utils.siblings(e,function(e){return mejs.Utils.hasClass(e,a.options.classPrefix+"qualities-selector-label")}),u=0,c=r.length;u<c;u++)mejs.Utils.addClass(r[u],a.options.classPrefix+"qualities-selected"),r[u].parentElement.querySelector("input").classList.add(a.options.classPrefix+"qualities-selected-input");t.qualitiesContainer.querySelector("button").innerHTML=s},getQualityFromHeight:function(e){return 4320<=e?"8K UHD":2160<=e?"UHD":1440<=e?"QHD":1080<=e?"FHD":720<=e?"HD":"SD"}})},{}]},{},[1]); |
{ | ||
"name": "mediaelement-plugins", | ||
"version": "2.6.1", | ||
"version": "2.6.2", | ||
"repository": { | ||
@@ -23,3 +23,3 @@ "type": "git", | ||
"cssnano": "^3.8.0", | ||
"grunt": "^1.0.1", | ||
"grunt": "^1.4.1", | ||
"grunt-babel": "^6.0.0", | ||
@@ -34,3 +34,3 @@ "grunt-browserify": "^5.0.0", | ||
"grunt-eslint": "^19.0.0", | ||
"grunt-postcss": "^0.8.0", | ||
"grunt-postcss": "^0.9.0", | ||
"grunt-remove-logging": "^0.2.0", | ||
@@ -37,0 +37,0 @@ "grunt-shell": "^2.1.0", |
@@ -168,3 +168,3 @@ 'use strict'; | ||
player.qualitiesContainer.querySelector('ul').innerHTML += `<li class="${t.options.classPrefix}qualities-selector-list-item">` + | ||
`<input class="${t.options.classPrefix}qualities-selector-input" type="radio" name="${t.id}_qualities" disabled="disabled"` + | ||
`<input class="${t.options.classPrefix}qualities-selector-input ${(quality === defaultValue ? `${t.options.classPrefix}qualities-selected-input` : '')}" type="radio" name="${t.id}_qualities" disabled="disabled" ` + | ||
`value="${quality}" id="${inputId}" ${(quality === defaultValue ? ' checked="checked"' : '')} />` + | ||
@@ -189,3 +189,2 @@ `<label for="${inputId}" class="${t.options.classPrefix}qualities-selector-label ${(quality === defaultValue ? ` ${t.options.classPrefix}qualities-selected` : '')}">` + | ||
mejs.Utils.addClass(qualitiesSelector, `${t.options.classPrefix}offscreen`); | ||
qualityButton.removeAttribute('aria-expanded'); | ||
qualityButton.setAttribute('aria-expanded', 'false'); | ||
@@ -201,3 +200,3 @@ qualityButton.focus(); | ||
qualityButton.setAttribute('aria-expanded', 'true'); | ||
qualitiesList.focus(); | ||
qualitiesSelector.querySelector('.' + t.options.classPrefix + 'qualities-selected-input').focus(); | ||
isHidden = false; | ||
@@ -435,11 +434,13 @@ } | ||
const selected = player.qualitiesContainer.querySelectorAll(`.${t.options.classPrefix}qualities-selected`); | ||
for (let i = 0, total = selected.length; i < total; i++) { | ||
mejs.Utils.removeClass(selected[i], `${t.options.classPrefix}qualities-selected`); | ||
const formerSelected = player.qualitiesContainer.querySelectorAll(`.${t.options.classPrefix}qualities-selected`); | ||
for (let i = 0, total = formerSelected.length; i < total; i++) { | ||
mejs.Utils.removeClass(formerSelected[i], `${t.options.classPrefix}qualities-selected`); | ||
formerSelected[i].parentElement.querySelector('input').classList.remove(`${t.options.classPrefix}qualities-selected-input`); | ||
} | ||
self.checked = true; | ||
const siblings = mejs.Utils.siblings(self, (el) => mejs.Utils.hasClass(el, `${t.options.classPrefix}qualities-selector-label`)); | ||
for (let j = 0, total = siblings.length; j < total; j++) { | ||
mejs.Utils.addClass(siblings[j], `${t.options.classPrefix}qualities-selected`); | ||
const currentSelected = mejs.Utils.siblings(self, (el) => mejs.Utils.hasClass(el, `${t.options.classPrefix}qualities-selector-label`)); | ||
for (let j = 0, total = currentSelected.length; j < total; j++) { | ||
mejs.Utils.addClass(currentSelected[j], `${t.options.classPrefix}qualities-selected`); | ||
currentSelected[j].parentElement.querySelector('input').classList.add(`${t.options.classPrefix}qualities-selected-input`); | ||
} | ||
@@ -446,0 +447,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
23
90
746376
244
13188