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,440 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// JavaScript for Able Player
|
|
3
|
+
|
|
4
|
+
// HTML5 Media API:
|
|
5
|
+
// http://www.w3.org/TR/html5/embedded-content-0.html#htmlmediaelement
|
|
6
|
+
// http://dev.w3.org/html5/spec-author-view/video.html
|
|
7
|
+
|
|
8
|
+
// W3C API Test Page:
|
|
9
|
+
// http://www.w3.org/2010/05/video/mediaevents.html
|
|
10
|
+
|
|
11
|
+
// Uses JW Player as fallback
|
|
12
|
+
// JW Player configuration options:
|
|
13
|
+
// http://support.jwplayer.com/customer/portal/articles/1413113-configuration-options-reference
|
|
14
|
+
// (NOTE: some options are not documented, e.g., volume)
|
|
15
|
+
// JW Player 6 API reference:
|
|
16
|
+
// http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference
|
|
17
|
+
|
|
18
|
+
// YouTube Player API for iframe Embeds
|
|
19
|
+
https://developers.google.com/youtube/iframe_api_reference
|
|
20
|
+
// YouTube Player Parameters
|
|
21
|
+
https://developers.google.com/youtube/player_parameters?playerVersion=HTML5
|
|
22
|
+
|
|
23
|
+
// YouTube Data API
|
|
24
|
+
https://developers.google.com/youtube/v3
|
|
25
|
+
|
|
26
|
+
// Google API Client Library for JavaScript
|
|
27
|
+
https://developers.google.com/api-client-library/javascript/dev/dev_jscript
|
|
28
|
+
|
|
29
|
+
// Google API Explorer: YouTube services and methods
|
|
30
|
+
https://developers.google.com/apis-explorer/#s/youtube/v3/
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*jslint node: true, browser: true, white: true, indent: 2, unparam: true, plusplus: true */
|
|
34
|
+
/*global $, jQuery */
|
|
35
|
+
"use strict";
|
|
36
|
+
|
|
37
|
+
(function ($) {
|
|
38
|
+
$(document).ready(function () {
|
|
39
|
+
$('video, audio').each(function (index, element) {
|
|
40
|
+
if ($(element).data('able-player') !== undefined) {
|
|
41
|
+
new AblePlayer($(this),$(element));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// YouTube player support; pass ready event to jQuery so we can catch in player.
|
|
47
|
+
window.onYouTubeIframeAPIReady = function() {
|
|
48
|
+
AblePlayer.youtubeIframeAPIReady = true;
|
|
49
|
+
$('body').trigger('youtubeIframeAPIReady', []);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// If there is only one player on the page, dispatch global keydown events to it
|
|
53
|
+
// Otherwise, keydowwn events are handled locally (see event.js > handleEventListeners())
|
|
54
|
+
$(window).keydown(function(e) {
|
|
55
|
+
if (AblePlayer.nextIndex === 1) {
|
|
56
|
+
AblePlayer.lastCreated.onPlayerKeyPress(e);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Construct an AblePlayer object
|
|
61
|
+
// Parameters are:
|
|
62
|
+
// media - jQuery selector or element identifying the media.
|
|
63
|
+
window.AblePlayer = function(media) {
|
|
64
|
+
|
|
65
|
+
// Keep track of the last player created for use with global events.
|
|
66
|
+
AblePlayer.lastCreated = this;
|
|
67
|
+
|
|
68
|
+
this.media = media;
|
|
69
|
+
if ($(media).length === 0) {
|
|
70
|
+
this.provideFallback('ERROR: No media specified.');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
///////////////////////////////
|
|
75
|
+
//
|
|
76
|
+
// Default variables assignment
|
|
77
|
+
//
|
|
78
|
+
///////////////////////////////
|
|
79
|
+
|
|
80
|
+
// The following variables CAN be overridden with HTML attributes
|
|
81
|
+
|
|
82
|
+
// autoplay
|
|
83
|
+
if ($(media).attr('autoplay') !== undefined && $(media).attr('autoplay') !== "false") {
|
|
84
|
+
this.autoplay = true;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.autoplay = false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// loop (NOT FULLY SUPPORTED)
|
|
91
|
+
if ($(media).attr('loop') !== undefined && $(media).attr('loop') !== "false") {
|
|
92
|
+
this.loop = true;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.loop = false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// start-time
|
|
99
|
+
if ($(media).data('start-time') !== undefined && $(media).data('start-time') !== "") {
|
|
100
|
+
this.startTime = $(media).data('start-time');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.startTime = 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// debug
|
|
107
|
+
if ($(media).data('debug') !== undefined && $(media).data('debug') !== "false") {
|
|
108
|
+
this.debug = true;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.debug = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Path to root directory of Able Player code
|
|
115
|
+
if ($(media).data('root-path') !== undefined) {
|
|
116
|
+
// add a trailing slash if there is none
|
|
117
|
+
this.rootPath = $(media).data('root-path').replace(/\/?$/, '/');
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.rootPath = this.getRootPath();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Volume
|
|
124
|
+
// Range is 0 to 10. Best not to crank it to avoid overpowering screen readers
|
|
125
|
+
this.defaultVolume = 7;
|
|
126
|
+
if ($(media).data('volume') !== undefined && $(media).data('volume') !== "") {
|
|
127
|
+
var volume = $(media).data('volume');
|
|
128
|
+
if (volume >= 0 && volume <= 10) {
|
|
129
|
+
this.defaultVolume = volume;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
this.volume = this.defaultVolume;
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
// Optional Buttons
|
|
136
|
+
// Buttons are added to the player controller if relevant media is present
|
|
137
|
+
// However, in some applications it might be undesirable to show buttons
|
|
138
|
+
// (e.g., if chapters or transcripts are provided in an external container)
|
|
139
|
+
|
|
140
|
+
if ($(media).data('use-chapters-button') !== undefined && $(media).data('use-chapters-button') === false) {
|
|
141
|
+
this.useChaptersButton = false;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
this.useChaptersButton = true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if ($(media).data('use-descriptions-button') !== undefined && $(media).data('use-descriptions-button') === false) {
|
|
148
|
+
this.useDescriptionsButton = false;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
this.useDescriptionsButton = true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Transcripts
|
|
155
|
+
// There are three types of interactive transcripts.
|
|
156
|
+
// In descending of order of precedence (in case there are conflicting tags), they are:
|
|
157
|
+
// 1. "manual" - A manually coded external transcript (requires data-transcript-src)
|
|
158
|
+
// 2. "external" - Automatically generated, written to an external div (requires data-transcript-div)
|
|
159
|
+
// 3. "popup" - Automatically generated, written to a draggable, resizable popup window that can be toggled on/off with a button
|
|
160
|
+
// If data-include-transcript="false", there is no "popup" transcript
|
|
161
|
+
|
|
162
|
+
this.transcriptType = null;
|
|
163
|
+
if ($(media).data('transcript-src') !== undefined) {
|
|
164
|
+
this.transcriptSrc = $(media).data('transcript-src');
|
|
165
|
+
if (this.transcriptSrcHasRequiredParts()) {
|
|
166
|
+
this.transcriptType = 'manual';
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.transcriptType = null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (media.find('track[kind="captions"], track[kind="subtitles"]').length > 0) {
|
|
173
|
+
// required tracks are present. COULD automatically generate a transcript
|
|
174
|
+
if ($(media).data('transcript-div') !== undefined && $(media).data('transcript-div') !== "") {
|
|
175
|
+
this.transcriptDivLocation = $(media).data('transcript-div');
|
|
176
|
+
this.transcriptType = 'external';
|
|
177
|
+
}
|
|
178
|
+
else if ($(media).data('include-transcript') !== undefined) {
|
|
179
|
+
if ($(media).data('include-transcript') !== false) {
|
|
180
|
+
this.transcriptType = 'popup';
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
this.transcriptType = 'popup';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// In "Lyrics Mode", line breaks in WebVTT caption files are supported in the transcript
|
|
188
|
+
// If false (default), line breaks are are removed from transcripts in order to provide a more seamless reading experience
|
|
189
|
+
// If true, line breaks are preserved, so content can be presented karaoke-style, or as lines in a poem
|
|
190
|
+
|
|
191
|
+
if ($(media).data('lyrics-mode') !== undefined && $(media).data('lyrics-mode') !== "false") {
|
|
192
|
+
this.lyricsMode = true;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.lyricsMode = false;
|
|
196
|
+
}
|
|
197
|
+
// Transcript Title
|
|
198
|
+
if ($(media).data('transcript-title') !== undefined && $(media).data('transcript-title') !== "") {
|
|
199
|
+
this.transcriptTitle = $(media).data('transcript-title');
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
// do nothing. The default title will be defined later (see transcript.js)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Captions
|
|
206
|
+
// data-captions-position can be used to set the default captions position
|
|
207
|
+
// this is only the default, and can be overridden by user preferences
|
|
208
|
+
// valid values of data-captions-position are 'below' and 'overlay'
|
|
209
|
+
if ($(media).data('captions-position') === 'overlay') {
|
|
210
|
+
this.defaultCaptionsPosition = 'overlay';
|
|
211
|
+
}
|
|
212
|
+
else { // the default, even if not specified
|
|
213
|
+
this.defaultCaptionsPosition = 'below';
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Chapters
|
|
217
|
+
if ($(media).data('chapters-div') !== undefined && $(media).data('chapters-div') !== "") {
|
|
218
|
+
this.chaptersDivLocation = $(media).data('chapters-div');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if ($(media).data('chapters-title') !== undefined) {
|
|
222
|
+
// NOTE: empty string is valid; results in no title being displayed
|
|
223
|
+
this.chaptersTitle = $(media).data('chapters-title');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if ($(media).data('chapters-default') !== undefined && $(media).data('chapters-default') !== "") {
|
|
227
|
+
this.defaultChapter = $(media).data('chapters-default');
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
this.defaultChapter = null;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Previous/Next buttons
|
|
234
|
+
// valid values of data-prevnext-unit are 'playlist' and 'chapter'; will also accept 'chapters'
|
|
235
|
+
if ($(media).data('prevnext-unit') === 'chapter' || $(media).data('prevnext-unit') === 'chapters') {
|
|
236
|
+
this.prevNextUnit = 'chapter';
|
|
237
|
+
}
|
|
238
|
+
else if ($(media).data('prevnext-unit') === 'playlist') {
|
|
239
|
+
this.prevNextUnit = 'playlist';
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
this.prevNextUnit = false;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Slower/Faster buttons
|
|
246
|
+
// valid values of data-speed-icons are 'arrows' (default) and 'animals'
|
|
247
|
+
// use 'animals' to use turtle and rabbit
|
|
248
|
+
if ($(media).data('speed-icons') === 'animals') {
|
|
249
|
+
this.speedIcons = 'animals';
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
this.speedIcons = 'arrows';
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Seekbar
|
|
256
|
+
// valid values of data-seekbar-scope are 'chapter' and 'video'; will also accept 'chapters'
|
|
257
|
+
if ($(media).data('seekbar-scope') === 'chapter' || $(media).data('seekbar-scope') === 'chapters') {
|
|
258
|
+
this.seekbarScope = 'chapter';
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
this.seekbarScope = 'video';
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// YouTube
|
|
265
|
+
if ($(media).data('youtube-id') !== undefined && $(media).data('youtube-id') !== "") {
|
|
266
|
+
this.youTubeId = $(media).data('youtube-id');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if ($(media).data('youtube-desc-id') !== undefined && $(media).data('youtube-desc-id') !== "") {
|
|
270
|
+
this.youTubeDescId = $(media).data('youtube-desc-id');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Icon type
|
|
274
|
+
// By default, AblePlayer uses scalable icomoon fonts for the player controls
|
|
275
|
+
// and falls back to images if the user has a custom style sheet that overrides font-family
|
|
276
|
+
// use data-icon-type to force controls to use either 'font', 'images' or 'svg'
|
|
277
|
+
this.iconType = 'font';
|
|
278
|
+
this.forceIconType = false;
|
|
279
|
+
if ($(media).data('icon-type') !== undefined && $(media).data('icon-type') !== "") {
|
|
280
|
+
var iconType = $(media).data('icon-type');
|
|
281
|
+
if (iconType === 'font' || iconType == 'image' || iconType == 'svg') {
|
|
282
|
+
this.iconType = iconType;
|
|
283
|
+
this.forceIconType = true;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if ($(media).data('allow-fullscreen') !== undefined && $(media).data('allow-fullscreen') === false) {
|
|
288
|
+
this.allowFullScreen = false;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this.allowFullScreen = true;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Seek interval
|
|
295
|
+
// Number of seconds to seek forward or back with Rewind & Forward buttons
|
|
296
|
+
// Unless specified with data-seek-interval, the default value is re-calculated in initialize.js > setSeekInterval();
|
|
297
|
+
// Calculation attempts to intelligently assign a reasonable interval based on media length
|
|
298
|
+
this.defaultSeekInterval = 10;
|
|
299
|
+
this.useFixedSeekInterval = false;
|
|
300
|
+
if ($(media).data('seek-interval') !== undefined && $(media).data('seek-interval') !== "") {
|
|
301
|
+
var seekInterval = $(media).data('seek-interval');
|
|
302
|
+
if (/^[1-9][0-9]*$/.test(seekInterval)) { // must be a whole number greater than 0
|
|
303
|
+
this.seekInterval = seekInterval;
|
|
304
|
+
this.useFixedSeekInterval = true; // do not override with calculuation
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Now Playing
|
|
309
|
+
// Shows "Now Playing:" plus the title of the current track above player
|
|
310
|
+
// Only used if there is a playlist
|
|
311
|
+
if ($(media).data('show-now-playing') !== undefined && $(media).data('show-now-playing') === "false") {
|
|
312
|
+
this.showNowPlaying = false;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
this.showNowPlaying = true;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Fallback Player
|
|
319
|
+
// The only supported fallback is JW Player, licensed separately
|
|
320
|
+
// JW Player files must be included in folder specified in this.fallbackPath
|
|
321
|
+
// JW Player will be loaded as needed in browsers that don't support HTML5 media
|
|
322
|
+
// NOTE: As of 2.3.44, NO FALLBACK is used unless data-fallback='jw'
|
|
323
|
+
|
|
324
|
+
this.fallback = null;
|
|
325
|
+
this.fallbackPath = null;
|
|
326
|
+
this.testFallback = false;
|
|
327
|
+
|
|
328
|
+
if ($(media).data('fallback') !== undefined && $(media).data('fallback') !== "") {
|
|
329
|
+
var fallback = $(media).data('fallback');
|
|
330
|
+
if (fallback === 'jw') {
|
|
331
|
+
this.fallback = fallback;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (this.fallback === 'jw') {
|
|
336
|
+
|
|
337
|
+
if ($(media).data('fallback-path') !== undefined && $(media).data('fallback-path') !== "false") {
|
|
338
|
+
this.fallbackPath = $(media).data('fallback-path');
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
this.fallbackPath = this.rootPath + 'thirdparty/';
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if ($(media).data('test-fallback') !== undefined && $(media).data('test-fallback') !== "false") {
|
|
345
|
+
this.testFallback = true;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Language
|
|
350
|
+
this.lang = 'en';
|
|
351
|
+
if ($(media).data('lang') !== undefined && $(media).data('lang') !== "") {
|
|
352
|
+
var lang = $(media).data('lang');
|
|
353
|
+
if (lang.length == 2) {
|
|
354
|
+
this.lang = lang;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// Player language is determined as follows:
|
|
358
|
+
// 1. Lang attributes on <html> or <body>, if a matching translation file is available
|
|
359
|
+
// 2. The value of this.lang, if a matching translation file is available
|
|
360
|
+
// 3. English
|
|
361
|
+
// To override this formula and force #2 to take precedence over #1, set data-force-lang="true"
|
|
362
|
+
if ($(media).data('force-lang') !== undefined && $(media).data('force-lang') !== "false") {
|
|
363
|
+
this.forceLang = true;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
this.forceLang = false;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Metadata Tracks
|
|
370
|
+
if ($(media).data('meta-type') !== undefined && $(media).data('meta-type') !== "") {
|
|
371
|
+
this.metaType = $(media).data('meta-type');
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if ($(media).data('meta-div') !== undefined && $(media).data('meta-div') !== "") {
|
|
375
|
+
this.metaDiv = $(media).data('meta-div');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Search
|
|
379
|
+
if ($(media).data('search') !== undefined && $(media).data('search') !== "") {
|
|
380
|
+
// conducting a search currently requires an external div in which to write the results
|
|
381
|
+
if ($(media).data('search-div') !== undefined && $(media).data('search-div') !== "") {
|
|
382
|
+
this.searchString = $(media).data('search');
|
|
383
|
+
this.searchDiv = $(media).data('search-div');
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Define built-in variables that CANNOT be overridden with HTML attributes
|
|
388
|
+
this.setDefaults();
|
|
389
|
+
|
|
390
|
+
////////////////////////////////////////
|
|
391
|
+
//
|
|
392
|
+
// End assignment of default variables
|
|
393
|
+
//
|
|
394
|
+
////////////////////////////////////////
|
|
395
|
+
|
|
396
|
+
this.ableIndex = AblePlayer.nextIndex;
|
|
397
|
+
AblePlayer.nextIndex += 1;
|
|
398
|
+
|
|
399
|
+
this.title = $(media).attr('title');
|
|
400
|
+
|
|
401
|
+
// populate translation object with localized versions of all labels and prompts
|
|
402
|
+
// use defer method to defer additional processing until text is retrieved
|
|
403
|
+
this.tt = {};
|
|
404
|
+
var thisObj = this;
|
|
405
|
+
$.when(this.getTranslationText()).then(
|
|
406
|
+
function () {
|
|
407
|
+
if (thisObj.countProperties(thisObj.tt) > 50) {
|
|
408
|
+
// close enough to ensure that most text variables are populated
|
|
409
|
+
thisObj.setup();
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
// can't continue loading player with no text
|
|
413
|
+
thisObj.provideFallback('ERROR: Failed to load translation table');
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
// Index to increment every time new player is created.
|
|
420
|
+
AblePlayer.nextIndex = 0;
|
|
421
|
+
|
|
422
|
+
AblePlayer.prototype.setup = function() {
|
|
423
|
+
|
|
424
|
+
var thisObj = this;
|
|
425
|
+
this.reinitialize().then(function () {
|
|
426
|
+
if (!thisObj.player) {
|
|
427
|
+
// No player for this media, show last-line fallback.
|
|
428
|
+
thisObj.provideFallback('Unable to play media');
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
thisObj.setupInstance().then(function () {
|
|
432
|
+
thisObj.recreatePlayer();
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
AblePlayer.youtubeIframeAPIReady = false;
|
|
439
|
+
AblePlayer.loadingYoutubeIframeAPI = false;
|
|
440
|
+
})(jQuery);
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
(function ($) {
|
|
2
|
+
|
|
3
|
+
AblePlayer.prototype.getUserAgent = function() {
|
|
4
|
+
|
|
5
|
+
// Whenever possible we avoid browser sniffing. Better to do feature detection.
|
|
6
|
+
// However, in case it's needed...
|
|
7
|
+
// this function defines a userAgent array that can be used to query for common browsers and OSs
|
|
8
|
+
// NOTE: This would be much simpler with jQuery.browser but that was removed from jQuery 1.9
|
|
9
|
+
// http://api.jquery.com/jQuery.browser/
|
|
10
|
+
this.userAgent = {};
|
|
11
|
+
this.userAgent.browser = {};
|
|
12
|
+
|
|
13
|
+
// Test for common browsers
|
|
14
|
+
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
|
|
15
|
+
this.userAgent.browser.name = 'Firefox';
|
|
16
|
+
this.userAgent.browser.version = RegExp.$1; // capture x.x portion
|
|
17
|
+
}
|
|
18
|
+
else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x (IE10 or lower)
|
|
19
|
+
this.userAgent.browser.name = 'Internet Explorer';
|
|
20
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
21
|
+
}
|
|
22
|
+
else if (/Trident.*rv[ :]*(\d+\.\d+)/.test(navigator.userAgent)) { // test for IE11 or higher
|
|
23
|
+
this.userAgent.browser.name = 'Internet Explorer';
|
|
24
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
25
|
+
}
|
|
26
|
+
else if (/Edge[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { // test for MS Edge
|
|
27
|
+
this.userAgent.browser.name = 'Edge';
|
|
28
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
29
|
+
}
|
|
30
|
+
else if (/OPR\/(\d+\.\d+)/i.test(navigator.userAgent)) { // Opera 15 or over
|
|
31
|
+
this.userAgent.browser.name = 'Opera';
|
|
32
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
33
|
+
}
|
|
34
|
+
else if (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)) {
|
|
35
|
+
this.userAgent.browser.name = 'Chrome';
|
|
36
|
+
if (/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
|
|
37
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (/Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor)) {
|
|
41
|
+
this.userAgent.browser.name = 'Safari';
|
|
42
|
+
if (/Version[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
|
|
43
|
+
this.userAgent.browser.version = RegExp.$1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.userAgent.browser.name = 'Unknown';
|
|
48
|
+
this.userAgent.browser.version = 'Unknown';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Now test for common operating systems
|
|
52
|
+
if (window.navigator.userAgent.indexOf("Windows NT 6.2") != -1) {
|
|
53
|
+
this.userAgent.os = "Windows 8";
|
|
54
|
+
}
|
|
55
|
+
else if (window.navigator.userAgent.indexOf("Windows NT 6.1") != -1) {
|
|
56
|
+
this.userAgent.os = "Windows 7";
|
|
57
|
+
}
|
|
58
|
+
else if (window.navigator.userAgent.indexOf("Windows NT 6.0") != -1) {
|
|
59
|
+
this.userAgent.os = "Windows Vista";
|
|
60
|
+
}
|
|
61
|
+
else if (window.navigator.userAgent.indexOf("Windows NT 5.1") != -1) {
|
|
62
|
+
this.userAgent.os = "Windows XP";
|
|
63
|
+
}
|
|
64
|
+
else if (window.navigator.userAgent.indexOf("Windows NT 5.0") != -1) {
|
|
65
|
+
this.userAgent.os = "Windows 2000";
|
|
66
|
+
}
|
|
67
|
+
else if (window.navigator.userAgent.indexOf("Mac")!=-1) {
|
|
68
|
+
this.userAgent.os = "Mac/iOS";
|
|
69
|
+
}
|
|
70
|
+
else if (window.navigator.userAgent.indexOf("X11")!=-1) {
|
|
71
|
+
this.userAgent.os = "UNIX";
|
|
72
|
+
}
|
|
73
|
+
else if (window.navigator.userAgent.indexOf("Linux")!=-1) {
|
|
74
|
+
this.userAgent.os = "Linux";
|
|
75
|
+
}
|
|
76
|
+
if (this.debug) {
|
|
77
|
+
console.log('User agent:' + navigator.userAgent);
|
|
78
|
+
console.log('Vendor: ' + navigator.vendor);
|
|
79
|
+
console.log('Browser: ' + this.userAgent.browser.name);
|
|
80
|
+
console.log('Version: ' + this.userAgent.browser.version);
|
|
81
|
+
console.log('OS: ' + this.userAgent.os);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
AblePlayer.prototype.isUserAgent = function(which) {
|
|
86
|
+
var userAgent = navigator.userAgent.toLowerCase();
|
|
87
|
+
if (this.debug) {
|
|
88
|
+
console.log('User agent: ' + userAgent);
|
|
89
|
+
}
|
|
90
|
+
if (userAgent.indexOf(which.toLowerCase()) !== -1) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
AblePlayer.prototype.isIOS = function(version) {
|
|
99
|
+
// return true if this is IOS
|
|
100
|
+
// if version is provided check for a particular version
|
|
101
|
+
|
|
102
|
+
var userAgent, iOS;
|
|
103
|
+
|
|
104
|
+
userAgent = navigator.userAgent.toLowerCase();
|
|
105
|
+
iOS = /ipad|iphone|ipod/.exec(userAgent);
|
|
106
|
+
if (iOS) {
|
|
107
|
+
if (typeof version !== 'undefined') {
|
|
108
|
+
if (userAgent.indexOf('os ' + version) !== -1) {
|
|
109
|
+
// this is the target version of iOS
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
// no version was specified
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// this is not IOS
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
AblePlayer.prototype.browserSupportsVolume = function() {
|
|
128
|
+
// ideally we could test for volume support
|
|
129
|
+
// However, that doesn't seem to be reliable
|
|
130
|
+
// http://stackoverflow.com/questions/12301435/html5-video-tag-volume-support
|
|
131
|
+
|
|
132
|
+
var userAgent, noVolume;
|
|
133
|
+
|
|
134
|
+
userAgent = navigator.userAgent.toLowerCase();
|
|
135
|
+
noVolume = /ipad|iphone|ipod|android|blackberry|windows ce|windows phone|webos|playbook/.exec(userAgent);
|
|
136
|
+
if (noVolume) {
|
|
137
|
+
if (noVolume[0] === 'android' && /firefox/.test(userAgent)) {
|
|
138
|
+
// Firefox on android DOES support changing the volume:
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// as far as we know, this userAgent supports volume control
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
AblePlayer.prototype.nativeFullscreenSupported = function () {
|
|
152
|
+
if (this.player === 'jw') {
|
|
153
|
+
// JW player flash has problems with native fullscreen.
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
return document.fullscreenEnabled ||
|
|
157
|
+
document.webkitFullscreenEnabled ||
|
|
158
|
+
document.mozFullScreenEnabled ||
|
|
159
|
+
document.msFullscreenEnabled;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
})(jQuery);
|