wai-website-theme 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/_data/lang.json +730 -0
- data/_data/techniques.yml +180 -0
- data/_data/wcag.yml +125 -0
- data/_includes/.DS_Store +0 -0
- data/_includes/body-class.html +1 -0
- data/_includes/box.html +10 -0
- data/_includes/excol.html +13 -0
- data/_includes/footer.html +40 -0
- data/_includes/head.html +23 -0
- data/_includes/header.html +59 -0
- data/_includes/icon.html +6 -0
- data/_includes/img.html +17 -0
- data/_includes/multilang-list-policy-links.html +29 -0
- data/_includes/multilang-list.html +35 -0
- data/_includes/multilang-policy-title.html +5 -0
- data/_includes/multilang-title-full.html +1 -0
- data/_includes/multilang-title.html +1 -0
- data/_includes/navlist.html +22 -0
- data/_includes/notes.html +2 -0
- data/_includes/prevnext.html +34 -0
- data/_includes/resources.html +19 -0
- data/_includes/sidenav.html +65 -0
- data/_includes/sidenote.html +14 -0
- data/_includes/toc.html +10 -0
- data/_includes/video-player.html +99 -0
- data/_layouts/default.html +26 -0
- data/_layouts/home.html +14 -0
- data/_layouts/news.html +21 -0
- data/_layouts/none.html +1 -0
- data/_layouts/policy.html +72 -0
- data/_layouts/sidenav.html +27 -0
- data/_layouts/sidenavsidebar.html +22 -0
- data/assets/ableplayer/.gitattributes +14 -0
- data/assets/ableplayer/.gitignore +7 -0
- data/assets/ableplayer/Gruntfile.js +105 -0
- data/assets/ableplayer/LICENSE +26 -0
- data/assets/ableplayer/README.md +656 -0
- data/assets/ableplayer/build/ableplayer.dist.js +12157 -0
- data/assets/ableplayer/build/ableplayer.js +12157 -0
- data/assets/ableplayer/build/ableplayer.min.css +2 -0
- data/assets/ableplayer/build/ableplayer.min.js +8 -0
- data/assets/ableplayer/button-icons/able-icons.svg +116 -0
- data/assets/ableplayer/button-icons/black/captions.png +0 -0
- data/assets/ableplayer/button-icons/black/chapters.png +0 -0
- data/assets/ableplayer/button-icons/black/close.png +0 -0
- data/assets/ableplayer/button-icons/black/descriptions.png +0 -0
- data/assets/ableplayer/button-icons/black/ellipsis.png +0 -0
- data/assets/ableplayer/button-icons/black/faster.png +0 -0
- data/assets/ableplayer/button-icons/black/forward.png +0 -0
- data/assets/ableplayer/button-icons/black/fullscreen-collapse.png +0 -0
- data/assets/ableplayer/button-icons/black/fullscreen-expand.png +0 -0
- data/assets/ableplayer/button-icons/black/help.png +0 -0
- data/assets/ableplayer/button-icons/black/next.png +0 -0
- data/assets/ableplayer/button-icons/black/pause.png +0 -0
- data/assets/ableplayer/button-icons/black/pipe.png +0 -0
- data/assets/ableplayer/button-icons/black/play.png +0 -0
- data/assets/ableplayer/button-icons/black/preferences.png +0 -0
- data/assets/ableplayer/button-icons/black/previous.png +0 -0
- data/assets/ableplayer/button-icons/black/rabbit.png +0 -0
- data/assets/ableplayer/button-icons/black/restart.png +0 -0
- data/assets/ableplayer/button-icons/black/rewind.png +0 -0
- data/assets/ableplayer/button-icons/black/sign.png +0 -0
- data/assets/ableplayer/button-icons/black/slower.png +0 -0
- data/assets/ableplayer/button-icons/black/stop.png +0 -0
- data/assets/ableplayer/button-icons/black/transcript.png +0 -0
- data/assets/ableplayer/button-icons/black/turtle.png +0 -0
- data/assets/ableplayer/button-icons/black/volume-loud.png +0 -0
- data/assets/ableplayer/button-icons/black/volume-medium.png +0 -0
- data/assets/ableplayer/button-icons/black/volume-mute.png +0 -0
- data/assets/ableplayer/button-icons/black/volume-soft.png +0 -0
- data/assets/ableplayer/button-icons/fonts/able.eot +0 -0
- data/assets/ableplayer/button-icons/fonts/able.svg +40 -0
- data/assets/ableplayer/button-icons/fonts/able.ttf +0 -0
- data/assets/ableplayer/button-icons/fonts/able.woff +0 -0
- data/assets/ableplayer/button-icons/white/captions.png +0 -0
- data/assets/ableplayer/button-icons/white/chapters.png +0 -0
- data/assets/ableplayer/button-icons/white/close.png +0 -0
- data/assets/ableplayer/button-icons/white/descriptions.png +0 -0
- data/assets/ableplayer/button-icons/white/ellipsis.png +0 -0
- data/assets/ableplayer/button-icons/white/faster.png +0 -0
- data/assets/ableplayer/button-icons/white/forward.png +0 -0
- data/assets/ableplayer/button-icons/white/fullscreen-collapse.png +0 -0
- data/assets/ableplayer/button-icons/white/fullscreen-expand.png +0 -0
- data/assets/ableplayer/button-icons/white/help.png +0 -0
- data/assets/ableplayer/button-icons/white/next.png +0 -0
- data/assets/ableplayer/button-icons/white/pause.png +0 -0
- data/assets/ableplayer/button-icons/white/pipe.png +0 -0
- data/assets/ableplayer/button-icons/white/play.png +0 -0
- data/assets/ableplayer/button-icons/white/preferences.png +0 -0
- data/assets/ableplayer/button-icons/white/previous.png +0 -0
- data/assets/ableplayer/button-icons/white/rabbit.png +0 -0
- data/assets/ableplayer/button-icons/white/restart.png +0 -0
- data/assets/ableplayer/button-icons/white/rewind.png +0 -0
- data/assets/ableplayer/button-icons/white/sign.png +0 -0
- data/assets/ableplayer/button-icons/white/slower.png +0 -0
- data/assets/ableplayer/button-icons/white/stop.png +0 -0
- data/assets/ableplayer/button-icons/white/transcript.png +0 -0
- data/assets/ableplayer/button-icons/white/turtle.png +0 -0
- data/assets/ableplayer/button-icons/white/volume-loud.png +0 -0
- data/assets/ableplayer/button-icons/white/volume-medium.png +0 -0
- data/assets/ableplayer/button-icons/white/volume-mute.png +0 -0
- data/assets/ableplayer/button-icons/white/volume-soft.png +0 -0
- data/assets/ableplayer/images/wingrip.png +0 -0
- data/assets/ableplayer/package.json +22 -0
- data/assets/ableplayer/scripts/JQuery.doWhen.js +113 -0
- data/assets/ableplayer/scripts/ableplayer-base.js +440 -0
- data/assets/ableplayer/scripts/browser.js +162 -0
- data/assets/ableplayer/scripts/buildplayer.js +1609 -0
- data/assets/ableplayer/scripts/caption.js +385 -0
- data/assets/ableplayer/scripts/chapters.js +242 -0
- data/assets/ableplayer/scripts/control.js +1514 -0
- data/assets/ableplayer/scripts/description.js +283 -0
- data/assets/ableplayer/scripts/dialog.js +147 -0
- data/assets/ableplayer/scripts/dragdrop.js +766 -0
- data/assets/ableplayer/scripts/event.js +595 -0
- data/assets/ableplayer/scripts/initialize.js +725 -0
- data/assets/ableplayer/scripts/langs.js +750 -0
- data/assets/ableplayer/scripts/metadata.js +134 -0
- data/assets/ableplayer/scripts/misc.js +72 -0
- data/assets/ableplayer/scripts/preference.js +909 -0
- data/assets/ableplayer/scripts/search.js +171 -0
- data/assets/ableplayer/scripts/sign.js +92 -0
- data/assets/ableplayer/scripts/slider.js +454 -0
- data/assets/ableplayer/scripts/track.js +296 -0
- data/assets/ableplayer/scripts/transcript.js +590 -0
- data/assets/ableplayer/scripts/translation.js +66 -0
- data/assets/ableplayer/scripts/volume.js +383 -0
- data/assets/ableplayer/scripts/webvtt.js +765 -0
- data/assets/ableplayer/scripts/youtube.js +471 -0
- data/assets/ableplayer/styles/ableplayer.css +1241 -0
- data/assets/ableplayer/thirdparty/js.cookie.js +145 -0
- data/assets/ableplayer/thirdparty/modernizr.custom.js +4 -0
- data/assets/ableplayer/translations/ca.js +1 -0
- data/assets/ableplayer/translations/de.js +1 -0
- data/assets/ableplayer/translations/en.js +305 -0
- data/assets/ableplayer/translations/es.js +305 -0
- data/assets/ableplayer/translations/fr.js +305 -0
- data/assets/ableplayer/translations/it.js +303 -0
- data/assets/ableplayer/translations/ja.js +305 -0
- data/assets/ableplayer/translations/nl.js +305 -0
- data/assets/css/style.css +4360 -0
- data/assets/css/style.css.map +1 -0
- data/assets/fonts/anonymouspro-bold.woff +0 -0
- data/assets/fonts/anonymouspro-bold.woff2 +0 -0
- data/assets/fonts/anonymouspro-bolditalic.woff +0 -0
- data/assets/fonts/anonymouspro-bolditalic.woff2 +0 -0
- data/assets/fonts/anonymouspro-italic.woff +0 -0
- data/assets/fonts/anonymouspro-italic.woff2 +0 -0
- data/assets/fonts/anonymouspro-regular.woff +0 -0
- data/assets/fonts/anonymouspro-regular.woff2 +0 -0
- data/assets/fonts/notosans-bold.woff +0 -0
- data/assets/fonts/notosans-bold.woff2 +0 -0
- data/assets/fonts/notosans-bolditalic.woff +0 -0
- data/assets/fonts/notosans-bolditalic.woff2 +0 -0
- data/assets/fonts/notosans-italic.woff +0 -0
- data/assets/fonts/notosans-italic.woff2 +0 -0
- data/assets/fonts/notosans-regular.woff +0 -0
- data/assets/fonts/notosans-regular.woff2 +0 -0
- data/assets/images/.DS_Store +0 -0
- data/assets/images/Shape.svg +10 -0
- data/assets/images/icon-related-content.svg +14 -0
- data/assets/images/icons.svg +126 -0
- data/assets/images/teaser-image@1x.jpg +0 -0
- data/assets/images/teaser-image@2x.jpg +0 -0
- data/assets/images/w3c.sketch +0 -0
- data/assets/images/w3c.svg +10 -0
- data/assets/scripts/jquery.min.js +4 -0
- data/assets/scripts/main.js +208 -0
- data/assets/scripts/svg4everybody.js +1 -0
- metadata +257 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
(function ($) {
|
|
2
|
+
|
|
3
|
+
AblePlayer.prototype.addVolumeSlider = function($div) {
|
|
4
|
+
|
|
5
|
+
// input type="range" requires IE10 and later
|
|
6
|
+
// and still isn't supported by Opera Mini as of v8
|
|
7
|
+
// Also, vertical orientation of slider requires CSS hacks
|
|
8
|
+
// and causes problems in some screen readers
|
|
9
|
+
// Therefore, building a custom vertical volume slider
|
|
10
|
+
var thisObj, volumeSliderId, volumeHelpId, x, y, volumePct;
|
|
11
|
+
|
|
12
|
+
thisObj = this;
|
|
13
|
+
|
|
14
|
+
// define a few variables
|
|
15
|
+
volumeSliderId = this.mediaId + '-volume-slider';
|
|
16
|
+
volumeHelpId = this.mediaId + '-volume-help';
|
|
17
|
+
this.volumeTrackHeight = 50; // must match CSS height for .able-volume-slider
|
|
18
|
+
this.volumeHeadHeight = 7; // must match CSS height for .able-volume-head
|
|
19
|
+
this.volumeTickHeight = this.volumeTrackHeight / 10;
|
|
20
|
+
|
|
21
|
+
this.$volumeSlider = $('<div>',{
|
|
22
|
+
'id': volumeSliderId,
|
|
23
|
+
'class': 'able-volume-slider',
|
|
24
|
+
'aria-hidden': 'true'
|
|
25
|
+
});
|
|
26
|
+
this.$volumeSliderTooltip = $('<div>',{
|
|
27
|
+
'class': 'able-tooltip',
|
|
28
|
+
'role': 'tooltip'
|
|
29
|
+
});
|
|
30
|
+
this.$volumeSliderTrack = $('<div>',{
|
|
31
|
+
'class': 'able-volume-track'
|
|
32
|
+
});
|
|
33
|
+
this.$volumeSliderTrackOn = $('<div>',{
|
|
34
|
+
'class': 'able-volume-track able-volume-track-on'
|
|
35
|
+
});
|
|
36
|
+
this.$volumeSliderHead = $('<div>',{
|
|
37
|
+
'class': 'able-volume-head',
|
|
38
|
+
'role': 'slider',
|
|
39
|
+
'aria-orientation': 'vertical',
|
|
40
|
+
'aria-label': this.tt.volumeUpDown,
|
|
41
|
+
'aria-valuemin': 0,
|
|
42
|
+
'aria-valuemax': 10,
|
|
43
|
+
'aria-valuenow': this.volume,
|
|
44
|
+
'tabindex': -1
|
|
45
|
+
});
|
|
46
|
+
this.$volumeSliderTrack.append(this.$volumeSliderTrackOn,this.$volumeSliderHead);
|
|
47
|
+
this.$volumeAlert = $('<div>',{
|
|
48
|
+
'class': 'able-offscreen',
|
|
49
|
+
'aria-live': 'assertive',
|
|
50
|
+
'aria-atomic': 'true'
|
|
51
|
+
});
|
|
52
|
+
volumePct = parseInt(thisObj.volume) / 10 * 100;
|
|
53
|
+
this.$volumeHelp = $('<div>',{
|
|
54
|
+
'id': volumeHelpId,
|
|
55
|
+
'class': 'able-volume-help'
|
|
56
|
+
}).text(volumePct + '%, ' + this.tt.volumeHelp);
|
|
57
|
+
this.$volumeButton.attr({
|
|
58
|
+
'aria-describedby': volumeHelpId
|
|
59
|
+
});
|
|
60
|
+
this.$volumeSlider.append(this.$volumeSliderTooltip,this.$volumeSliderTrack,this.$volumeAlert,this.$volumeHelp)
|
|
61
|
+
$div.append(this.$volumeSlider);
|
|
62
|
+
|
|
63
|
+
this.refreshVolumeSlider(this.volume);
|
|
64
|
+
|
|
65
|
+
// add event listeners
|
|
66
|
+
this.$volumeSliderHead.on('mousedown',function (event) {
|
|
67
|
+
event.preventDefault(); // prevent text selection (implications?)
|
|
68
|
+
thisObj.draggingVolume = true;
|
|
69
|
+
thisObj.volumeHeadPositionTop = $(this).offset().top;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// prevent dragging after mouseup as mouseup not detected over iframe (YouTube)
|
|
73
|
+
this.$mediaContainer.on('mouseover',function (event) {
|
|
74
|
+
if(thisObj.player == 'youtube'){
|
|
75
|
+
thisObj.draggingVolume = false;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
$(document).on('mouseup',function (event) {
|
|
80
|
+
thisObj.draggingVolume = false;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
$(document).on('mousemove',function (event) {
|
|
84
|
+
if (thisObj.draggingVolume) {
|
|
85
|
+
x = event.pageX;
|
|
86
|
+
y = event.pageY;
|
|
87
|
+
thisObj.moveVolumeHead(y);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
this.$volumeSliderHead.on('keydown',function (event) {
|
|
92
|
+
// Left arrow or down arrow
|
|
93
|
+
if (event.which === 37 || event.which === 40) {
|
|
94
|
+
thisObj.handleVolume('down');
|
|
95
|
+
}
|
|
96
|
+
// Right arrow or up arrow
|
|
97
|
+
else if (event.which === 39 || event.which === 38) {
|
|
98
|
+
thisObj.handleVolume('up');
|
|
99
|
+
}
|
|
100
|
+
// Escape key or Enter key
|
|
101
|
+
else if (event.which === 27 || event.which === 13) {
|
|
102
|
+
// close popup
|
|
103
|
+
if (thisObj.$volumeSlider.is(':visible')) {
|
|
104
|
+
thisObj.hideVolumePopup();
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
thisObj.showVolumePopup();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
AblePlayer.prototype.refreshVolumeSlider = function(volume) {
|
|
118
|
+
|
|
119
|
+
// adjust slider position based on current volume
|
|
120
|
+
var volumePct, volumePctText;
|
|
121
|
+
volumePct = (volume/10) * 100;
|
|
122
|
+
volumePctText = volumePct + '%';
|
|
123
|
+
|
|
124
|
+
var trackOnHeight, trackOnTop, headTop;
|
|
125
|
+
trackOnHeight = volume * this.volumeTickHeight;
|
|
126
|
+
trackOnTop = this.volumeTrackHeight - trackOnHeight;
|
|
127
|
+
headTop = trackOnTop - this.volumeHeadHeight;
|
|
128
|
+
|
|
129
|
+
this.$volumeSliderTrackOn.css({
|
|
130
|
+
'height': trackOnHeight + 'px',
|
|
131
|
+
'top': trackOnTop + 'px'
|
|
132
|
+
});
|
|
133
|
+
this.$volumeSliderHead.attr({
|
|
134
|
+
'aria-valuenow': volume,
|
|
135
|
+
'aria-valuetext': volumePctText
|
|
136
|
+
});
|
|
137
|
+
this.$volumeSliderHead.css({
|
|
138
|
+
'top': headTop + 'px'
|
|
139
|
+
});
|
|
140
|
+
this.$volumeAlert.text(volumePct + '%');
|
|
141
|
+
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
AblePlayer.prototype.refreshVolumeButton = function(volume) {
|
|
145
|
+
|
|
146
|
+
var volumeName, volumePct, volumeLabel, volumeIconClass, volumeImg;
|
|
147
|
+
|
|
148
|
+
volumeName = this.getVolumeName(volume);
|
|
149
|
+
volumePct = (volume/10) * 100;
|
|
150
|
+
volumeLabel = this.tt.volume + ' ' + volumePct + '%';
|
|
151
|
+
|
|
152
|
+
if (this.iconType === 'font') {
|
|
153
|
+
volumeIconClass = 'icon-volume-' + volumeName;
|
|
154
|
+
this.$volumeButton.find('span').first().removeClass().addClass(volumeIconClass);
|
|
155
|
+
this.$volumeButton.find('span.able-clipped').text(volumeLabel);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
volumeImg = this.imgPath + 'volume-' + volumeName + '.png';
|
|
159
|
+
this.$volumeButton.find('img').attr('src',volumeImg);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
AblePlayer.prototype.moveVolumeHead = function(y) {
|
|
164
|
+
|
|
165
|
+
// y is current position after mousemove
|
|
166
|
+
var diff, direction, ticksDiff, newVolume, maxedOut;
|
|
167
|
+
|
|
168
|
+
var diff = this.volumeHeadPositionTop - y;
|
|
169
|
+
|
|
170
|
+
// only move the volume head if user had dragged at least one tick
|
|
171
|
+
// this is more efficient, plus creates a "snapping' effect
|
|
172
|
+
if (Math.abs(diff) > this.volumeTickHeight) {
|
|
173
|
+
if (diff > 0) {
|
|
174
|
+
direction = 'up';
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
direction = 'down';
|
|
178
|
+
}
|
|
179
|
+
if (direction == 'up' && this.volume == 10) {
|
|
180
|
+
// can't go any higher
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
else if (direction == 'down' && this.volume == 0) {
|
|
184
|
+
// can't go any lower
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
ticksDiff = Math.round(Math.abs(diff) / this.volumeTickHeight);
|
|
189
|
+
if (direction == 'up') {
|
|
190
|
+
newVolume = this.volume + ticksDiff;
|
|
191
|
+
if (newVolume > 10) {
|
|
192
|
+
newVolume = 10;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else { // direction is down
|
|
196
|
+
newVolume = this.volume - ticksDiff;
|
|
197
|
+
if (newVolume < 0) {
|
|
198
|
+
newVolume = 0;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
this.setVolume(newVolume); // this.volume will be updated after volumechange event fires (event.js)
|
|
202
|
+
this.refreshVolumeSlider(newVolume);
|
|
203
|
+
this.refreshVolumeButton(newVolume);
|
|
204
|
+
this.volumeHeadPositionTop = y;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
AblePlayer.prototype.handleVolume = function(direction) {
|
|
210
|
+
|
|
211
|
+
// 'direction is either 'up','down', or an ASCII key code 49-57 (numeric keys 1-9)
|
|
212
|
+
// Action: calculate and change the volume
|
|
213
|
+
// Don't change this.volume and this.volumeButton yet - wait for 'volumechange' event to fire (event.js)
|
|
214
|
+
|
|
215
|
+
// If NO direction is provided, user has just clicked on the Volume button
|
|
216
|
+
// Action: show slider
|
|
217
|
+
var volume;
|
|
218
|
+
|
|
219
|
+
if (typeof direction === 'undefined') {
|
|
220
|
+
if (this.$volumeSlider.is(':visible')) {
|
|
221
|
+
this.hideVolumePopup();
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
this.showVolumePopup();
|
|
225
|
+
}
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (direction >= 49 && direction <= 57) {
|
|
230
|
+
volume = direction - 48;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
|
|
234
|
+
volume = this.getVolume();
|
|
235
|
+
|
|
236
|
+
if (direction === 'up' && volume < 10) {
|
|
237
|
+
volume += 1;
|
|
238
|
+
}
|
|
239
|
+
else if (direction === 'down' && volume > 0) {
|
|
240
|
+
volume -= 1;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (this.isMuted() && volume > 0) {
|
|
245
|
+
this.setMute(false);
|
|
246
|
+
}
|
|
247
|
+
else if (volume === 0) {
|
|
248
|
+
this.setMute(true);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
this.setVolume(volume); // this.volume will be updated after volumechange event fires (event.js)
|
|
252
|
+
this.refreshVolumeSlider(volume);
|
|
253
|
+
this.refreshVolumeButton(volume);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
AblePlayer.prototype.handleMute = function() {
|
|
258
|
+
if (this.isMuted()) {
|
|
259
|
+
this.setMute(false);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
this.setMute(true);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
AblePlayer.prototype.showVolumePopup = function() {
|
|
267
|
+
|
|
268
|
+
this.closePopups();
|
|
269
|
+
this.$tooltipDiv.hide();
|
|
270
|
+
this.$volumeSlider.show().attr('aria-hidden','false');
|
|
271
|
+
this.$volumeSliderHead.attr('tabindex','0').focus();
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
AblePlayer.prototype.hideVolumePopup = function() {
|
|
275
|
+
|
|
276
|
+
this.$volumeSlider.hide().attr('aria-hidden','true');
|
|
277
|
+
this.$volumeSliderHead.attr('tabindex','-1');
|
|
278
|
+
this.$volumeButton.focus();
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
AblePlayer.prototype.isMuted = function () {
|
|
282
|
+
|
|
283
|
+
if (this.player === 'html5') {
|
|
284
|
+
return this.media.muted;
|
|
285
|
+
}
|
|
286
|
+
else if (this.player === 'jw' && this.jwPlayer) {
|
|
287
|
+
return this.jwPlayer.getMute();
|
|
288
|
+
}
|
|
289
|
+
else if (this.player === 'youtube') {
|
|
290
|
+
return this.youTubePlayer.isMuted();
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
AblePlayer.prototype.setMute = function(mute) {
|
|
295
|
+
|
|
296
|
+
// mute is either true (muting) or false (unmuting)
|
|
297
|
+
if (mute) {
|
|
298
|
+
// save current volume so it can be restored after unmute
|
|
299
|
+
this.lastVolume = this.volume;
|
|
300
|
+
this.volume = 0;
|
|
301
|
+
}
|
|
302
|
+
else { // restore to previous volume
|
|
303
|
+
if (typeof this.lastVolume !== 'undefined') {
|
|
304
|
+
this.volume = this.lastVolume;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (this.player === 'html5') {
|
|
309
|
+
this.media.muted = mute;
|
|
310
|
+
}
|
|
311
|
+
else if (this.player === 'jw' && this.jwPlayer) {
|
|
312
|
+
this.jwPlayer.setMute(mute);
|
|
313
|
+
}
|
|
314
|
+
else if (this.player === 'youtube') {
|
|
315
|
+
if (mute) {
|
|
316
|
+
this.youTubePlayer.mute();
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.youTubePlayer.unMute();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
this.refreshVolumeSlider(this.volume);
|
|
323
|
+
this.refreshVolumeButton(this.volume);
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
AblePlayer.prototype.setVolume = function (volume) {
|
|
327
|
+
|
|
328
|
+
// volume is 1 to 10
|
|
329
|
+
// convert as needed depending on player
|
|
330
|
+
|
|
331
|
+
if (this.player === 'html5') {
|
|
332
|
+
this.media.volume = volume / 10;
|
|
333
|
+
if (this.hasSignLanguage && this.signVideo) {
|
|
334
|
+
this.signVideo.volume = 0; // always mute
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else if (this.player === 'jw' && this.jwPlayer) {
|
|
338
|
+
this.jwPlayer.setVolume(volume * 10);
|
|
339
|
+
}
|
|
340
|
+
else if (this.player === 'youtube') {
|
|
341
|
+
this.youTubePlayer.setVolume(volume * 10);
|
|
342
|
+
this.volume = volume;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
this.lastVolume = volume;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
AblePlayer.prototype.getVolume = function (volume) {
|
|
349
|
+
|
|
350
|
+
// return volume using common audio control scale 1 to 10
|
|
351
|
+
|
|
352
|
+
if (this.player === 'html5') {
|
|
353
|
+
// uses 0 to 1 scale
|
|
354
|
+
return this.media.volume * 10;
|
|
355
|
+
}
|
|
356
|
+
else if (this.player === 'jw' && this.jwPlayer) {
|
|
357
|
+
// uses 0 to 100 scale
|
|
358
|
+
return this.jwPlayer.getVolume() / 10;
|
|
359
|
+
}
|
|
360
|
+
else if (this.player === 'youtube') {
|
|
361
|
+
// uses 0 to 100 scale
|
|
362
|
+
return this.youTubePlayer.getVolume() / 10;
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
AblePlayer.prototype.getVolumeName = function (volume) {
|
|
367
|
+
|
|
368
|
+
// returns 'mute','soft','medium', or 'loud' depending on volume level
|
|
369
|
+
if (volume == 0) {
|
|
370
|
+
return 'mute';
|
|
371
|
+
}
|
|
372
|
+
else if (volume == 10) {
|
|
373
|
+
return 'loud';
|
|
374
|
+
}
|
|
375
|
+
else if (volume < 5) {
|
|
376
|
+
return 'soft';
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
return 'medium';
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
})(jQuery);
|