ovenplayer 0.10.49 → 0.10.51
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.
- package/dist/ovenplayer.js +1 -1
- package/dist/ovenplayer.js.map +1 -1
- package/package.json +49 -49
- package/src/js/api/Configurator.js +1 -1
- package/src/js/api/ads/vast/Ad.js +237 -237
- package/src/js/api/caption/Loader.js +1 -1
- package/src/js/api/caption/Manager.js +1 -1
- package/src/js/api/caption/parser/VttParser.js +1541 -1542
- package/src/js/api/playlist/Manager.js +229 -229
- package/src/js/api/provider/html5/providers/Dash.js +286 -286
- package/src/js/api/provider/html5/providers/Hls.js +110 -2
- package/src/js/api/provider/html5/providers/WebRTC.js +2 -1
- package/src/js/api/provider/html5/providers/WebRTCLoader.js +35 -2
- package/src/js/api/provider/utils.js +69 -69
- package/src/js/ovenplayer.sdk.js +143 -143
- package/src/js/utils/likeA$.js +241 -242
- package/src/js/utils/resize-sensor.js +145 -168
- package/src/js/utils/strings.js +104 -104
- package/src/js/view/components/controls/settingPanel/audioTrackPanel.js +57 -57
- package/src/js/view/components/controls/settingPanel/main.js +1 -1
- package/src/js/view/components/controls/settingPanel/mainTemplate.js +29 -29
- package/src/js/view/components/controls/settingPanel/qualityPanel.js +68 -68
- package/src/js/view/components/controls/settingPanel/subtitleTrackPanel.js +56 -56
- package/src/js/view/components/helpers/captionViewer.js +97 -15
- package/src/js/view/components/helpers/captionViewerTemplate.js +1 -2
- package/src/js/view/components/helpers/waterMark.js +69 -69
- package/src/js/view/engine/OvenTemplate.js +158 -158
- package/src/js/view/global/PanelManager.js +47 -47
- package/src/stylesheet/ovenplayer.less +52 -21
- package/src/js/utils/adapter.js +0 -4944
- package/src/js/utils/captions/vttCue.js +0 -308
- package/src/js/utils/captions/vttRegion.js +0 -136
- package/src/js/utils/polyfills/dom.js +0 -634
- package/src/js/utils/underscore.js +0 -6
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013 vtt.js Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
let VTTCue = window.VTTCue;
|
|
17
|
-
|
|
18
|
-
var autoKeyword = "auto";
|
|
19
|
-
var directionSetting = {
|
|
20
|
-
"": true,
|
|
21
|
-
"lr": true,
|
|
22
|
-
"rl": true
|
|
23
|
-
};
|
|
24
|
-
var alignSetting = {
|
|
25
|
-
"start": true,
|
|
26
|
-
"middle": true,
|
|
27
|
-
"end": true,
|
|
28
|
-
"left": true,
|
|
29
|
-
"right": true
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function findDirectionSetting(value) {
|
|
33
|
-
if (typeof value !== "string") {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
var dir = directionSetting[value.toLowerCase()];
|
|
37
|
-
return dir ? value.toLowerCase() : false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function findAlignSetting(value) {
|
|
41
|
-
if (typeof value !== "string") {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
var align = alignSetting[value.toLowerCase()];
|
|
45
|
-
return align ? value.toLowerCase() : false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function extend(obj) {
|
|
49
|
-
var i = 1;
|
|
50
|
-
for (; i < arguments.length; i++) {
|
|
51
|
-
var cobj = arguments[i];
|
|
52
|
-
for (var p in cobj) {
|
|
53
|
-
obj[p] = cobj[p];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
if(!VTTCue){
|
|
60
|
-
VTTCue = function (startTime, endTime, text) {
|
|
61
|
-
var cue = this;
|
|
62
|
-
var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent);
|
|
63
|
-
var baseObj = {};
|
|
64
|
-
|
|
65
|
-
if (isIE8) {
|
|
66
|
-
cue = document.createElement('custom');
|
|
67
|
-
} else {
|
|
68
|
-
baseObj.enumerable = true;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Shim implementation specific properties. These properties are not in
|
|
73
|
-
* the spec.
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
// Lets us know when the VTTCue's data has changed in such a way that we need
|
|
77
|
-
// to recompute its display state. This lets us compute its display state
|
|
78
|
-
// lazily.
|
|
79
|
-
cue.hasBeenReset = false;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* VTTCue and TextTrackCue properties
|
|
83
|
-
* http://dev.w3.org/html5/webvtt/#vttcue-interface
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
var _id = "";
|
|
87
|
-
var _pauseOnExit = false;
|
|
88
|
-
var _startTime = startTime;
|
|
89
|
-
var _endTime = endTime;
|
|
90
|
-
var _text = text;
|
|
91
|
-
var _region = null;
|
|
92
|
-
var _vertical = "";
|
|
93
|
-
var _snapToLines = true;
|
|
94
|
-
var _line = "auto";
|
|
95
|
-
var _lineAlign = "start";
|
|
96
|
-
var _position = 50;
|
|
97
|
-
var _positionAlign = "middle";
|
|
98
|
-
var _size = 50;
|
|
99
|
-
var _align = "middle";
|
|
100
|
-
|
|
101
|
-
Object.defineProperty(cue,
|
|
102
|
-
"id", extend({}, baseObj, {
|
|
103
|
-
get: function() {
|
|
104
|
-
return _id;
|
|
105
|
-
},
|
|
106
|
-
set: function(value) {
|
|
107
|
-
_id = "" + value;
|
|
108
|
-
}
|
|
109
|
-
}));
|
|
110
|
-
|
|
111
|
-
Object.defineProperty(cue,
|
|
112
|
-
"pauseOnExit", extend({}, baseObj, {
|
|
113
|
-
get: function() {
|
|
114
|
-
return _pauseOnExit;
|
|
115
|
-
},
|
|
116
|
-
set: function(value) {
|
|
117
|
-
_pauseOnExit = !!value;
|
|
118
|
-
}
|
|
119
|
-
}));
|
|
120
|
-
|
|
121
|
-
Object.defineProperty(cue,
|
|
122
|
-
"startTime", extend({}, baseObj, {
|
|
123
|
-
get: function() {
|
|
124
|
-
return _startTime;
|
|
125
|
-
},
|
|
126
|
-
set: function(value) {
|
|
127
|
-
if (typeof value !== "number") {
|
|
128
|
-
throw new TypeError("Start time must be set to a number.");
|
|
129
|
-
}
|
|
130
|
-
_startTime = value;
|
|
131
|
-
this.hasBeenReset = true;
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
|
|
135
|
-
Object.defineProperty(cue,
|
|
136
|
-
"endTime", extend({}, baseObj, {
|
|
137
|
-
get: function() {
|
|
138
|
-
return _endTime;
|
|
139
|
-
},
|
|
140
|
-
set: function(value) {
|
|
141
|
-
if (typeof value !== "number") {
|
|
142
|
-
throw new TypeError("End time must be set to a number.");
|
|
143
|
-
}
|
|
144
|
-
_endTime = value;
|
|
145
|
-
this.hasBeenReset = true;
|
|
146
|
-
}
|
|
147
|
-
}));
|
|
148
|
-
|
|
149
|
-
Object.defineProperty(cue,
|
|
150
|
-
"text", extend({}, baseObj, {
|
|
151
|
-
get: function() {
|
|
152
|
-
return _text;
|
|
153
|
-
},
|
|
154
|
-
set: function(value) {
|
|
155
|
-
_text = "" + value;
|
|
156
|
-
this.hasBeenReset = true;
|
|
157
|
-
}
|
|
158
|
-
}));
|
|
159
|
-
|
|
160
|
-
Object.defineProperty(cue,
|
|
161
|
-
"region", extend({}, baseObj, {
|
|
162
|
-
get: function() {
|
|
163
|
-
return _region;
|
|
164
|
-
},
|
|
165
|
-
set: function(value) {
|
|
166
|
-
_region = value;
|
|
167
|
-
this.hasBeenReset = true;
|
|
168
|
-
}
|
|
169
|
-
}));
|
|
170
|
-
|
|
171
|
-
Object.defineProperty(cue,
|
|
172
|
-
"vertical", extend({}, baseObj, {
|
|
173
|
-
get: function() {
|
|
174
|
-
return _vertical;
|
|
175
|
-
},
|
|
176
|
-
set: function(value) {
|
|
177
|
-
var setting = findDirectionSetting(value);
|
|
178
|
-
// Have to check for false because the setting an be an empty string.
|
|
179
|
-
if (setting === false) {
|
|
180
|
-
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
181
|
-
}
|
|
182
|
-
_vertical = setting;
|
|
183
|
-
this.hasBeenReset = true;
|
|
184
|
-
}
|
|
185
|
-
}));
|
|
186
|
-
|
|
187
|
-
Object.defineProperty(cue,
|
|
188
|
-
"snapToLines", extend({}, baseObj, {
|
|
189
|
-
get: function() {
|
|
190
|
-
return _snapToLines;
|
|
191
|
-
},
|
|
192
|
-
set: function(value) {
|
|
193
|
-
_snapToLines = !!value;
|
|
194
|
-
this.hasBeenReset = true;
|
|
195
|
-
}
|
|
196
|
-
}));
|
|
197
|
-
|
|
198
|
-
Object.defineProperty(cue,
|
|
199
|
-
"line", extend({}, baseObj, {
|
|
200
|
-
get: function() {
|
|
201
|
-
return _line;
|
|
202
|
-
},
|
|
203
|
-
set: function(value) {
|
|
204
|
-
if (typeof value !== "number" && value !== autoKeyword) {
|
|
205
|
-
throw new SyntaxError("An invalid number or illegal string was specified.");
|
|
206
|
-
}
|
|
207
|
-
_line = value;
|
|
208
|
-
this.hasBeenReset = true;
|
|
209
|
-
}
|
|
210
|
-
}));
|
|
211
|
-
|
|
212
|
-
Object.defineProperty(cue,
|
|
213
|
-
"lineAlign", extend({}, baseObj, {
|
|
214
|
-
get: function() {
|
|
215
|
-
return _lineAlign;
|
|
216
|
-
},
|
|
217
|
-
set: function(value) {
|
|
218
|
-
var setting = findAlignSetting(value);
|
|
219
|
-
if (!setting) {
|
|
220
|
-
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
221
|
-
}
|
|
222
|
-
_lineAlign = setting;
|
|
223
|
-
this.hasBeenReset = true;
|
|
224
|
-
}
|
|
225
|
-
}));
|
|
226
|
-
|
|
227
|
-
Object.defineProperty(cue,
|
|
228
|
-
"position", extend({}, baseObj, {
|
|
229
|
-
get: function() {
|
|
230
|
-
return _position;
|
|
231
|
-
},
|
|
232
|
-
set: function(value) {
|
|
233
|
-
if (value < 0 || value > 100) {
|
|
234
|
-
throw new Error("Position must be between 0 and 100.");
|
|
235
|
-
}
|
|
236
|
-
_position = value;
|
|
237
|
-
this.hasBeenReset = true;
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
|
|
241
|
-
Object.defineProperty(cue,
|
|
242
|
-
"positionAlign", extend({}, baseObj, {
|
|
243
|
-
get: function() {
|
|
244
|
-
return _positionAlign;
|
|
245
|
-
},
|
|
246
|
-
set: function(value) {
|
|
247
|
-
var setting = findAlignSetting(value);
|
|
248
|
-
if (!setting) {
|
|
249
|
-
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
250
|
-
}
|
|
251
|
-
_positionAlign = setting;
|
|
252
|
-
this.hasBeenReset = true;
|
|
253
|
-
}
|
|
254
|
-
}));
|
|
255
|
-
|
|
256
|
-
Object.defineProperty(cue,
|
|
257
|
-
"size", extend({}, baseObj, {
|
|
258
|
-
get: function() {
|
|
259
|
-
return _size;
|
|
260
|
-
},
|
|
261
|
-
set: function(value) {
|
|
262
|
-
if (value < 0 || value > 100) {
|
|
263
|
-
throw new Error("Size must be between 0 and 100.");
|
|
264
|
-
}
|
|
265
|
-
_size = value;
|
|
266
|
-
this.hasBeenReset = true;
|
|
267
|
-
}
|
|
268
|
-
}));
|
|
269
|
-
|
|
270
|
-
Object.defineProperty(cue,
|
|
271
|
-
"align", extend({}, baseObj, {
|
|
272
|
-
get: function() {
|
|
273
|
-
return _align;
|
|
274
|
-
},
|
|
275
|
-
set: function(value) {
|
|
276
|
-
var setting = findAlignSetting(value);
|
|
277
|
-
if (!setting) {
|
|
278
|
-
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
279
|
-
}
|
|
280
|
-
_align = setting;
|
|
281
|
-
this.hasBeenReset = true;
|
|
282
|
-
}
|
|
283
|
-
}));
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Other <track> spec defined properties
|
|
287
|
-
*/
|
|
288
|
-
|
|
289
|
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state
|
|
290
|
-
cue.displayState = undefined;
|
|
291
|
-
|
|
292
|
-
if (isIE8) {
|
|
293
|
-
return cue;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* VTTCue methods
|
|
299
|
-
*/
|
|
300
|
-
|
|
301
|
-
VTTCue.prototype.getCueAsHTML = function() {
|
|
302
|
-
// Assume WebVTT.convertCueToDOMTree is on the global.
|
|
303
|
-
return WebVTT.convertCueToDOMTree(window, this.text);
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
export default VTTCue;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013 vtt.js Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
let VTTRegion = "";
|
|
18
|
-
|
|
19
|
-
var scrollSetting = {
|
|
20
|
-
"": true,
|
|
21
|
-
"up": true
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function findScrollSetting(value) {
|
|
25
|
-
if (typeof value !== "string") {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
var scroll = scrollSetting[value.toLowerCase()];
|
|
29
|
-
return scroll ? value.toLowerCase() : false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function isValidPercentValue(value) {
|
|
33
|
-
return typeof value === "number" && (value >= 0 && value <= 100);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface
|
|
37
|
-
VTTRegion = function() {
|
|
38
|
-
var _width = 100;
|
|
39
|
-
var _lines = 3;
|
|
40
|
-
var _regionAnchorX = 0;
|
|
41
|
-
var _regionAnchorY = 100;
|
|
42
|
-
var _viewportAnchorX = 0;
|
|
43
|
-
var _viewportAnchorY = 100;
|
|
44
|
-
var _scroll = "";
|
|
45
|
-
|
|
46
|
-
Object.defineProperties(this, {
|
|
47
|
-
"width": {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function() {
|
|
50
|
-
return _width;
|
|
51
|
-
},
|
|
52
|
-
set: function(value) {
|
|
53
|
-
if (!isValidPercentValue(value)) {
|
|
54
|
-
throw new Error("Width must be between 0 and 100.");
|
|
55
|
-
}
|
|
56
|
-
_width = value;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"lines": {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function() {
|
|
62
|
-
return _lines;
|
|
63
|
-
},
|
|
64
|
-
set: function(value) {
|
|
65
|
-
if (typeof value !== "number") {
|
|
66
|
-
throw new TypeError("Lines must be set to a number.");
|
|
67
|
-
}
|
|
68
|
-
_lines = value;
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"regionAnchorY": {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
get: function() {
|
|
74
|
-
return _regionAnchorY;
|
|
75
|
-
},
|
|
76
|
-
set: function(value) {
|
|
77
|
-
if (!isValidPercentValue(value)) {
|
|
78
|
-
throw new Error("RegionAnchorX must be between 0 and 100.");
|
|
79
|
-
}
|
|
80
|
-
_regionAnchorY = value;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"regionAnchorX": {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function() {
|
|
86
|
-
return _regionAnchorX;
|
|
87
|
-
},
|
|
88
|
-
set: function(value) {
|
|
89
|
-
if(!isValidPercentValue(value)) {
|
|
90
|
-
throw new Error("RegionAnchorY must be between 0 and 100.");
|
|
91
|
-
}
|
|
92
|
-
_regionAnchorX = value;
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"viewportAnchorY": {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function() {
|
|
98
|
-
return _viewportAnchorY;
|
|
99
|
-
},
|
|
100
|
-
set: function(value) {
|
|
101
|
-
if (!isValidPercentValue(value)) {
|
|
102
|
-
throw new Error("ViewportAnchorY must be between 0 and 100.");
|
|
103
|
-
}
|
|
104
|
-
_viewportAnchorY = value;
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"viewportAnchorX": {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
get: function() {
|
|
110
|
-
return _viewportAnchorX;
|
|
111
|
-
},
|
|
112
|
-
set: function(value) {
|
|
113
|
-
if (!isValidPercentValue(value)) {
|
|
114
|
-
throw new Error("ViewportAnchorX must be between 0 and 100.");
|
|
115
|
-
}
|
|
116
|
-
_viewportAnchorX = value;
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
"scroll": {
|
|
120
|
-
enumerable: true,
|
|
121
|
-
get: function() {
|
|
122
|
-
return _scroll;
|
|
123
|
-
},
|
|
124
|
-
set: function(value) {
|
|
125
|
-
var setting = findScrollSetting(value);
|
|
126
|
-
// Have to check for false as an empty string is a legal value.
|
|
127
|
-
if (setting === false) {
|
|
128
|
-
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
129
|
-
}
|
|
130
|
-
_scroll = setting;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export default VTTRegion;
|