Skip to content

Commit 4b4b579

Browse files
authored
Merge pull request #251 from mediaelement/release_3.0.0
release 3.0.0
2 parents 101dc0d + d051995 commit 4b4b579

File tree

6 files changed

+18
-35
lines changed

6 files changed

+18
-35
lines changed

dist/a11y/a11y.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
1-
.mejs-video-description-button > button,
2-
.mejs__video-description-button > button,
3-
.mejs-audio-description-button > button,
4-
.mejs__audio-description-button > button {
5-
background-repeat: no-repeat;
6-
background-size: contain;
7-
opacity: 0.7;
8-
}
9-
10-
.mejs-video-description-button.video-description-on > button,
11-
.mejs__video-description-button.video-description-on > button,
12-
.mejs-audio-description-button.audio-description-on > button,
13-
.mejs__audio-description-button.audio-description-on > button {
14-
opacity: 1;
15-
}
16-
17-
.mejs-video-description-button > button,
18-
.mejs__video-description-button > button {
19-
background-image: url('video-description-icon.svg');
20-
}
21-
22-
.mejs-audio-description-button > button,
23-
.mejs__audio-description-button > button {
24-
background-image: url('audio-description-icon.svg');
25-
}
26-
271
.mejs-volume-button.hidden,
282
.mejs__volume-button.hidden {
293
display: none;

dist/a11y/a11y.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Object.assign(mejs.MepDefaults, {
3131

3232
isVoiceover: false,
3333

34-
audioDescriptionCanPlay: false
34+
audioDescriptionCanPlay: false,
35+
36+
iconSpritePath: 'mejs-a11y-icons.svg'
3537
});
3638

3739
Object.assign(MediaElementPlayer.prototype, {
@@ -67,13 +69,16 @@ Object.assign(MediaElementPlayer.prototype, {
6769
return node.className.indexOf(className) > -1;
6870
});
6971
},
72+
_generateIconHtml: function _generateIconHtml(id, classPrefix, iconSpritePath, iconId) {
73+
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>';
74+
},
7075
_createAudioDescription: function _createAudioDescription() {
7176
var t = this;
72-
77+
var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePath, 'icon-audio');
7378
var audioDescriptionTitle = mejs.i18n.t('mejs.a11y-audio-description');
7479
var audioDescriptionButton = document.createElement('div');
7580
audioDescriptionButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'audio-description-button';
76-
audioDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + audioDescriptionTitle + '" aria-label="' + audioDescriptionTitle + '" tabindex="0"></button>';
81+
audioDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + audioDescriptionTitle + '" aria-label="' + audioDescriptionTitle + '" tabindex="0">' + iconHtml + '</button>';
7782

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

@@ -86,10 +91,11 @@ Object.assign(MediaElementPlayer.prototype, {
8691
},
8792
_createVideoDescription: function _createVideoDescription() {
8893
var t = this;
94+
var iconHtml = t._generateIconHtml(t.id, t.options.classPrefix, t.options.iconSpritePath, 'icon-video');
8995
var videoDescriptionTitle = mejs.i18n.t('mejs.a11y-video-description');
9096
var videoDescriptionButton = document.createElement('div');
9197
videoDescriptionButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'video-description-button';
92-
videoDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + videoDescriptionTitle + '" aria-label="' + videoDescriptionTitle + '" tabindex="0"></button>';
98+
videoDescriptionButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + videoDescriptionTitle + '" aria-label="' + videoDescriptionTitle + '" tabindex="0">' + iconHtml + '</button>';
9399
t.addControlElement(videoDescriptionButton, 'video-description');
94100

95101
videoDescriptionButton.addEventListener('click', function () {

dist/a11y/a11y.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/a11y/a11y.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)