wai-website-theme 1.2 → 1.3
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 +4 -4
- data/_includes/backtotop.html +1 -1
- data/_includes/excol.html +1 -1
- data/_includes/feedback-box.html +13 -10
- data/_includes/footer.html +20 -6
- data/_includes/header.html +73 -35
- data/_includes/inpl.html +6 -0
- data/_includes/lang.html +7 -0
- data/_includes/link.html +92 -0
- data/_includes/menuitem.html +5 -3
- data/_includes/multilang-list-policy-links.html +1 -1
- data/_includes/navlist.html +1 -1
- data/_includes/prevnext.html +5 -4
- data/_includes/secondarynav.html +34 -6
- data/_includes/t.html +33 -0
- data/_includes/translation-note-msg.html +45 -0
- data/_includes/video-player.html +50 -9
- data/_layouts/default.html +32 -9
- data/_layouts/home.html +29 -5
- data/_layouts/news.html +27 -6
- data/_layouts/policy.html +27 -6
- data/_layouts/sidenav.html +27 -6
- data/_layouts/sidenavsidebar.html +27 -6
- data/assets/ableplayer/.gitattributes +0 -0
- data/assets/ableplayer/.gitignore +3 -1
- data/assets/ableplayer/Gruntfile.js +3 -1
- data/assets/ableplayer/LICENSE +0 -0
- data/assets/ableplayer/README.md +214 -170
- data/assets/ableplayer/_config.yml +1 -0
- data/assets/ableplayer/build/ableplayer.dist.js +2637 -744
- data/assets/ableplayer/build/ableplayer.js +2637 -744
- data/assets/ableplayer/build/ableplayer.min.css +2 -2
- data/assets/ableplayer/build/ableplayer.min.js +9 -7
- data/assets/ableplayer/button-icons/able-icons.svg +0 -0
- data/assets/ableplayer/button-icons/black/rabbit.png +0 -0
- data/assets/ableplayer/button-icons/black/turtle.png +0 -0
- data/assets/ableplayer/button-icons/white/rabbit.png +0 -0
- data/assets/ableplayer/button-icons/white/turtle.png +0 -0
- data/assets/ableplayer/images/wingrip.png +0 -0
- data/assets/ableplayer/package-lock.json +705 -0
- data/assets/ableplayer/package.json +11 -2
- data/assets/ableplayer/scripts/JQuery.doWhen.js +0 -0
- data/assets/ableplayer/scripts/ableplayer-base.js +129 -29
- data/assets/ableplayer/scripts/browser.js +0 -0
- data/assets/ableplayer/scripts/buildplayer.js +342 -262
- data/assets/ableplayer/scripts/caption.js +19 -0
- data/assets/ableplayer/scripts/chapters.js +21 -0
- data/assets/ableplayer/scripts/control.js +139 -56
- data/assets/ableplayer/scripts/description.js +0 -0
- data/assets/ableplayer/scripts/dialog.js +13 -13
- data/assets/ableplayer/scripts/dragdrop.js +102 -109
- data/assets/ableplayer/scripts/event.js +186 -83
- data/assets/ableplayer/scripts/initialize.js +261 -71
- data/assets/ableplayer/scripts/langs.js +4 -0
- data/assets/ableplayer/scripts/metadata.js +0 -0
- data/assets/ableplayer/scripts/misc.js +76 -7
- data/assets/ableplayer/scripts/preference.js +2 -2
- data/assets/ableplayer/scripts/search.js +10 -7
- data/assets/ableplayer/scripts/sign.js +0 -0
- data/assets/ableplayer/scripts/slider.js +35 -34
- data/assets/ableplayer/scripts/track.js +38 -22
- data/assets/ableplayer/scripts/transcript.js +15 -6
- data/assets/ableplayer/scripts/translation.js +29 -20
- data/assets/ableplayer/scripts/ttml2webvtt.js +87 -0
- data/assets/ableplayer/scripts/volume.js +16 -15
- data/assets/ableplayer/scripts/vts.js +1093 -0
- data/assets/ableplayer/scripts/webvtt.js +0 -0
- data/assets/ableplayer/scripts/youtube.js +16 -5
- data/assets/ableplayer/styles/ableplayer.css +125 -22
- data/assets/ableplayer/thirdparty/js.cookie.js +0 -0
- data/assets/ableplayer/thirdparty/modernizr.custom.js +0 -0
- data/assets/ableplayer/translations/ca.js +311 -1
- data/assets/ableplayer/translations/de.js +1 -1
- data/assets/ableplayer/translations/en.js +6 -0
- data/assets/ableplayer/translations/es.js +6 -0
- data/assets/ableplayer/translations/fr.js +6 -0
- data/assets/ableplayer/translations/he.js +311 -0
- data/assets/ableplayer/translations/it.js +7 -1
- data/assets/ableplayer/translations/ja.js +6 -0
- data/assets/ableplayer/translations/nb.js +311 -0
- data/assets/ableplayer/translations/nl.js +6 -0
- data/assets/ableplayer/translations/zh-tw.js +311 -0
- data/assets/css/style.css +1 -1
- data/assets/css/style.css.map +1 -1
- data/assets/fonts/{anonymouspro-bold.woff → anonymouspro/anonymouspro-bold.woff} +0 -0
- data/assets/fonts/{anonymouspro-bold.woff2 → anonymouspro/anonymouspro-bold.woff2} +0 -0
- data/assets/fonts/{anonymouspro-bolditalic.woff → anonymouspro/anonymouspro-bolditalic.woff} +0 -0
- data/assets/fonts/{anonymouspro-bolditalic.woff2 → anonymouspro/anonymouspro-bolditalic.woff2} +0 -0
- data/assets/fonts/{anonymouspro-italic.woff → anonymouspro/anonymouspro-italic.woff} +0 -0
- data/assets/fonts/{anonymouspro-italic.woff2 → anonymouspro/anonymouspro-italic.woff2} +0 -0
- data/assets/fonts/{anonymouspro-regular.woff → anonymouspro/anonymouspro-regular.woff} +0 -0
- data/assets/fonts/{anonymouspro-regular.woff2 → anonymouspro/anonymouspro-regular.woff2} +0 -0
- data/assets/fonts/notonaskh/bold-minimal.woff +0 -0
- data/assets/fonts/notonaskh/bold-minimal.woff2 +0 -0
- data/assets/fonts/notonaskh/bold.woff +0 -0
- data/assets/fonts/notonaskh/bold.woff2 +0 -0
- data/assets/fonts/notonaskh/regular-minimal.woff +0 -0
- data/assets/fonts/notonaskh/regular-minimal.woff2 +0 -0
- data/assets/fonts/notonaskh/regular.woff +0 -0
- data/assets/fonts/notonaskh/regular.woff2 +0 -0
- data/assets/fonts/{notosans-bold-subset.woff → notosans/notosans-bold-subset.woff} +0 -0
- data/assets/fonts/{notosans-bold-subset.woff2 → notosans/notosans-bold-subset.woff2} +0 -0
- data/assets/fonts/{notosans-bold.woff → notosans/notosans-bold.woff} +0 -0
- data/assets/fonts/{notosans-bold.woff2 → notosans/notosans-bold.woff2} +0 -0
- data/assets/fonts/{notosans-bolditalic-subset.woff → notosans/notosans-bolditalic-subset.woff} +0 -0
- data/assets/fonts/{notosans-bolditalic-subset.woff2 → notosans/notosans-bolditalic-subset.woff2} +0 -0
- data/assets/fonts/{notosans-bolditalic.woff → notosans/notosans-bolditalic.woff} +0 -0
- data/assets/fonts/{notosans-bolditalic.woff2 → notosans/notosans-bolditalic.woff2} +0 -0
- data/assets/fonts/{notosans-italic-subset.woff → notosans/notosans-italic-subset.woff} +0 -0
- data/assets/fonts/{notosans-italic-subset.woff2 → notosans/notosans-italic-subset.woff2} +0 -0
- data/assets/fonts/{notosans-italic.woff → notosans/notosans-italic.woff} +0 -0
- data/assets/fonts/{notosans-italic.woff2 → notosans/notosans-italic.woff2} +0 -0
- data/assets/fonts/{notosans-regular-subset.woff → notosans/notosans-regular-subset.woff} +0 -0
- data/assets/fonts/{notosans-regular-subset.woff2 → notosans/notosans-regular-subset.woff2} +0 -0
- data/assets/fonts/{notosans-regular.woff → notosans/notosans-regular.woff} +0 -0
- data/assets/fonts/{notosans-regular.woff2 → notosans/notosans-regular.woff2} +0 -0
- data/assets/fonts/notosansmono/notosansmono-semicondensed.woff +0 -0
- data/assets/fonts/notosansmono/notosansmono-semicondensed.woff2 +0 -0
- data/assets/fonts/notosansmono/notosansmono-semicondensedbold.woff +0 -0
- data/assets/fonts/notosansmono/notosansmono-semicondensedbold.woff2 +0 -0
- data/assets/images/icons.svg +24 -0
- data/assets/scripts/main.js +10 -3
- metadata +66 -33
- data/_data/lang.json +0 -730
- data/_data/techniques.yml +0 -180
- data/_data/wcag.yml +0 -125
- data/_includes/.DS_Store +0 -0
|
File without changes
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
AblePlayer.prototype.countProperties = function(obj) {
|
|
37
|
+
|
|
37
38
|
// returns the number of properties in an object
|
|
38
39
|
var count, prop;
|
|
39
40
|
count = 0;
|
|
@@ -45,12 +46,35 @@
|
|
|
45
46
|
return count;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
AblePlayer.prototype.formatSecondsAsColonTime = function (seconds, showFullTime) {
|
|
50
|
+
|
|
51
|
+
// Takes seconds and converts to string of form hh:mm:ss
|
|
52
|
+
// If showFullTime is true, shows 00 for hours if time is less than an hour
|
|
53
|
+
// and show milliseconds (e.g., 00:00:04.123 as in Video Track Sorter)
|
|
54
|
+
// Otherwise, omits empty hours and milliseconds (e.g., 00:04 as in timer on controller)
|
|
55
|
+
|
|
56
|
+
var dHours, dMinutes, dSeconds,
|
|
57
|
+
parts, milliSeconds, numShort, i;
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
if (showFullTime) {
|
|
60
|
+
// preserve milliseconds, if included in seconds
|
|
61
|
+
parts = seconds.toString().split('.');
|
|
62
|
+
if (parts.length === 2) {
|
|
63
|
+
milliSeconds = parts[1];
|
|
64
|
+
if (milliSeconds.length < 3) {
|
|
65
|
+
numShort = 3 - milliSeconds.length;
|
|
66
|
+
for (i=1; i <= numShort; i++) {
|
|
67
|
+
milliSeconds += '0';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
milliSeconds = '000';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
dHours = Math.floor(seconds / 3600);
|
|
76
|
+
dMinutes = Math.floor(seconds / 60) % 60;
|
|
77
|
+
dSeconds = Math.floor(seconds % 60);
|
|
54
78
|
if (dSeconds < 10) {
|
|
55
79
|
dSeconds = '0' + dSeconds;
|
|
56
80
|
}
|
|
@@ -58,10 +82,55 @@
|
|
|
58
82
|
if (dMinutes < 10) {
|
|
59
83
|
dMinutes = '0' + dMinutes;
|
|
60
84
|
}
|
|
61
|
-
|
|
85
|
+
if (showFullTime) {
|
|
86
|
+
return dHours + ':' + dMinutes + ':' + dSeconds + '.' + milliSeconds;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return dHours + ':' + dMinutes + ':' + dSeconds;
|
|
90
|
+
}
|
|
62
91
|
}
|
|
63
92
|
else {
|
|
64
|
-
|
|
93
|
+
if (showFullTime) {
|
|
94
|
+
if (dHours < 1) {
|
|
95
|
+
dHours = '00';
|
|
96
|
+
}
|
|
97
|
+
else if (dHours < 10) {
|
|
98
|
+
dHours = '0' + dHours;
|
|
99
|
+
}
|
|
100
|
+
if (dMinutes < 1) {
|
|
101
|
+
dMinutes = '00';
|
|
102
|
+
}
|
|
103
|
+
else if (dMinutes < 10) {
|
|
104
|
+
dMinutes = '0' + dMinutes;
|
|
105
|
+
}
|
|
106
|
+
return dHours + ':' + dMinutes + ':' + dSeconds + '.' + milliSeconds;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return dMinutes + ':' + dSeconds;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
AblePlayer.prototype.getSecondsFromColonTime = function (timeStr) {
|
|
115
|
+
|
|
116
|
+
// Converts string of form hh:mm:ss to seconds
|
|
117
|
+
var timeParts, hours, minutes, seconds, newTime;
|
|
118
|
+
|
|
119
|
+
timeParts = timeStr.split(':');
|
|
120
|
+
if (timeParts.length === 3) {
|
|
121
|
+
hours = parseInt(timeParts[0]);
|
|
122
|
+
minutes = parseInt(timeParts[1]);
|
|
123
|
+
seconds = parseFloat(timeParts[2]);
|
|
124
|
+
return ((hours * 3600) + (minutes * 60) + (seconds));
|
|
125
|
+
}
|
|
126
|
+
else if (timeParts.length === 2) {
|
|
127
|
+
minutes = parseInt(timeParts[0]);
|
|
128
|
+
seconds = parseFloat(timeParts[1]);
|
|
129
|
+
return ((minutes * 60) + (seconds));
|
|
130
|
+
}
|
|
131
|
+
else if (timeParts.length === 1) {
|
|
132
|
+
seconds = parseFloat(timeParts[0]);
|
|
133
|
+
return seconds;
|
|
65
134
|
}
|
|
66
135
|
};
|
|
67
136
|
|
|
@@ -721,8 +721,8 @@
|
|
|
721
721
|
thisObj.resetPrefsForm();
|
|
722
722
|
})
|
|
723
723
|
// Add handler for escape key
|
|
724
|
-
$('div.able-prefs-form').keydown(function(
|
|
725
|
-
if (
|
|
724
|
+
$('div.able-prefs-form').keydown(function(e) {
|
|
725
|
+
if (e.which === 27) { // escape
|
|
726
726
|
thisObj.resetPrefsForm();
|
|
727
727
|
}
|
|
728
728
|
});
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
});
|
|
37
37
|
itemStartSpan.text(itemStartTime['value']);
|
|
38
38
|
// add a listener for clisk on itemStart
|
|
39
|
-
itemStartSpan.click(function(
|
|
39
|
+
itemStartSpan.click(function(e) {
|
|
40
40
|
var spanStart = parseFloat($(this).attr('data-start'));
|
|
41
41
|
// Add a tiny amount so that we're inside the span.
|
|
42
42
|
spanStart += .01;
|
|
@@ -64,16 +64,19 @@
|
|
|
64
64
|
AblePlayer.prototype.searchFor = function(searchString) {
|
|
65
65
|
|
|
66
66
|
// return chronological array of caption cues that match searchTerms
|
|
67
|
-
|
|
68
67
|
var captionLang, captions, results, caption, c, i, j;
|
|
69
|
-
|
|
68
|
+
results = [];
|
|
70
69
|
// split searchTerms into an array
|
|
71
70
|
var searchTerms = searchString.split(' ');
|
|
72
71
|
if (this.captions.length > 0) {
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
// Get caption track that matches this.searchLang
|
|
73
|
+
for (i=0; i < this.captions.length; i++) {
|
|
74
|
+
if (this.captions[i].language === this.searchLang) {
|
|
75
|
+
captionLang = this.searchLang;
|
|
76
|
+
captions = this.captions[i].cues;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
75
79
|
if (captions.length > 0) {
|
|
76
|
-
var results = [];
|
|
77
80
|
c = 0;
|
|
78
81
|
for (i = 0; i < captions.length; i++) {
|
|
79
82
|
if ($.inArray(captions[i].components.children[0]['type'], ['string','i','b','u','v','c']) !== -1) {
|
|
@@ -82,6 +85,7 @@
|
|
|
82
85
|
if (caption.indexOf(searchTerms[j]) !== -1) {
|
|
83
86
|
results[c] = [];
|
|
84
87
|
results[c]['start'] = captions[i].start;
|
|
88
|
+
results[c]['lang'] = captionLang;
|
|
85
89
|
results[c]['caption'] = this.highlightSearchTerm(searchTerms,j,caption);
|
|
86
90
|
c++;
|
|
87
91
|
break;
|
|
@@ -91,7 +95,6 @@
|
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
|
-
|
|
95
98
|
return results;
|
|
96
99
|
};
|
|
97
100
|
|
|
File without changes
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
this.timeTooltip.attr('role', 'tooltip');
|
|
69
69
|
this.timeTooltip.addClass('able-tooltip');
|
|
70
|
+
this.timeTooltip.hide();
|
|
70
71
|
|
|
71
72
|
this.bodyDiv.append(this.loadedDiv);
|
|
72
73
|
this.bodyDiv.append(this.playedDiv);
|
|
@@ -95,30 +96,30 @@
|
|
|
95
96
|
this.setDuration(max);
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
this.seekHead.hover(function (
|
|
99
|
+
this.seekHead.hover(function (e) {
|
|
99
100
|
thisObj.overHead = true;
|
|
100
101
|
thisObj.refreshTooltip();
|
|
101
|
-
}, function (
|
|
102
|
+
}, function (e) {
|
|
102
103
|
thisObj.overHead = false;
|
|
103
104
|
|
|
104
105
|
if (!thisObj.overBody && thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
105
|
-
thisObj.stopTracking(thisObj.pageXToPosition(
|
|
106
|
+
thisObj.stopTracking(thisObj.pageXToPosition(e.pageX));
|
|
106
107
|
}
|
|
107
108
|
thisObj.refreshTooltip();
|
|
108
109
|
});
|
|
109
110
|
|
|
110
|
-
this.seekHead.mousemove(function (
|
|
111
|
+
this.seekHead.mousemove(function (e) {
|
|
111
112
|
if (thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
112
|
-
thisObj.trackHeadAtPageX(
|
|
113
|
+
thisObj.trackHeadAtPageX(e.pageX);
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
|
|
116
|
-
this.seekHead.focus(function (
|
|
117
|
+
this.seekHead.focus(function (e) {
|
|
117
118
|
thisObj.overHead = true;
|
|
118
119
|
thisObj.refreshTooltip();
|
|
119
120
|
});
|
|
120
121
|
|
|
121
|
-
this.seekHead.blur(function (
|
|
122
|
+
this.seekHead.blur(function (e) {
|
|
122
123
|
thisObj.overHead = false;
|
|
123
124
|
thisObj.refreshTooltip();
|
|
124
125
|
});
|
|
@@ -126,94 +127,94 @@
|
|
|
126
127
|
this.bodyDiv.hover(function () {
|
|
127
128
|
thisObj.overBody = true;
|
|
128
129
|
thisObj.refreshTooltip();
|
|
129
|
-
}, function (
|
|
130
|
+
}, function (e) {
|
|
130
131
|
thisObj.overBody = false;
|
|
131
132
|
thisObj.overBodyMousePos = null;
|
|
132
133
|
thisObj.refreshTooltip();
|
|
133
134
|
|
|
134
135
|
if (!thisObj.overHead && thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
135
|
-
thisObj.stopTracking(thisObj.pageXToPosition(
|
|
136
|
+
thisObj.stopTracking(thisObj.pageXToPosition(e.pageX));
|
|
136
137
|
}
|
|
137
138
|
});
|
|
138
139
|
|
|
139
|
-
this.bodyDiv.mousemove(function (
|
|
140
|
+
this.bodyDiv.mousemove(function (e) {
|
|
140
141
|
thisObj.overBodyMousePos = {
|
|
141
|
-
x:
|
|
142
|
-
y:
|
|
142
|
+
x: e.pageX,
|
|
143
|
+
y: e.pageY
|
|
143
144
|
};
|
|
144
145
|
if (thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
145
|
-
thisObj.trackHeadAtPageX(
|
|
146
|
+
thisObj.trackHeadAtPageX(e.pageX);
|
|
146
147
|
}
|
|
147
148
|
thisObj.refreshTooltip();
|
|
148
149
|
});
|
|
149
150
|
|
|
150
|
-
this.bodyDiv.mousedown(function (
|
|
151
|
-
thisObj.startTracking('mouse', thisObj.pageXToPosition(
|
|
152
|
-
thisObj.trackHeadAtPageX(
|
|
151
|
+
this.bodyDiv.mousedown(function (e) {
|
|
152
|
+
thisObj.startTracking('mouse', thisObj.pageXToPosition(e.pageX));
|
|
153
|
+
thisObj.trackHeadAtPageX(e.pageX);
|
|
153
154
|
if (!thisObj.seekHead.is(':focus')) {
|
|
154
155
|
thisObj.seekHead.focus();
|
|
155
156
|
}
|
|
156
|
-
|
|
157
|
+
e.preventDefault();
|
|
157
158
|
});
|
|
158
159
|
|
|
159
|
-
this.seekHead.mousedown(function (
|
|
160
|
+
this.seekHead.mousedown(function (e) {
|
|
160
161
|
thisObj.startTracking('mouse', thisObj.pageXToPosition(thisObj.seekHead.offset() + (thisObj.seekHead.width() / 2)));
|
|
161
162
|
if (!thisObj.bodyDiv.is(':focus')) {
|
|
162
163
|
thisObj.bodyDiv.focus();
|
|
163
164
|
}
|
|
164
|
-
|
|
165
|
+
e.preventDefault();
|
|
165
166
|
});
|
|
166
167
|
|
|
167
|
-
this.bodyDiv.mouseup(function (
|
|
168
|
+
this.bodyDiv.mouseup(function (e) {
|
|
168
169
|
if (thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
169
|
-
thisObj.stopTracking(thisObj.pageXToPosition(
|
|
170
|
+
thisObj.stopTracking(thisObj.pageXToPosition(e.pageX));
|
|
170
171
|
}
|
|
171
172
|
})
|
|
172
173
|
|
|
173
|
-
this.seekHead.mouseup(function (
|
|
174
|
+
this.seekHead.mouseup(function (e) {
|
|
174
175
|
if (thisObj.tracking && thisObj.trackDevice === 'mouse') {
|
|
175
|
-
thisObj.stopTracking(thisObj.pageXToPosition(
|
|
176
|
+
thisObj.stopTracking(thisObj.pageXToPosition(e.pageX));
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
179
|
|
|
179
|
-
this.bodyDiv.keydown(function (
|
|
180
|
+
this.bodyDiv.keydown(function (e) {
|
|
180
181
|
// Home
|
|
181
|
-
if (
|
|
182
|
+
if (e.which === 36) {
|
|
182
183
|
thisObj.trackImmediatelyTo(0);
|
|
183
184
|
}
|
|
184
185
|
// End
|
|
185
|
-
else if (
|
|
186
|
+
else if (e.which === 35) {
|
|
186
187
|
thisObj.trackImmediatelyTo(thisObj.duration);
|
|
187
188
|
}
|
|
188
189
|
// Left arrow or down arrow
|
|
189
|
-
else if (
|
|
190
|
+
else if (e.which === 37 || e.which === 40) {
|
|
190
191
|
thisObj.arrowKeyDown(-1);
|
|
191
192
|
}
|
|
192
193
|
// Right arrow or up arrow
|
|
193
|
-
else if (
|
|
194
|
+
else if (e.which === 39 || e.which === 38) {
|
|
194
195
|
thisObj.arrowKeyDown(1);
|
|
195
196
|
}
|
|
196
197
|
// Page up
|
|
197
|
-
else if (
|
|
198
|
+
else if (e.which === 33 && bigInterval > 0) {
|
|
198
199
|
thisObj.arrowKeyDown(bigInterval);
|
|
199
200
|
}
|
|
200
201
|
// Page down
|
|
201
|
-
else if (
|
|
202
|
+
else if (e.which === 34 && bigInterval > 0) {
|
|
202
203
|
thisObj.arrowKeyDown(-bigInterval);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
else {
|
|
206
207
|
return;
|
|
207
208
|
}
|
|
208
|
-
|
|
209
|
+
e.preventDefault();
|
|
209
210
|
});
|
|
210
211
|
|
|
211
|
-
this.bodyDiv.keyup(function (
|
|
212
|
-
if (
|
|
212
|
+
this.bodyDiv.keyup(function (e) {
|
|
213
|
+
if (e.which >= 33 && e.which <= 40) {
|
|
213
214
|
if (thisObj.tracking && thisObj.trackDevice === 'keyboard') {
|
|
214
215
|
thisObj.stopTracking(thisObj.keyTrackPosition);
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
+
e.preventDefault();
|
|
217
218
|
}
|
|
218
219
|
});
|
|
219
220
|
}
|
|
@@ -16,13 +16,20 @@
|
|
|
16
16
|
this.descriptions = [];
|
|
17
17
|
this.chapters = [];
|
|
18
18
|
this.meta = [];
|
|
19
|
+
if ($('#able-vts').length) {
|
|
20
|
+
// Page includes a container for a VTS instance
|
|
21
|
+
this.vtsTracks = [];
|
|
22
|
+
this.hasVts = true;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.hasVts = false;
|
|
26
|
+
}
|
|
19
27
|
|
|
20
28
|
var loadingPromises = [];
|
|
21
29
|
for (var ii = 0; ii < this.$tracks.length; ii++) {
|
|
22
30
|
var track = this.$tracks[ii];
|
|
23
31
|
var kind = track.getAttribute('kind');
|
|
24
32
|
var trackSrc = track.getAttribute('src');
|
|
25
|
-
|
|
26
33
|
var isDefaultTrack = track.getAttribute('default');
|
|
27
34
|
|
|
28
35
|
if (!trackSrc) {
|
|
@@ -32,17 +39,37 @@
|
|
|
32
39
|
|
|
33
40
|
var loadingPromise = this.loadTextObject(trackSrc);
|
|
34
41
|
loadingPromises.push(loadingPromise);
|
|
35
|
-
loadingPromise.then((function (track, kind) {
|
|
42
|
+
loadingPromise.then((function (track, kind, trackLang, trackLabel) {
|
|
43
|
+
|
|
44
|
+
// srcLang should always be included with <track>, but HTML5 spec doesn't require it
|
|
45
|
+
// if not provided, assume track is the same language as the default player language
|
|
46
|
+
var trackLang = track.getAttribute('srclang') || thisObj.lang;
|
|
47
|
+
var trackLabel = track.getAttribute('label') || thisObj.getLanguageName(trackLang);
|
|
48
|
+
|
|
36
49
|
return function (trackSrc, trackText) {
|
|
37
|
-
|
|
50
|
+
|
|
51
|
+
var trackContents = trackText;
|
|
52
|
+
|
|
53
|
+
// convert XMl/TTML captions file
|
|
54
|
+
if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml'))) {
|
|
55
|
+
trackContents = thisObj.ttml2webvtt(trackText);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (thisObj.hasVts) {
|
|
59
|
+
// setupVtsTracks() is in vts.js
|
|
60
|
+
thisObj.setupVtsTracks(kind, trackLang, trackLabel, trackSrc, trackContents);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var cues = thisObj.parseWebVTT(trackSrc, trackContents).cues;
|
|
64
|
+
|
|
38
65
|
if (kind === 'captions' || kind === 'subtitles') {
|
|
39
|
-
thisObj.setupCaptions(track, cues);
|
|
66
|
+
thisObj.setupCaptions(track, cues, trackLang, trackLabel);
|
|
40
67
|
}
|
|
41
68
|
else if (kind === 'descriptions') {
|
|
42
|
-
thisObj.setupDescriptions(track, cues);
|
|
69
|
+
thisObj.setupDescriptions(track, cues, trackLang);
|
|
43
70
|
}
|
|
44
71
|
else if (kind === 'chapters') {
|
|
45
|
-
thisObj.setupChapters(track, cues);
|
|
72
|
+
thisObj.setupChapters(track, cues, trackLang);
|
|
46
73
|
}
|
|
47
74
|
else if (kind === 'metadata') {
|
|
48
75
|
thisObj.setupMetadata(track, cues);
|
|
@@ -57,13 +84,9 @@
|
|
|
57
84
|
return promise;
|
|
58
85
|
};
|
|
59
86
|
|
|
60
|
-
AblePlayer.prototype.setupCaptions = function (track, cues) {
|
|
87
|
+
AblePlayer.prototype.setupCaptions = function (track, cues, trackLang, trackLabel) {
|
|
61
88
|
|
|
62
89
|
this.hasCaptions = true;
|
|
63
|
-
// srcLang should always be included with <track>, but HTML5 spec doesn't require it
|
|
64
|
-
// if not provided, assume track is the same language as the default player language
|
|
65
|
-
var trackLang = track.getAttribute('srclang') || this.lang;
|
|
66
|
-
var trackLabel = track.getAttribute('label') || this.getLanguageName(trackLang);
|
|
67
90
|
if (typeof track.getAttribute('default') == 'string') {
|
|
68
91
|
var isDefaultTrack = true;
|
|
69
92
|
// Now remove 'default' attribute from <track>
|
|
@@ -88,7 +111,7 @@
|
|
|
88
111
|
this.$captionsWrapper = $('<div>',{
|
|
89
112
|
'class': 'able-captions-wrapper',
|
|
90
113
|
'aria-hidden': 'true'
|
|
91
|
-
});
|
|
114
|
+
}).hide();
|
|
92
115
|
if (this.prefCaptionsPosition === 'below') {
|
|
93
116
|
this.$captionsWrapper.addClass('able-captions-below');
|
|
94
117
|
}
|
|
@@ -188,16 +211,12 @@
|
|
|
188
211
|
};
|
|
189
212
|
|
|
190
213
|
|
|
191
|
-
AblePlayer.prototype.setupDescriptions = function (track, cues) {
|
|
214
|
+
AblePlayer.prototype.setupDescriptions = function (track, cues, trackLang) {
|
|
192
215
|
|
|
193
216
|
// called via setupTracks() only if there is track with kind="descriptions"
|
|
194
217
|
// prepares for delivery of text description , in case it's needed
|
|
195
218
|
// whether and how it's delivered is controlled within description.js > initDescription()
|
|
196
219
|
|
|
197
|
-
// srcLang should always be included with <track>, but HTML5 spec doesn't require it
|
|
198
|
-
// if not provided, assume track is the same language as the default player language
|
|
199
|
-
var trackLang = track.getAttribute('srclang') || this.lang;
|
|
200
|
-
|
|
201
220
|
this.hasClosedDesc = true;
|
|
202
221
|
this.currentDescription = -1;
|
|
203
222
|
this.descriptions.push({
|
|
@@ -206,15 +225,11 @@
|
|
|
206
225
|
});
|
|
207
226
|
};
|
|
208
227
|
|
|
209
|
-
AblePlayer.prototype.setupChapters = function (track, cues) {
|
|
228
|
+
AblePlayer.prototype.setupChapters = function (track, cues, trackLang) {
|
|
210
229
|
|
|
211
230
|
// NOTE: WebVTT supports nested timestamps (to form an outline)
|
|
212
231
|
// This is not currently supported.
|
|
213
232
|
|
|
214
|
-
// srcLang should always be included with <track>, but HTML5 spec doesn't require it
|
|
215
|
-
// if not provided, assume track is the same language as the default player language
|
|
216
|
-
var trackLang = track.getAttribute('srclang') || this.lang;
|
|
217
|
-
|
|
218
233
|
this.hasChapters = true;
|
|
219
234
|
|
|
220
235
|
this.chapters.push({
|
|
@@ -224,6 +239,7 @@
|
|
|
224
239
|
};
|
|
225
240
|
|
|
226
241
|
AblePlayer.prototype.setupMetadata = function(track, cues) {
|
|
242
|
+
|
|
227
243
|
if (this.metaType === 'text') {
|
|
228
244
|
// Metadata is only supported if data-meta-div is provided
|
|
229
245
|
// The player does not display metadata internally
|