diff --git a/changelog.md b/changelog.md
index 8dc6fa8..ad30ad8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,13 @@
# Version History
+## *3.0.1 (2024/03/11)*
+### QUALITY PLUGIN
+* Icon Visibility Fix: The quality icon will now remain visible and functional across all quality adjustments.
+* Improved Option Naming: The option `iconPath` has been renamed to `iconPathQuality` to enhance clarity and consistency.
+
+### A11Y PLUGIN
+* Improved Option Naming: The option `iconSpritePath` has been renamed to `iconSpritePathA11y` to enhance clarity and consistency.
+
## *3.0.0 (2024/03/06)*
### QUALITY PLUGIN
#### New Feature: Inline SVG icons for quality button
diff --git a/dist/a11y/a11y.js b/dist/a11y/a11y.js
index 9b0908f..db3f41e 100644
--- a/dist/a11y/a11y.js
+++ b/dist/a11y/a11y.js
@@ -33,7 +33,7 @@ Object.assign(mejs.MepDefaults, {
audioDescriptionCanPlay: false,
- iconSpritePath: 'mejs-a11y-icons.svg'
+ iconSpritePathA11y: 'mejs-a11y-icons.svg'
});
Object.assign(MediaElementPlayer.prototype, {
@@ -69,12 +69,12 @@ Object.assign(MediaElementPlayer.prototype, {
return node.className.indexOf(className) > -1;
});
},
- _generateIconHtml: function _generateIconHtml(id, classPrefix, iconSpritePath, iconId) {
- return '';
+ _generateIconHtml: function _generateIconHtml(id, classPrefix, iconSpritePathA11y, iconId) {
+ return '';
},
_createAudioDescription: function _createAudioDescription() {
var t = this;
- var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePath, 'icon-audio');
+ var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePathA11y, 'icon-audio');
var audioDescriptionTitle = mejs.i18n.t('mejs.a11y-audio-description');
var audioDescriptionButton = document.createElement('div');
audioDescriptionButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'audio-description-button';
@@ -91,7 +91,7 @@ Object.assign(MediaElementPlayer.prototype, {
},
_createVideoDescription: function _createVideoDescription() {
var t = this;
- var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePath, 'icon-video');
+ var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePathA11y, 'icon-video');
var videoDescriptionTitle = mejs.i18n.t('mejs.a11y-video-description');
var videoDescriptionButton = document.createElement('div');
videoDescriptionButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'video-description-button';
diff --git a/dist/a11y/a11y.min.js b/dist/a11y/a11y.min.js
index 8693f7c..1f5cddb 100644
--- a/dist/a11y/a11y.min.js
+++ b/dist/a11y/a11y.min.js
@@ -9,4 +9,4 @@
* License: MIT
*
*/
-!function r(s,a,d){function u(i,e){if(!a[i]){if(!s[i]){var o="function"==typeof require&&require;if(!e&&o)return o(i,!0);if(c)return c(i,!0);var t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}var n=a[i]={exports:{}};s[i][0].call(n.exports,function(e){return u(s[i][1][e]||e)},n,n.exports,r,s,a,d)}return a[i].exports}for(var c="function"==typeof require&&require,e=0;e\n '},_createAudioDescription:function(){var e=this,i=e._generateIconHtml(e.id,e.options.classPrefix,e.options.iconSpritePath,"icon-audio"),o=mejs.i18n.t("mejs.a11y-audio-description"),t=document.createElement("div");t.className=e.options.classPrefix+"button "+e.options.classPrefix+"audio-description-button",t.innerHTML='",e.addControlElement(t,"audio-description"),t.addEventListener("click",function(){e.options.audioDescriptionToggled=!e.options.audioDescriptionToggled,mejs.Utils.toggleClass(t,"audio-description-on"),e._toggleAudioDescription()})},_createVideoDescription:function(){var e=this,i=e._generateIconHtml(e.id,e.options.classPrefix,e.options.iconSpritePath,"icon-video"),o=mejs.i18n.t("mejs.a11y-video-description"),t=document.createElement("div");t.className=e.options.classPrefix+"button "+e.options.classPrefix+"video-description-button",t.innerHTML='",e.addControlElement(t,"video-description"),t.addEventListener("click",function(){e.options.videoDescriptionToggled=!e.options.videoDescriptionToggled,mejs.Utils.toggleClass(t,"video-description-on"),e._toggleVideoDescription()})},_loadSourceFromAttribute:function(i){if(!this.node.hasAttribute(i))return null;var e,o=void 0;try{var t=this.node.getAttribute(i);o=JSON.parse(t)}catch(e){console.error("error loading "+i+": "+e.message)}finally{e=o}return e?this._evaluateBestMatchingSource(e):null},_loadBooleanFromAttribute:function(e){if(!this.node.hasAttribute(e))return!1;var i=this.node.getAttribute(e);return"true"===i||""===i},_evaluateBestMatchingSource:function(e){var t=this,i=function(e){return o=e.type,i=mejs.Utils.getMimeFromType(o),t.node.canPlayType(i);var i,o},o=e.find(function(e){return"probably"===i(e)});if(o)return o;var n=e.find(function(e){return"maybe"===i(e)});return n||null},_createAudioDescriptionPlayer:function(){var o=this,e=document.createElement("audio");if(e.setAttribute("preload","auto"),e.classList.add(o.options.classPrefix+"audio-description-player"),e.setAttribute("src",o.options.audioDescriptionSource.src),e.setAttribute("type",o.options.audioDescriptionSource.type),e.load(),document.body.appendChild(e),o.audioDescription=new mejs.MediaElementPlayer(e,{features:["volume"],audioVolume:o.options.videoVolume,startVolume:o.node.volume,pauseOtherPlayers:!1,iconSprite:o.options.iconSprite,fakeNodeName:o.options.fakeNodeName||"mediaelementwrapper"}),o.audioDescription.node.addEventListener("canplay",function(){return o.options.audioDescriptionCanPlay=!0}),o.media.addEventListener("play",function(){return o.audioDescription.node.play().catch(function(e){return console.error(e)})}),o.media.addEventListener("playing",function(){return o.audioDescription.node.play().catch(function(e){return console.error(e)})}),o.media.addEventListener("pause",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("waiting",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("ended",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("timeupdate",function(){var e=.35\n '},_createAudioDescription:function(){var e=this,i=e._generateIconHtml(e.id,e.options.classPrefix,e.options.iconSpritePathA11y,"icon-audio"),o=mejs.i18n.t("mejs.a11y-audio-description"),t=document.createElement("div");t.className=e.options.classPrefix+"button "+e.options.classPrefix+"audio-description-button",t.innerHTML='",e.addControlElement(t,"audio-description"),t.addEventListener("click",function(){e.options.audioDescriptionToggled=!e.options.audioDescriptionToggled,mejs.Utils.toggleClass(t,"audio-description-on"),e._toggleAudioDescription()})},_createVideoDescription:function(){var e=this,i=e._generateIconHtml(e.id,e.options.classPrefix,e.options.iconSpritePathA11y,"icon-video"),o=mejs.i18n.t("mejs.a11y-video-description"),t=document.createElement("div");t.className=e.options.classPrefix+"button "+e.options.classPrefix+"video-description-button",t.innerHTML='",e.addControlElement(t,"video-description"),t.addEventListener("click",function(){e.options.videoDescriptionToggled=!e.options.videoDescriptionToggled,mejs.Utils.toggleClass(t,"video-description-on"),e._toggleVideoDescription()})},_loadSourceFromAttribute:function(i){if(!this.node.hasAttribute(i))return null;var e,o=void 0;try{var t=this.node.getAttribute(i);o=JSON.parse(t)}catch(e){console.error("error loading "+i+": "+e.message)}finally{e=o}return e?this._evaluateBestMatchingSource(e):null},_loadBooleanFromAttribute:function(e){if(!this.node.hasAttribute(e))return!1;var i=this.node.getAttribute(e);return"true"===i||""===i},_evaluateBestMatchingSource:function(e){var t=this,i=function(e){return o=e.type,i=mejs.Utils.getMimeFromType(o),t.node.canPlayType(i);var i,o},o=e.find(function(e){return"probably"===i(e)});if(o)return o;var n=e.find(function(e){return"maybe"===i(e)});return n||null},_createAudioDescriptionPlayer:function(){var o=this,e=document.createElement("audio");if(e.setAttribute("preload","auto"),e.classList.add(o.options.classPrefix+"audio-description-player"),e.setAttribute("src",o.options.audioDescriptionSource.src),e.setAttribute("type",o.options.audioDescriptionSource.type),e.load(),document.body.appendChild(e),o.audioDescription=new mejs.MediaElementPlayer(e,{features:["volume"],audioVolume:o.options.videoVolume,startVolume:o.node.volume,pauseOtherPlayers:!1,iconSprite:o.options.iconSprite,fakeNodeName:o.options.fakeNodeName||"mediaelementwrapper"}),o.audioDescription.node.addEventListener("canplay",function(){return o.options.audioDescriptionCanPlay=!0}),o.media.addEventListener("play",function(){return o.audioDescription.node.play().catch(function(e){return console.error(e)})}),o.media.addEventListener("playing",function(){return o.audioDescription.node.play().catch(function(e){return console.error(e)})}),o.media.addEventListener("pause",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("waiting",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("ended",function(){return o.audioDescription.node.pause()}),o.media.addEventListener("timeupdate",function(){var e=.35\n\t\t\t';
+ var iconHtml = '';
player.qualitiesContainer = document.createElement('div');
player.qualitiesContainer.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'qualities-button';
- player.qualitiesContainer.innerHTML = '' + ('');
+ player.qualitiesContainer.innerHTML = '' + ('');
t.addControlElement(player.qualitiesContainer, 'qualities');
@@ -335,7 +335,6 @@ Object.assign(MediaElementPlayer.prototype, {
updateQualityButton: function updateQualityButton(self, player) {
var t = this;
var newQuality = self.value;
-
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');
@@ -351,7 +350,10 @@ Object.assign(MediaElementPlayer.prototype, {
currentSelected[j].parentElement.querySelector('input').classList.add(t.options.classPrefix + 'qualities-selected-input');
}
- player.qualitiesContainer.querySelector('button').innerHTML = newQuality;
+ if (!t.options.iconPathQuality) {
+ player.qualitiesContainer.querySelector('button').innerHTML = newQuality;
+ }
+
return newQuality;
},
getQualityFromHeight: function getQualityFromHeight(height) {
diff --git a/dist/quality/quality.min.js b/dist/quality/quality.min.js
index 7bd5ac5..5b9bfb5 100644
--- a/dist/quality/quality.min.js
+++ b/dist/quality/quality.min.js
@@ -9,4 +9,4 @@
* License: MIT
*
*/
-!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;ef+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\n\t\t\t';l.qualitiesContainer=document.createElement("div"),l.qualitiesContainer.className=n.options.classPrefix+"button "+n.options.classPrefix+"qualities-button",l.qualitiesContainer.innerHTML='',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+='"}});var u=!0,c=l.qualitiesContainer,d=l.qualitiesContainer.querySelector("button"),f=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector"),p=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector-list"),y=l.qualitiesContainer.querySelectorAll('input[type="radio"]'),h=l.qualitiesContainer.querySelectorAll("."+n.options.classPrefix+"qualities-selector-label");function q(){mejs.Utils.addClass(f,n.options.classPrefix+"offscreen"),d.setAttribute("aria-expanded","false"),d.focus(),u=!0}function v(){mejs.Utils.removeClass(f,n.options.classPrefix+"offscreen"),f.style.height=f.querySelector("ul").offsetHeight+"px",f.style.top=-1*parseFloat(f.offsetHeight)+"px",d.setAttribute("aria-expanded","true"),f.querySelector("."+n.options.classPrefix+"qualities-selected-input").focus(),u=!1}d.addEventListener("click",function(){!0===u?v():q()}),p.addEventListener("focusout",function(e){c.contains(e.relatedTarget)||q()}),d.addEventListener("mouseenter",function(){v()}),c.addEventListener("mouseleave",function(){q()}),c.addEventListener("keydown",function(e){"Escape"===e.key&&q(),e.stopPropagation()});for(var g=0,m=y.length;gf+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\n\t\t\t';l.qualitiesContainer=document.createElement("div"),l.qualitiesContainer.className=n.options.classPrefix+"button "+n.options.classPrefix+"qualities-button",l.qualitiesContainer.innerHTML='',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+='"}});var u=!0,c=l.qualitiesContainer,d=l.qualitiesContainer.querySelector("button"),f=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector"),p=l.qualitiesContainer.querySelector("."+n.options.classPrefix+"qualities-selector-list"),y=l.qualitiesContainer.querySelectorAll('input[type="radio"]'),h=l.qualitiesContainer.querySelectorAll("."+n.options.classPrefix+"qualities-selector-label");function q(){mejs.Utils.addClass(f,n.options.classPrefix+"offscreen"),d.setAttribute("aria-expanded","false"),d.focus(),u=!0}function v(){mejs.Utils.removeClass(f,n.options.classPrefix+"offscreen"),f.style.height=f.querySelector("ul").offsetHeight+"px",f.style.top=-1*parseFloat(f.offsetHeight)+"px",d.setAttribute("aria-expanded","true"),f.querySelector("."+n.options.classPrefix+"qualities-selected-input").focus(),u=!1}d.addEventListener("click",function(){!0===u?v():q()}),p.addEventListener("focusout",function(e){c.contains(e.relatedTarget)||q()}),d.addEventListener("mouseenter",function(){v()}),c.addEventListener("mouseleave",function(){q()}),c.addEventListener("keydown",function(e){"Escape"===e.key&&q(),e.stopPropagation()});for(var g=0,m=y.length;g