First release
This commit is contained in:
commit
fa6c85266e
2339 changed files with 761050 additions and 0 deletions
50
node_modules/videojs-vtt.js/lib/browser-index.js
generated
vendored
Normal file
50
node_modules/videojs-vtt.js/lib/browser-index.js
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Default exports for Node. Export the extended versions of VTTCue and
|
||||
// VTTRegion in Node since we likely want the capability to convert back and
|
||||
// forth between JSON. If we don't then it's not that big of a deal since we're
|
||||
// off browser.
|
||||
|
||||
var window = require('global/window');
|
||||
|
||||
var vttjs = module.exports = {
|
||||
WebVTT: require("./vtt.js"),
|
||||
VTTCue: require("./vttcue.js"),
|
||||
VTTRegion: require("./vttregion.js")
|
||||
};
|
||||
|
||||
window.vttjs = vttjs;
|
||||
window.WebVTT = vttjs.WebVTT;
|
||||
|
||||
var cueShim = vttjs.VTTCue;
|
||||
var regionShim = vttjs.VTTRegion;
|
||||
var nativeVTTCue = window.VTTCue;
|
||||
var nativeVTTRegion = window.VTTRegion;
|
||||
|
||||
vttjs.shim = function() {
|
||||
window.VTTCue = cueShim;
|
||||
window.VTTRegion = regionShim;
|
||||
};
|
||||
|
||||
vttjs.restore = function() {
|
||||
window.VTTCue = nativeVTTCue;
|
||||
window.VTTRegion = nativeVTTRegion;
|
||||
};
|
||||
|
||||
if (!window.VTTCue) {
|
||||
vttjs.shim();
|
||||
}
|
17
node_modules/videojs-vtt.js/lib/browser.js
generated
vendored
Normal file
17
node_modules/videojs-vtt.js/lib/browser.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
(function(root) {
|
||||
var vttjs = root.vttjs = {};
|
||||
var cueShim = vttjs.VTTCue;
|
||||
var regionShim = vttjs.VTTRegion;
|
||||
var oldVTTCue = root.VTTCue;
|
||||
var oldVTTRegion = root.VTTRegion;
|
||||
|
||||
vttjs.shim = function() {
|
||||
vttjs.VTTCue = cueShim;
|
||||
vttjs.VTTRegion = regionShim;
|
||||
};
|
||||
|
||||
vttjs.restore = function() {
|
||||
vttjs.VTTCue = oldVTTCue;
|
||||
vttjs.VTTRegion = oldVTTRegion;
|
||||
};
|
||||
}(this));
|
25
node_modules/videojs-vtt.js/lib/index.js
generated
vendored
Normal file
25
node_modules/videojs-vtt.js/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Default exports for Node. Export the extended versions of VTTCue and
|
||||
// VTTRegion in Node since we likely want the capability to convert back and
|
||||
// forth between JSON. If we don't then it's not that big of a deal since we're
|
||||
// off browser.
|
||||
module.exports = {
|
||||
WebVTT: require("./vtt.js").WebVTT,
|
||||
VTTCue: require("./vttcue-extended.js").VTTCue,
|
||||
VTTRegion: require("./vttregion-extended.js").VTTRegion
|
||||
};
|
1349
node_modules/videojs-vtt.js/lib/vtt.js
generated
vendored
Normal file
1349
node_modules/videojs-vtt.js/lib/vtt.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
60
node_modules/videojs-vtt.js/lib/vttcue-extended.js
generated
vendored
Normal file
60
node_modules/videojs-vtt.js/lib/vttcue-extended.js
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// If we're in Node.js then require VTTCue so we can extend it, otherwise assume
|
||||
// VTTCue is on the global.
|
||||
if (typeof module !== "undefined" && module.exports) {
|
||||
this.VTTCue = this.VTTCue || require("./vttcue").VTTCue;
|
||||
}
|
||||
|
||||
// Extend VTTCue with methods to convert to JSON, from JSON, and construct a
|
||||
// VTTCue from an options object. The primary purpose of this is for use in the
|
||||
// vtt.js test suite (for testing only properties that we care about). It's also
|
||||
// useful if you need to work with VTTCues in JSON format.
|
||||
(function(root) {
|
||||
|
||||
root.VTTCue.prototype.toJSON = function() {
|
||||
var cue = {},
|
||||
self = this;
|
||||
// Filter out getCueAsHTML as it's a function and hasBeenReset and displayState as
|
||||
// they're only used when running the processing model algorithm.
|
||||
Object.keys(this).forEach(function(key) {
|
||||
if (key !== "getCueAsHTML" && key !== "hasBeenReset" && key !== "displayState") {
|
||||
cue[key] = self[key];
|
||||
}
|
||||
});
|
||||
return cue;
|
||||
};
|
||||
|
||||
root.VTTCue.create = function(options) {
|
||||
if (!options.hasOwnProperty("startTime") || !options.hasOwnProperty("endTime") ||
|
||||
!options.hasOwnProperty("text")) {
|
||||
throw new Error("You must at least have start time, end time, and text.");
|
||||
}
|
||||
var cue = new root.VTTCue(options.startTime, options.endTime, options.text);
|
||||
for (var key in options) {
|
||||
if (cue.hasOwnProperty(key)) {
|
||||
cue[key] = options[key];
|
||||
}
|
||||
}
|
||||
return cue;
|
||||
};
|
||||
|
||||
root.VTTCue.fromJSON = function(json) {
|
||||
return this.create(JSON.parse(json));
|
||||
};
|
||||
|
||||
}(this));
|
286
node_modules/videojs-vtt.js/lib/vttcue.js
generated
vendored
Normal file
286
node_modules/videojs-vtt.js/lib/vttcue.js
generated
vendored
Normal file
|
@ -0,0 +1,286 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var autoKeyword = "auto";
|
||||
var directionSetting = {
|
||||
"": 1,
|
||||
"lr": 1,
|
||||
"rl": 1
|
||||
};
|
||||
var alignSetting = {
|
||||
"start": 1,
|
||||
"center": 1,
|
||||
"end": 1,
|
||||
"left": 1,
|
||||
"right": 1,
|
||||
"auto": 1,
|
||||
"line-left": 1,
|
||||
"line-right": 1
|
||||
};
|
||||
|
||||
function findDirectionSetting(value) {
|
||||
if (typeof value !== "string") {
|
||||
return false;
|
||||
}
|
||||
var dir = directionSetting[value.toLowerCase()];
|
||||
return dir ? value.toLowerCase() : false;
|
||||
}
|
||||
|
||||
function findAlignSetting(value) {
|
||||
if (typeof value !== "string") {
|
||||
return false;
|
||||
}
|
||||
var align = alignSetting[value.toLowerCase()];
|
||||
return align ? value.toLowerCase() : false;
|
||||
}
|
||||
|
||||
function VTTCue(startTime, endTime, text) {
|
||||
/**
|
||||
* Shim implementation specific properties. These properties are not in
|
||||
* the spec.
|
||||
*/
|
||||
|
||||
// Lets us know when the VTTCue's data has changed in such a way that we need
|
||||
// to recompute its display state. This lets us compute its display state
|
||||
// lazily.
|
||||
this.hasBeenReset = false;
|
||||
|
||||
/**
|
||||
* VTTCue and TextTrackCue properties
|
||||
* http://dev.w3.org/html5/webvtt/#vttcue-interface
|
||||
*/
|
||||
|
||||
var _id = "";
|
||||
var _pauseOnExit = false;
|
||||
var _startTime = startTime;
|
||||
var _endTime = endTime;
|
||||
var _text = text;
|
||||
var _region = null;
|
||||
var _vertical = "";
|
||||
var _snapToLines = true;
|
||||
var _line = "auto";
|
||||
var _lineAlign = "start";
|
||||
var _position = "auto";
|
||||
var _positionAlign = "auto";
|
||||
var _size = 100;
|
||||
var _align = "center";
|
||||
|
||||
Object.defineProperties(this, {
|
||||
"id": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _id;
|
||||
},
|
||||
set: function(value) {
|
||||
_id = "" + value;
|
||||
}
|
||||
},
|
||||
|
||||
"pauseOnExit": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _pauseOnExit;
|
||||
},
|
||||
set: function(value) {
|
||||
_pauseOnExit = !!value;
|
||||
}
|
||||
},
|
||||
|
||||
"startTime": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _startTime;
|
||||
},
|
||||
set: function(value) {
|
||||
if (typeof value !== "number") {
|
||||
throw new TypeError("Start time must be set to a number.");
|
||||
}
|
||||
_startTime = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"endTime": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _endTime;
|
||||
},
|
||||
set: function(value) {
|
||||
if (typeof value !== "number") {
|
||||
throw new TypeError("End time must be set to a number.");
|
||||
}
|
||||
_endTime = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"text": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _text;
|
||||
},
|
||||
set: function(value) {
|
||||
_text = "" + value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"region": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _region;
|
||||
},
|
||||
set: function(value) {
|
||||
_region = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"vertical": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _vertical;
|
||||
},
|
||||
set: function(value) {
|
||||
var setting = findDirectionSetting(value);
|
||||
// Have to check for false because the setting an be an empty string.
|
||||
if (setting === false) {
|
||||
throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
|
||||
}
|
||||
_vertical = setting;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"snapToLines": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _snapToLines;
|
||||
},
|
||||
set: function(value) {
|
||||
_snapToLines = !!value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"line": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _line;
|
||||
},
|
||||
set: function(value) {
|
||||
if (typeof value !== "number" && value !== autoKeyword) {
|
||||
throw new SyntaxError("Line: an invalid number or illegal string was specified.");
|
||||
}
|
||||
_line = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"lineAlign": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _lineAlign;
|
||||
},
|
||||
set: function(value) {
|
||||
var setting = findAlignSetting(value);
|
||||
if (!setting) {
|
||||
console.warn("lineAlign: an invalid or illegal string was specified.");
|
||||
} else {
|
||||
_lineAlign = setting;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"position": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _position;
|
||||
},
|
||||
set: function(value) {
|
||||
if (value < 0 || value > 100) {
|
||||
throw new Error("Position must be between 0 and 100.");
|
||||
}
|
||||
_position = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"positionAlign": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _positionAlign;
|
||||
},
|
||||
set: function(value) {
|
||||
var setting = findAlignSetting(value);
|
||||
if (!setting) {
|
||||
console.warn("positionAlign: an invalid or illegal string was specified.");
|
||||
} else {
|
||||
_positionAlign = setting;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"size": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _size;
|
||||
},
|
||||
set: function(value) {
|
||||
if (value < 0 || value > 100) {
|
||||
throw new Error("Size must be between 0 and 100.");
|
||||
}
|
||||
_size = value;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
},
|
||||
|
||||
"align": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _align;
|
||||
},
|
||||
set: function(value) {
|
||||
var setting = findAlignSetting(value);
|
||||
if (!setting) {
|
||||
throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
|
||||
}
|
||||
_align = setting;
|
||||
this.hasBeenReset = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Other <track> spec defined properties
|
||||
*/
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state
|
||||
this.displayState = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* VTTCue methods
|
||||
*/
|
||||
|
||||
VTTCue.prototype.getCueAsHTML = function() {
|
||||
// Assume WebVTT.convertCueToDOMTree is on the global.
|
||||
return WebVTT.convertCueToDOMTree(window, this.text);
|
||||
};
|
||||
|
||||
module.exports = VTTCue;
|
43
node_modules/videojs-vtt.js/lib/vttregion-extended.js
generated
vendored
Normal file
43
node_modules/videojs-vtt.js/lib/vttregion-extended.js
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// If we're in Node.js then require VTTRegion so we can extend it, otherwise assume
|
||||
// VTTRegion is on the global.
|
||||
if (typeof module !== "undefined" && module.exports) {
|
||||
this.VTTRegion = require("./vttregion").VTTRegion;
|
||||
}
|
||||
|
||||
// Extend VTTRegion with methods to convert to JSON, from JSON, and construct a
|
||||
// VTTRegion from an options object. The primary purpose of this is for use in the
|
||||
// vtt.js test suite. It's also useful if you need to work with VTTRegions in
|
||||
// JSON format.
|
||||
(function(root) {
|
||||
|
||||
root.VTTRegion.create = function(options) {
|
||||
var region = new root.VTTRegion();
|
||||
for (var key in options) {
|
||||
if (region.hasOwnProperty(key)) {
|
||||
region[key] = options[key];
|
||||
}
|
||||
}
|
||||
return region;
|
||||
};
|
||||
|
||||
root.VTTRegion.fromJSON = function(json) {
|
||||
return this.create(JSON.parse(json));
|
||||
};
|
||||
|
||||
}(this));
|
135
node_modules/videojs-vtt.js/lib/vttregion.js
generated
vendored
Normal file
135
node_modules/videojs-vtt.js/lib/vttregion.js
generated
vendored
Normal file
|
@ -0,0 +1,135 @@
|
|||
/**
|
||||
* Copyright 2013 vtt.js Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var scrollSetting = {
|
||||
"": true,
|
||||
"up": true
|
||||
};
|
||||
|
||||
function findScrollSetting(value) {
|
||||
if (typeof value !== "string") {
|
||||
return false;
|
||||
}
|
||||
var scroll = scrollSetting[value.toLowerCase()];
|
||||
return scroll ? value.toLowerCase() : false;
|
||||
}
|
||||
|
||||
function isValidPercentValue(value) {
|
||||
return typeof value === "number" && (value >= 0 && value <= 100);
|
||||
}
|
||||
|
||||
// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface
|
||||
function VTTRegion() {
|
||||
var _width = 100;
|
||||
var _lines = 3;
|
||||
var _regionAnchorX = 0;
|
||||
var _regionAnchorY = 100;
|
||||
var _viewportAnchorX = 0;
|
||||
var _viewportAnchorY = 100;
|
||||
var _scroll = "";
|
||||
|
||||
Object.defineProperties(this, {
|
||||
"width": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _width;
|
||||
},
|
||||
set: function(value) {
|
||||
if (!isValidPercentValue(value)) {
|
||||
throw new Error("Width must be between 0 and 100.");
|
||||
}
|
||||
_width = value;
|
||||
}
|
||||
},
|
||||
"lines": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _lines;
|
||||
},
|
||||
set: function(value) {
|
||||
if (typeof value !== "number") {
|
||||
throw new TypeError("Lines must be set to a number.");
|
||||
}
|
||||
_lines = value;
|
||||
}
|
||||
},
|
||||
"regionAnchorY": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _regionAnchorY;
|
||||
},
|
||||
set: function(value) {
|
||||
if (!isValidPercentValue(value)) {
|
||||
throw new Error("RegionAnchorX must be between 0 and 100.");
|
||||
}
|
||||
_regionAnchorY = value;
|
||||
}
|
||||
},
|
||||
"regionAnchorX": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _regionAnchorX;
|
||||
},
|
||||
set: function(value) {
|
||||
if(!isValidPercentValue(value)) {
|
||||
throw new Error("RegionAnchorY must be between 0 and 100.");
|
||||
}
|
||||
_regionAnchorX = value;
|
||||
}
|
||||
},
|
||||
"viewportAnchorY": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _viewportAnchorY;
|
||||
},
|
||||
set: function(value) {
|
||||
if (!isValidPercentValue(value)) {
|
||||
throw new Error("ViewportAnchorY must be between 0 and 100.");
|
||||
}
|
||||
_viewportAnchorY = value;
|
||||
}
|
||||
},
|
||||
"viewportAnchorX": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _viewportAnchorX;
|
||||
},
|
||||
set: function(value) {
|
||||
if (!isValidPercentValue(value)) {
|
||||
throw new Error("ViewportAnchorX must be between 0 and 100.");
|
||||
}
|
||||
_viewportAnchorX = value;
|
||||
}
|
||||
},
|
||||
"scroll": {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _scroll;
|
||||
},
|
||||
set: function(value) {
|
||||
var setting = findScrollSetting(value);
|
||||
// Have to check for false as an empty string is a legal value.
|
||||
if (setting === false) {
|
||||
console.warn("Scroll: an invalid or illegal string was specified.");
|
||||
} else {
|
||||
_scroll = setting;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = VTTRegion;
|
Loading…
Add table
Add a link
Reference in a new issue