Skip to content

Commit

Permalink
Merge pull request #251 from mediaelement/release_3.0.0
Browse files Browse the repository at this point in the history
release 3.0.0
  • Loading branch information
digitas-git committed Mar 7, 2024
2 parents 101dc0d + d051995 commit 4b4b579
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 35 deletions.
26 changes: 0 additions & 26 deletions dist/a11y/a11y.css
@@ -1,29 +1,3 @@
.mejs-video-description-button > button,
.mejs__video-description-button > button,
.mejs-audio-description-button > button,
.mejs__audio-description-button > button {
background-repeat: no-repeat;
background-size: contain;
opacity: 0.7;
}

.mejs-video-description-button.video-description-on > button,
.mejs__video-description-button.video-description-on > button,
.mejs-audio-description-button.audio-description-on > button,
.mejs__audio-description-button.audio-description-on > button {
opacity: 1;
}

.mejs-video-description-button > button,
.mejs__video-description-button > button {
background-image: url('video-description-icon.svg');
}

.mejs-audio-description-button > button,
.mejs__audio-description-button > button {
background-image: url('audio-description-icon.svg');
}

.mejs-volume-button.hidden,
.mejs__volume-button.hidden {
display: none;
Expand Down
14 changes: 10 additions & 4 deletions dist/a11y/a11y.js
Expand Up @@ -31,7 +31,9 @@ Object.assign(mejs.MepDefaults, {

isVoiceover: false,

audioDescriptionCanPlay: false
audioDescriptionCanPlay: false,

iconSpritePath: 'mejs-a11y-icons.svg'
});

Object.assign(MediaElementPlayer.prototype, {
Expand Down Expand Up @@ -67,13 +69,16 @@ Object.assign(MediaElementPlayer.prototype, {
return node.className.indexOf(className) > -1;
});
},
_generateIconHtml: function _generateIconHtml(id, classPrefix, iconSpritePath, iconId) {
return '<svg xmlns="http://www.w3.org/2000/svg" id="' + id + '" class="' + classPrefix + iconId + '" aria-hidden="true" focusable="false">\n <use xlink:href="' + iconSpritePath + '#' + iconId + '"></use></svg>';
},
_createAudioDescription: function _createAudioDescription() {
var t = this;

var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePath, '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';
audioDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + audioDescriptionTitle + '" aria-label="' + audioDescriptionTitle + '" tabindex="0"></button>';
audioDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + audioDescriptionTitle + '" aria-label="' + audioDescriptionTitle + '" tabindex="0">' + iconHtml + '</button>';

t.addControlElement(audioDescriptionButton, 'audio-description');

Expand All @@ -86,10 +91,11 @@ 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 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';
videoDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + videoDescriptionTitle + '" aria-label="' + videoDescriptionTitle + '" tabindex="0"></button>';
videoDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + videoDescriptionTitle + '" aria-label="' + videoDescriptionTitle + '" tabindex="0">' + iconHtml + '</button>';
t.addControlElement(videoDescriptionButton, 'video-description');

videoDescriptionButton.addEventListener('click', function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/a11y/a11y.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/a11y/a11y.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b4b579

Please sign in to comment.