Created
January 7, 2020 08:24
-
-
Save Beraliv/92a80cd531cd8e0535f7fabd05fda88d to your computer and use it in GitHub Desktop.
Udemy player bundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(window.webpackJsonp = window.webpackJsonp || []).push([["vendor-videojs"], { | |
"./node_modules/video.js/dist/video.cjs.js": function(e, t, r) { | |
function n(e) { | |
return e && "object" == typeof e && "default"in e ? e.default : e | |
} | |
var i, o, a, s, p = n(r("./node_modules/global/window.js")), f = n(r("./node_modules/global/document.js")), d = n(r("./node_modules/tsml/tsml.js")), v = n(r("./node_modules/safe-json-parse/tuple.js")), y = n(r("./node_modules/xhr/index.js")), l = n(r("./node_modules/videojs-vtt.js/lib/browser-index.js")), m = "6.12.1", u = p.navigator && p.navigator.userAgent || "", c = /AppleWebKit\/([\d.]+)/i.exec(u), h = c ? parseFloat(c.pop()) : null, _ = /iPad/i.test(u), g = /iPhone/i.test(u) && !_, b = /iPod/i.test(u), T = g || _ || b, w = (i = u.match(/OS (\d+)_/i)) && i[1] ? i[1] : null, k = /Android/i.test(u), S = function() { | |
var e = u.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); | |
if (!e) | |
return null; | |
var t = e[1] && parseFloat(e[1]) | |
, r = e[2] && parseFloat(e[2]); | |
return t && r ? parseFloat(e[1] + "." + e[2]) : t || null | |
}(), C = k && /webkit/i.test(u) && S < 2.3, E = k && S < 5 && h < 537, x = /Firefox/i.test(u), j = /Edge/i.test(u), P = !j && (/Chrome/i.test(u) || /CriOS/i.test(u)), O = (o = u.match(/(Chrome|CriOS)\/(\d+)/)) && o[2] ? parseFloat(o[2]) : null, A = /MSIE\s8\.0/.test(u), M = (a = /MSIE\s(\d+)\.\d/.exec(u), | |
!(s = a && parseFloat(a[1])) && /Trident\/7.0/i.test(u) && /rv:11.0/.test(u) && (s = 11), | |
s), D = /Safari/i.test(u) && !P && !k && !j, I = (D || T) && !P, R = ie() && ("ontouchstart"in p || p.navigator.maxTouchPoints || p.DocumentTouch && p.document instanceof p.DocumentTouch), N = ie() && "backgroundSize"in p.document.createElement("video").style, L = (Object.freeze || Object)({ | |
IS_IPAD: _, | |
IS_IPHONE: g, | |
IS_IPOD: b, | |
IS_IOS: T, | |
IOS_VERSION: w, | |
IS_ANDROID: k, | |
ANDROID_VERSION: S, | |
IS_OLD_ANDROID: C, | |
IS_NATIVE_ANDROID: E, | |
IS_FIREFOX: x, | |
IS_EDGE: j, | |
IS_CHROME: P, | |
CHROME_VERSION: O, | |
IS_IE8: A, | |
IE_VERSION: M, | |
IS_SAFARI: D, | |
IS_ANY_SAFARI: I, | |
TOUCH_ENABLED: R, | |
BACKGROUND_SIZE_SUPPORTED: N | |
}), F = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { | |
return typeof e | |
} | |
: function(e) { | |
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e | |
} | |
, B = function(e, t) { | |
if (!(e instanceof t)) | |
throw new TypeError("Cannot call a class as a function") | |
}, H = function(e, t) { | |
if ("function" != typeof t && null !== t) | |
throw new TypeError("Super expression must either be null or a function, not " + typeof t); | |
e.prototype = Object.create(t && t.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0 | |
} | |
}), | |
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) | |
}, q = function(e, t) { | |
if (!e) | |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
return !t || "object" != typeof t && "function" != typeof t ? e : t | |
}, V = function(e, t) { | |
return e.raw = t, | |
e | |
}, W = Object.prototype.toString, U = function(e) { | |
return $(e) ? Object.keys(e) : [] | |
}; | |
function z(t, r) { | |
U(t).forEach(function(e) { | |
return r(t[e], e) | |
}) | |
} | |
function G(r) { | |
for (var e = arguments.length, t = Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) | |
t[n - 1] = arguments[n]; | |
return Object.assign ? Object.assign.apply(Object, [r].concat(t)) : (t.forEach(function(e) { | |
e && z(e, function(e, t) { | |
r[t] = e | |
}) | |
}), | |
r) | |
} | |
function $(e) { | |
return !!e && "object" === (void 0 === e ? "undefined" : F(e)) | |
} | |
function K(e) { | |
return $(e) && "[object Object]" === W.call(e) && e.constructor === Object | |
} | |
var X = void 0 | |
, J = "info" | |
, Q = [] | |
, Y = function(e, t) { | |
var r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !!M && M < 11 | |
, n = X.levels[J] | |
, i = new RegExp("^(" + n + ")$"); | |
if ("log" !== e && t.unshift(e.toUpperCase() + ":"), | |
Q && Q.push([].concat(t)), | |
t.unshift("VIDEOJS:"), | |
p.console) { | |
var o = p.console[e]; | |
o || "debug" !== e || (o = p.console.info || p.console.log), | |
o && n && i.test(e) && (r && (t = t.map(function(t) { | |
if ($(t) || Array.isArray(t)) | |
try { | |
return JSON.stringify(t) | |
} catch (e) { | |
return String(t) | |
} | |
return String(t) | |
}).join(" ")), | |
o.apply ? o[Array.isArray(t) ? "apply" : "call"](p.console, t) : o(t)) | |
} | |
}; | |
(X = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
Y("log", t) | |
} | |
).levels = { | |
all: "debug|log|warn|error", | |
off: "", | |
debug: "debug|log|warn|error", | |
info: "log|warn|error", | |
warn: "warn|error", | |
error: "error", | |
DEFAULT: J | |
}, | |
X.level = function(e) { | |
if ("string" == typeof e) { | |
if (!X.levels.hasOwnProperty(e)) | |
throw new Error('"' + e + '" in not a valid log level'); | |
J = e | |
} | |
return J | |
} | |
, | |
X.history = function() { | |
return Q ? [].concat(Q) : [] | |
} | |
, | |
X.history.clear = function() { | |
Q && (Q.length = 0) | |
} | |
, | |
X.history.disable = function() { | |
null !== Q && (Q.length = 0, | |
Q = null) | |
} | |
, | |
X.history.enable = function() { | |
null === Q && (Q = []) | |
} | |
, | |
X.error = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
return Y("error", t) | |
} | |
, | |
X.warn = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
return Y("warn", t) | |
} | |
, | |
X.debug = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
return Y("debug", t) | |
} | |
; | |
var Z = X; | |
function ee(e, t) { | |
if (!e || !t) | |
return ""; | |
if ("function" != typeof p.getComputedStyle) | |
return e.currentStyle[t] || ""; | |
var r = p.getComputedStyle(e); | |
return r ? r[t] : "" | |
} | |
var te = V(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set ", " to ", "."], ["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set ", " to ", "."]); | |
function re(e) { | |
return "string" == typeof e && /\S/.test(e) | |
} | |
function ne(e) { | |
if (/\s/.test(e)) | |
throw new Error("class has illegal whitespace characters") | |
} | |
function ie() { | |
return f === p.document && void 0 !== f.createElement | |
} | |
function oe(e) { | |
return $(e) && 1 === e.nodeType | |
} | |
function ae() { | |
try { | |
return p.parent !== p.self | |
} catch (e) { | |
return !0 | |
} | |
} | |
function se(n) { | |
return function(e, t) { | |
if (!re(e)) | |
return f[n](null); | |
re(t) && (t = f.querySelector(t)); | |
var r = oe(t) ? t : f; | |
return r[n] && r[n](e) | |
} | |
} | |
function le() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "div" | |
, r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, t = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {} | |
, n = arguments[3] | |
, i = f.createElement(e); | |
return Object.getOwnPropertyNames(r).forEach(function(e) { | |
var t = r[e]; | |
-1 !== e.indexOf("aria-") || "role" === e || "type" === e ? (Z.warn(d(te, e, t)), | |
i.setAttribute(e, t)) : "textContent" === e ? ue(i, t) : i[e] = t | |
}), | |
Object.getOwnPropertyNames(t).forEach(function(e) { | |
i.setAttribute(e, t[e]) | |
}), | |
n && je(i, n), | |
i | |
} | |
function ue(e, t) { | |
return void 0 === e.textContent ? e.innerText = t : e.textContent = t, | |
e | |
} | |
function ce(e, t) { | |
t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e) | |
} | |
function he(e, t) { | |
return ne(t), | |
e.classList ? e.classList.contains(t) : (r = t, | |
new RegExp("(^|\\s)" + r + "($|\\s)")).test(e.className); | |
var r | |
} | |
function de(e, t) { | |
return e.classList ? e.classList.add(t) : he(e, t) || (e.className = (e.className + " " + t).trim()), | |
e | |
} | |
function pe(e, t) { | |
return e.classList ? e.classList.remove(t) : (ne(t), | |
e.className = e.className.split(/\s+/).filter(function(e) { | |
return e !== t | |
}).join(" ")), | |
e | |
} | |
function fe(e, t, r) { | |
var n = he(e, t); | |
if ("function" == typeof r && (r = r(e, t)), | |
"boolean" != typeof r && (r = !n), | |
r !== n) | |
return r ? de(e, t) : pe(e, t), | |
e | |
} | |
function ve(r, n) { | |
Object.getOwnPropertyNames(n).forEach(function(e) { | |
var t = n[e]; | |
null == t || !1 === t ? r.removeAttribute(e) : r.setAttribute(e, !0 === t ? "" : t) | |
}) | |
} | |
function ye(e) { | |
var t = {} | |
, r = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,"; | |
if (e && e.attributes && 0 < e.attributes.length) | |
for (var n = e.attributes, i = n.length - 1; 0 <= i; i--) { | |
var o = n[i].name | |
, a = n[i].value; | |
"boolean" != typeof e[o] && -1 === r.indexOf("," + o + ",") || (a = null !== a), | |
t[o] = a | |
} | |
return t | |
} | |
function me(e, t) { | |
return e.getAttribute(t) | |
} | |
function _e(e, t, r) { | |
e.setAttribute(t, r) | |
} | |
function ge(e, t) { | |
e.removeAttribute(t) | |
} | |
function be() { | |
f.body.focus(), | |
f.onselectstart = function() { | |
return !1 | |
} | |
} | |
function Te() { | |
f.onselectstart = function() { | |
return !0 | |
} | |
} | |
function we(e) { | |
if (e && e.getBoundingClientRect && e.parentNode) { | |
var t = e.getBoundingClientRect() | |
, r = {}; | |
return ["bottom", "height", "left", "right", "top", "width"].forEach(function(e) { | |
void 0 !== t[e] && (r[e] = t[e]) | |
}), | |
r.height || (r.height = parseFloat(ee(e, "height"))), | |
r.width || (r.width = parseFloat(ee(e, "width"))), | |
r | |
} | |
} | |
function ke(e) { | |
var t = void 0; | |
if (e.getBoundingClientRect && e.parentNode && (t = e.getBoundingClientRect()), | |
!t) | |
return { | |
left: 0, | |
top: 0 | |
}; | |
var r = f.documentElement | |
, n = f.body | |
, i = r.clientLeft || n.clientLeft || 0 | |
, o = p.pageXOffset || n.scrollLeft | |
, a = t.left + o - i | |
, s = r.clientTop || n.clientTop || 0 | |
, l = p.pageYOffset || n.scrollTop | |
, u = t.top + l - s; | |
return { | |
left: Math.round(a), | |
top: Math.round(u) | |
} | |
} | |
function Se(e, t) { | |
var r = {} | |
, n = ke(e) | |
, i = e.offsetWidth | |
, o = e.offsetHeight | |
, a = n.top | |
, s = n.left | |
, l = t.pageY | |
, u = t.pageX; | |
return t.changedTouches && (u = t.changedTouches[0].pageX, | |
l = t.changedTouches[0].pageY), | |
r.y = Math.max(0, Math.min(1, (a - l + o) / o)), | |
r.x = Math.max(0, Math.min(1, (u - s) / i)), | |
r | |
} | |
function Ce(e) { | |
return $(e) && 3 === e.nodeType | |
} | |
function Ee(e) { | |
for (; e.firstChild; ) | |
e.removeChild(e.firstChild); | |
return e | |
} | |
function xe(e) { | |
return "function" == typeof e && (e = e()), | |
(Array.isArray(e) ? e : [e]).map(function(e) { | |
return "function" == typeof e && (e = e()), | |
oe(e) || Ce(e) ? e : "string" == typeof e && /\S/.test(e) ? f.createTextNode(e) : void 0 | |
}).filter(function(e) { | |
return e | |
}) | |
} | |
function je(t, e) { | |
return xe(e).forEach(function(e) { | |
return t.appendChild(e) | |
}), | |
t | |
} | |
function Pe(e, t) { | |
return je(Ee(e), t) | |
} | |
function Oe(e) { | |
return void 0 === e.button && void 0 === e.buttons || (0 === e.button && void 0 === e.buttons || (9 === M || 0 === e.button && 1 === e.buttons)) | |
} | |
var Ae = se("querySelector") | |
, Me = se("querySelectorAll") | |
, De = (Object.freeze || Object)({ | |
isReal: ie, | |
isEl: oe, | |
isInFrame: ae, | |
createEl: le, | |
textContent: ue, | |
prependTo: ce, | |
hasClass: he, | |
addClass: de, | |
removeClass: pe, | |
toggleClass: fe, | |
setAttributes: ve, | |
getAttributes: ye, | |
getAttribute: me, | |
setAttribute: _e, | |
removeAttribute: ge, | |
blockTextSelection: be, | |
unblockTextSelection: Te, | |
getBoundingClientRect: we, | |
findPosition: ke, | |
getPointerPosition: Se, | |
isTextNode: Ce, | |
emptyEl: Ee, | |
normalizeContent: xe, | |
appendContent: je, | |
insertContent: Pe, | |
isSingleLeftClick: Oe, | |
$: Ae, | |
$$: Me | |
}) | |
, Ie = 1; | |
function Re() { | |
return Ie++ | |
} | |
var Ne = {} | |
, Le = "vdata" + (new Date).getTime(); | |
function Fe(e) { | |
var t = e[Le]; | |
return t || (t = e[Le] = Re()), | |
Ne[t] || (Ne[t] = {}), | |
Ne[t] | |
} | |
function Be(e) { | |
var t = e[Le]; | |
return !!t && !!Object.getOwnPropertyNames(Ne[t]).length | |
} | |
function He(t) { | |
var e = t[Le]; | |
if (e) { | |
delete Ne[e]; | |
try { | |
delete t[Le] | |
} catch (e) { | |
t.removeAttribute ? t.removeAttribute(Le) : t[Le] = null | |
} | |
} | |
} | |
function qe(e, t) { | |
var r = Fe(e); | |
0 === r.handlers[t].length && (delete r.handlers[t], | |
e.removeEventListener ? e.removeEventListener(t, r.dispatcher, !1) : e.detachEvent && e.detachEvent("on" + t, r.dispatcher)), | |
Object.getOwnPropertyNames(r.handlers).length <= 0 && (delete r.handlers, | |
delete r.dispatcher, | |
delete r.disabled), | |
0 === Object.getOwnPropertyNames(r).length && He(e) | |
} | |
function Ve(t, r, e, n) { | |
e.forEach(function(e) { | |
t(r, e, n) | |
}) | |
} | |
function We(e) { | |
function t() { | |
return !0 | |
} | |
function r() { | |
return !1 | |
} | |
if (!e || !e.isPropagationStopped) { | |
var n = e || p.event; | |
for (var i in e = {}, | |
n) | |
"layerX" !== i && "layerY" !== i && "keyLocation" !== i && "webkitMovementX" !== i && "webkitMovementY" !== i && ("returnValue" === i && n.preventDefault || (e[i] = n[i])); | |
if (e.target || (e.target = e.srcElement || f), | |
e.relatedTarget || (e.relatedTarget = e.fromElement === e.target ? e.toElement : e.fromElement), | |
e.preventDefault = function() { | |
n.preventDefault && n.preventDefault(), | |
e.returnValue = !1, | |
n.returnValue = !1, | |
e.defaultPrevented = !0 | |
} | |
, | |
e.defaultPrevented = !1, | |
e.stopPropagation = function() { | |
n.stopPropagation && n.stopPropagation(), | |
e.cancelBubble = !0, | |
n.cancelBubble = !0, | |
e.isPropagationStopped = t | |
} | |
, | |
e.isPropagationStopped = r, | |
e.stopImmediatePropagation = function() { | |
n.stopImmediatePropagation && n.stopImmediatePropagation(), | |
e.isImmediatePropagationStopped = t, | |
e.stopPropagation() | |
} | |
, | |
e.isImmediatePropagationStopped = r, | |
null !== e.clientX && void 0 !== e.clientX) { | |
var o = f.documentElement | |
, a = f.body; | |
e.pageX = e.clientX + (o && o.scrollLeft || a && a.scrollLeft || 0) - (o && o.clientLeft || a && a.clientLeft || 0), | |
e.pageY = e.clientY + (o && o.scrollTop || a && a.scrollTop || 0) - (o && o.clientTop || a && a.clientTop || 0) | |
} | |
e.which = e.charCode || e.keyCode, | |
null !== e.button && void 0 !== e.button && (e.button = 1 & e.button ? 0 : 4 & e.button ? 1 : 2 & e.button ? 2 : 0) | |
} | |
return e | |
} | |
var Ue = !1; | |
!function() { | |
try { | |
var e = Object.defineProperty({}, "passive", { | |
get: function() { | |
Ue = !0 | |
} | |
}); | |
p.addEventListener("test", null, e), | |
p.removeEventListener("test", null, e) | |
} catch (e) {} | |
}(); | |
var ze = ["touchstart", "touchmove"]; | |
function Ge(a, e, t) { | |
if (Array.isArray(e)) | |
return Ve(Ge, a, e, t); | |
var s = Fe(a); | |
if (s.handlers || (s.handlers = {}), | |
s.handlers[e] || (s.handlers[e] = []), | |
t.guid || (t.guid = Re()), | |
s.handlers[e].push(t), | |
s.dispatcher || (s.disabled = !1, | |
s.dispatcher = function(e, t) { | |
if (!s.disabled) { | |
e = We(e); | |
var r = s.handlers[e.type]; | |
if (r) | |
for (var n = r.slice(0), i = 0, o = n.length; i < o && !e.isImmediatePropagationStopped(); i++) | |
try { | |
n[i].call(a, e, t) | |
} catch (e) { | |
Z.error(e) | |
} | |
} | |
} | |
), | |
1 === s.handlers[e].length) | |
if (a.addEventListener) { | |
var r = !1; | |
Ue && -1 < ze.indexOf(e) && (r = { | |
passive: !0 | |
}), | |
a.addEventListener(e, s.dispatcher, r) | |
} else | |
a.attachEvent && a.attachEvent("on" + e, s.dispatcher) | |
} | |
function $e(e, t, r) { | |
if (Be(e)) { | |
var n = Fe(e); | |
if (n.handlers) { | |
if (Array.isArray(t)) | |
return Ve($e, e, t, r); | |
var i = function(e, t) { | |
n.handlers[t] = [], | |
qe(e, t) | |
}; | |
if (void 0 !== t) { | |
var o = n.handlers[t]; | |
if (o) | |
if (r) { | |
if (r.guid) | |
for (var a = 0; a < o.length; a++) | |
o[a].guid === r.guid && o.splice(a--, 1); | |
qe(e, t) | |
} else | |
i(e, t) | |
} else | |
for (var s in n.handlers) | |
Object.prototype.hasOwnProperty.call(n.handlers || {}, s) && i(e, s) | |
} | |
} | |
} | |
function Ke(e, t, r) { | |
var n = Be(e) ? Fe(e) : {} | |
, i = e.parentNode || e.ownerDocument; | |
if ("string" == typeof t ? t = { | |
type: t, | |
target: e | |
} : t.target || (t.target = e), | |
t = We(t), | |
n.dispatcher && n.dispatcher.call(e, t, r), | |
i && !t.isPropagationStopped() && !0 === t.bubbles) | |
Ke.call(null, i, t, r); | |
else if (!i && !t.defaultPrevented) { | |
var o = Fe(t.target); | |
t.target[t.type] && (o.disabled = !0, | |
"function" == typeof t.target[t.type] && t.target[t.type](), | |
o.disabled = !1) | |
} | |
return !t.defaultPrevented | |
} | |
function Xe(t, r, n) { | |
if (Array.isArray(r)) | |
return Ve(Xe, t, r, n); | |
var e = function e() { | |
$e(t, r, e), | |
n.apply(this, arguments) | |
}; | |
e.guid = n.guid = n.guid || Re(), | |
Ge(t, r, e) | |
} | |
var Je = (Object.freeze || Object)({ | |
fixEvent: We, | |
on: Ge, | |
off: $e, | |
trigger: Ke, | |
one: Xe | |
}) | |
, Qe = !1 | |
, Ye = void 0 | |
, Ze = function() { | |
if (ie() && !1 !== Ye.options.autoSetup) { | |
var e = f.getElementsByTagName("video") | |
, t = f.getElementsByTagName("audio") | |
, r = f.getElementsByTagName("video-js") | |
, n = []; | |
if (e && 0 < e.length) | |
for (var i = 0, o = e.length; i < o; i++) | |
n.push(e[i]); | |
if (t && 0 < t.length) | |
for (var a = 0, s = t.length; a < s; a++) | |
n.push(t[a]); | |
if (r && 0 < r.length) | |
for (var l = 0, u = r.length; l < u; l++) | |
n.push(r[l]); | |
if (n && 0 < n.length) | |
for (var c = 0, h = n.length; c < h; c++) { | |
var d = n[c]; | |
if (!d || !d.getAttribute) { | |
et(1); | |
break | |
} | |
void 0 === d.player && null !== d.getAttribute("data-setup") && Ye(d) | |
} | |
else | |
Qe || et(1) | |
} | |
}; | |
function et(e, t) { | |
t && (Ye = t), | |
p.setTimeout(Ze, e) | |
} | |
ie() && "complete" === f.readyState ? Qe = !0 : Xe(p, "load", function() { | |
Qe = !0 | |
}); | |
var tt = function(e) { | |
var t = f.createElement("style"); | |
return t.className = e, | |
t | |
} | |
, rt = function(e, t) { | |
e.styleSheet ? e.styleSheet.cssText = t : e.textContent = t | |
} | |
, nt = function(e, t, r) { | |
t.guid || (t.guid = Re()); | |
var n = function() { | |
return t.apply(e, arguments) | |
}; | |
return n.guid = r ? r + "_" + t.guid : t.guid, | |
n | |
} | |
, it = function(t, r) { | |
var n = Date.now(); | |
return function() { | |
var e = Date.now(); | |
r <= e - n && (t.apply(void 0, arguments), | |
n = e) | |
} | |
} | |
, ot = function() {}; | |
ot.prototype.allowedEvents_ = {}, | |
ot.prototype.addEventListener = ot.prototype.on = function(e, t) { | |
var r = this.addEventListener; | |
this.addEventListener = function() {} | |
, | |
Ge(this, e, t), | |
this.addEventListener = r | |
} | |
, | |
ot.prototype.removeEventListener = ot.prototype.off = function(e, t) { | |
$e(this, e, t) | |
} | |
, | |
ot.prototype.one = function(e, t) { | |
var r = this.addEventListener; | |
this.addEventListener = function() {} | |
, | |
Xe(this, e, t), | |
this.addEventListener = r | |
} | |
, | |
ot.prototype.dispatchEvent = ot.prototype.trigger = function(e) { | |
var t = e.type || e; | |
"string" == typeof e && (e = { | |
type: t | |
}), | |
e = We(e), | |
this.allowedEvents_[t] && this["on" + t] && this["on" + t](e), | |
Ke(this, e) | |
} | |
; | |
var at = function(t) { | |
return t instanceof ot || !!t.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(e) { | |
return "function" == typeof t[e] | |
}) | |
} | |
, st = function(e) { | |
return "string" == typeof e && /\S/.test(e) || Array.isArray(e) && !!e.length | |
} | |
, lt = function(e) { | |
if (!e.nodeName && !at(e)) | |
throw new Error("Invalid target; must be a DOM node or evented object.") | |
} | |
, ut = function(e) { | |
if (!st(e)) | |
throw new Error("Invalid event type; must be a non-empty string or array.") | |
} | |
, ct = function(e) { | |
if ("function" != typeof e) | |
throw new Error("Invalid listener; must be a function.") | |
} | |
, ht = function(e, t) { | |
var r = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_ | |
, n = void 0 | |
, i = void 0 | |
, o = void 0; | |
return o = r ? (n = e.eventBusEl_, | |
3 <= t.length && t.shift(), | |
i = t[0], | |
t[1]) : (n = t[0], | |
i = t[1], | |
t[2]), | |
lt(n), | |
ut(i), | |
ct(o), | |
{ | |
isTargetingSelf: r, | |
target: n, | |
type: i, | |
listener: o = nt(e, o) | |
} | |
} | |
, dt = function(e, t, r, n) { | |
lt(e), | |
e.nodeName ? Je[t](e, r, n) : e[t](r, n) | |
} | |
, pt = { | |
on: function() { | |
for (var e = this, t = arguments.length, r = Array(t), n = 0; n < t; n++) | |
r[n] = arguments[n]; | |
var i = ht(this, r) | |
, o = i.isTargetingSelf | |
, a = i.target | |
, s = i.type | |
, l = i.listener; | |
if (dt(a, "on", s, l), | |
!o) { | |
var u = function() { | |
return e.off(a, s, l) | |
}; | |
u.guid = l.guid; | |
var c = function() { | |
return e.off("dispose", u) | |
}; | |
c.guid = l.guid, | |
dt(this, "on", "dispose", u), | |
dt(a, "on", "dispose", c) | |
} | |
}, | |
one: function() { | |
for (var i = this, e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
var n = ht(this, t) | |
, o = n.isTargetingSelf | |
, a = n.target | |
, s = n.type | |
, l = n.listener; | |
if (o) | |
dt(a, "one", s, l); | |
else { | |
var u = function e() { | |
for (var t = arguments.length, r = Array(t), n = 0; n < t; n++) | |
r[n] = arguments[n]; | |
i.off(a, s, e), | |
l.apply(null, r) | |
}; | |
u.guid = l.guid, | |
dt(a, "one", s, u) | |
} | |
}, | |
off: function(e, t, r) { | |
if (!e || st(e)) | |
$e(this.eventBusEl_, e, t); | |
else { | |
var n = e | |
, i = t; | |
lt(n), | |
ut(i), | |
ct(r), | |
r = nt(this, r), | |
this.off("dispose", r), | |
n.nodeName ? ($e(n, i, r), | |
$e(n, "dispose", r)) : at(n) && (n.off(i, r), | |
n.off("dispose", r)) | |
} | |
}, | |
trigger: function(e, t) { | |
return Ke(this.eventBusEl_, e, t) | |
} | |
}; | |
function ft(e) { | |
var t = (1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}).eventBusKey; | |
if (t) { | |
if (!e[t].nodeName) | |
throw new Error('The eventBusKey "' + t + '" does not refer to an element.'); | |
e.eventBusEl_ = e[t] | |
} else | |
e.eventBusEl_ = le("span", { | |
className: "vjs-event-bus" | |
}); | |
return G(e, pt), | |
e.on("dispose", function() { | |
e.off(), | |
p.setTimeout(function() { | |
e.eventBusEl_ = null | |
}, 0) | |
}), | |
e | |
} | |
var vt = { | |
state: {}, | |
setState: function(e) { | |
var r = this; | |
"function" == typeof e && (e = e()); | |
var n = void 0; | |
return z(e, function(e, t) { | |
r.state[t] !== e && ((n = n || {})[t] = { | |
from: r.state[t], | |
to: e | |
}), | |
r.state[t] = e | |
}), | |
n && at(this) && this.trigger({ | |
changes: n, | |
type: "statechanged" | |
}), | |
n | |
} | |
}; | |
function yt(e, t) { | |
return G(e, vt), | |
e.state = G({}, e.state, t), | |
"function" == typeof e.handleStateChanged && at(e) && e.on("statechanged", e.handleStateChanged), | |
e | |
} | |
function mt(e) { | |
return "string" != typeof e ? e : e.charAt(0).toUpperCase() + e.slice(1) | |
} | |
function _t() { | |
for (var r = {}, e = arguments.length, t = Array(e), n = 0; n < e; n++) | |
t[n] = arguments[n]; | |
return t.forEach(function(e) { | |
e && z(e, function(e, t) { | |
K(e) ? (K(r[t]) || (r[t] = {}), | |
r[t] = _t(r[t], e)) : r[t] = e | |
}) | |
}), | |
r | |
} | |
var gt = function() { | |
function u(e, t, r) { | |
if (B(this, u), | |
!e && this.play ? this.player_ = e = this : this.player_ = e, | |
this.options_ = _t({}, this.options_), | |
t = this.options_ = _t(this.options_, t), | |
this.id_ = t.id || t.el && t.el.id, | |
!this.id_) { | |
var n = e && e.id && e.id() || "no_player"; | |
this.id_ = n + "_component_" + Re() | |
} | |
this.name_ = t.name || null, | |
t.el ? this.el_ = t.el : !1 !== t.createEl && (this.el_ = this.createEl()), | |
!1 !== t.evented && ft(this, { | |
eventBusKey: this.el_ ? "el_" : null | |
}), | |
yt(this, this.constructor.defaultState), | |
this.children_ = [], | |
this.childIndex_ = {}, | |
!(this.childNameIndex_ = {}) !== t.initChildren && this.initChildren(), | |
this.ready(r), | |
!1 !== t.reportTouchActivity && this.enableTouchActivity() | |
} | |
return u.prototype.dispose = function() { | |
if (this.trigger({ | |
type: "dispose", | |
bubbles: !1 | |
}), | |
this.children_) | |
for (var e = this.children_.length - 1; 0 <= e; e--) | |
this.children_[e].dispose && this.children_[e].dispose(); | |
this.children_ = null, | |
this.childIndex_ = null, | |
this.childNameIndex_ = null, | |
this.el_ && (this.el_.parentNode && this.el_.parentNode.removeChild(this.el_), | |
He(this.el_), | |
this.el_ = null), | |
this.player_ = null | |
} | |
, | |
u.prototype.player = function() { | |
return this.player_ | |
} | |
, | |
u.prototype.options = function(e) { | |
return Z.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"), | |
e && (this.options_ = _t(this.options_, e)), | |
this.options_ | |
} | |
, | |
u.prototype.el = function() { | |
return this.el_ | |
} | |
, | |
u.prototype.createEl = function(e, t, r) { | |
return le(e, t, r) | |
} | |
, | |
u.prototype.localize = function(e, i) { | |
var t = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : e | |
, r = this.player_.language && this.player_.language() | |
, n = this.player_.languages && this.player_.languages() | |
, o = n && n[r] | |
, a = r && r.split("-")[0] | |
, s = n && n[a] | |
, l = t; | |
return o && o[e] ? l = o[e] : s && s[e] && (l = s[e]), | |
i && (l = l.replace(/\{(\d+)\}/g, function(e, t) { | |
var r = i[t - 1] | |
, n = r; | |
return void 0 === r && (n = e), | |
n | |
})), | |
l | |
} | |
, | |
u.prototype.contentEl = function() { | |
return this.contentEl_ || this.el_ | |
} | |
, | |
u.prototype.id = function() { | |
return this.id_ | |
} | |
, | |
u.prototype.name = function() { | |
return this.name_ | |
} | |
, | |
u.prototype.children = function() { | |
return this.children_ | |
} | |
, | |
u.prototype.getChildById = function(e) { | |
return this.childIndex_[e] | |
} | |
, | |
u.prototype.getChild = function(e) { | |
if (e) | |
return e = mt(e), | |
this.childNameIndex_[e] | |
} | |
, | |
u.prototype.addChild = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : this.children_.length | |
, n = void 0 | |
, i = void 0; | |
if ("string" == typeof e) { | |
i = mt(e); | |
var o = t.componentClass || i; | |
t.name = i; | |
var a = u.getComponent(o); | |
if (!a) | |
throw new Error("Component " + o + " does not exist"); | |
if ("function" != typeof a) | |
return null; | |
n = new a(this.player_ || this,t) | |
} else | |
n = e; | |
if (this.children_.splice(r, 0, n), | |
"function" == typeof n.id && (this.childIndex_[n.id()] = n), | |
(i = i || n.name && mt(n.name())) && (this.childNameIndex_[i] = n), | |
"function" == typeof n.el && n.el()) { | |
var s = this.contentEl().children[r] || null; | |
this.contentEl().insertBefore(n.el(), s) | |
} | |
return n | |
} | |
, | |
u.prototype.removeChild = function(e) { | |
if ("string" == typeof e && (e = this.getChild(e)), | |
e && this.children_) { | |
for (var t = !1, r = this.children_.length - 1; 0 <= r; r--) | |
if (this.children_[r] === e) { | |
t = !0, | |
this.children_.splice(r, 1); | |
break | |
} | |
if (t) { | |
this.childIndex_[e.id()] = null, | |
this.childNameIndex_[e.name()] = null; | |
var n = e.el(); | |
n && n.parentNode === this.contentEl() && this.contentEl().removeChild(e.el()) | |
} | |
} | |
} | |
, | |
u.prototype.initChildren = function() { | |
var i = this | |
, n = this.options_.children; | |
if (n) { | |
var o = this.options_ | |
, e = void 0 | |
, r = u.getComponent("Tech"); | |
(e = Array.isArray(n) ? n : Object.keys(n)).concat(Object.keys(this.options_).filter(function(t) { | |
return !e.some(function(e) { | |
return "string" == typeof e ? t === e : t === e.name | |
}) | |
})).map(function(e) { | |
var t = void 0 | |
, r = void 0; | |
return r = "string" == typeof e ? n[t = e] || i.options_[t] || {} : (t = e.name, | |
e), | |
{ | |
name: t, | |
opts: r | |
} | |
}).filter(function(e) { | |
var t = u.getComponent(e.opts.componentClass || mt(e.name)); | |
return t && !r.isTech(t) | |
}).forEach(function(e) { | |
var t = e.name | |
, r = e.opts; | |
if (void 0 !== o[t] && (r = o[t]), | |
!1 !== r) { | |
!0 === r && (r = {}), | |
r.playerOptions = i.options_.playerOptions; | |
var n = i.addChild(t, r); | |
n && (i[t] = n) | |
} | |
}) | |
} | |
} | |
, | |
u.prototype.buildCSSClass = function() { | |
return "" | |
} | |
, | |
u.prototype.ready = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1]; | |
if (e) | |
return this.isReady_ ? void (t ? e.call(this) : this.setTimeout(e, 1)) : (this.readyQueue_ = this.readyQueue_ || [], | |
void this.readyQueue_.push(e)) | |
} | |
, | |
u.prototype.triggerReady = function() { | |
this.isReady_ = !0, | |
this.setTimeout(function() { | |
var e = this.readyQueue_; | |
this.readyQueue_ = [], | |
e && 0 < e.length && e.forEach(function(e) { | |
e.call(this) | |
}, this), | |
this.trigger("ready") | |
}, 1) | |
} | |
, | |
u.prototype.$ = function(e, t) { | |
return Ae(e, t || this.contentEl()) | |
} | |
, | |
u.prototype.$$ = function(e, t) { | |
return Me(e, t || this.contentEl()) | |
} | |
, | |
u.prototype.hasClass = function(e) { | |
return he(this.el_, e) | |
} | |
, | |
u.prototype.addClass = function(e) { | |
de(this.el_, e) | |
} | |
, | |
u.prototype.removeClass = function(e) { | |
pe(this.el_, e) | |
} | |
, | |
u.prototype.toggleClass = function(e, t) { | |
fe(this.el_, e, t) | |
} | |
, | |
u.prototype.show = function() { | |
this.removeClass("vjs-hidden") | |
} | |
, | |
u.prototype.hide = function() { | |
this.addClass("vjs-hidden") | |
} | |
, | |
u.prototype.lockShowing = function() { | |
this.addClass("vjs-lock-showing") | |
} | |
, | |
u.prototype.unlockShowing = function() { | |
this.removeClass("vjs-lock-showing") | |
} | |
, | |
u.prototype.getAttribute = function(e) { | |
return me(this.el_, e) | |
} | |
, | |
u.prototype.setAttribute = function(e, t) { | |
_e(this.el_, e, t) | |
} | |
, | |
u.prototype.removeAttribute = function(e) { | |
ge(this.el_, e) | |
} | |
, | |
u.prototype.width = function(e, t) { | |
return this.dimension("width", e, t) | |
} | |
, | |
u.prototype.height = function(e, t) { | |
return this.dimension("height", e, t) | |
} | |
, | |
u.prototype.dimensions = function(e, t) { | |
this.width(e, !0), | |
this.height(t) | |
} | |
, | |
u.prototype.dimension = function(e, t, r) { | |
if (void 0 !== t) | |
return null !== t && t == t || (t = 0), | |
-1 !== ("" + t).indexOf("%") || -1 !== ("" + t).indexOf("px") ? this.el_.style[e] = t : this.el_.style[e] = "auto" === t ? "" : t + "px", | |
void (r || this.trigger("componentresize")); | |
if (!this.el_) | |
return 0; | |
var n = this.el_.style[e] | |
, i = n.indexOf("px"); | |
return -1 !== i ? parseInt(n.slice(0, i), 10) : parseInt(this.el_["offset" + mt(e)], 10) | |
} | |
, | |
u.prototype.currentDimension = function(e) { | |
var t = 0; | |
if ("width" !== e && "height" !== e) | |
throw new Error("currentDimension only accepts width or height value"); | |
if ("function" == typeof p.getComputedStyle) { | |
var r = p.getComputedStyle(this.el_); | |
t = r.getPropertyValue(e) || r[e] | |
} | |
if (0 === (t = parseFloat(t))) { | |
var n = "offset" + mt(e); | |
t = this.el_[n] | |
} | |
return t | |
} | |
, | |
u.prototype.currentDimensions = function() { | |
return { | |
width: this.currentDimension("width"), | |
height: this.currentDimension("height") | |
} | |
} | |
, | |
u.prototype.currentWidth = function() { | |
return this.currentDimension("width") | |
} | |
, | |
u.prototype.currentHeight = function() { | |
return this.currentDimension("height") | |
} | |
, | |
u.prototype.focus = function() { | |
this.el_.focus() | |
} | |
, | |
u.prototype.blur = function() { | |
this.el_.blur() | |
} | |
, | |
u.prototype.emitTapEvents = function() { | |
var t = 0 | |
, n = null | |
, i = void 0; | |
this.on("touchstart", function(e) { | |
1 === e.touches.length && (n = { | |
pageX: e.touches[0].pageX, | |
pageY: e.touches[0].pageY | |
}, | |
t = (new Date).getTime(), | |
i = !0) | |
}), | |
this.on("touchmove", function(e) { | |
if (1 < e.touches.length) | |
i = !1; | |
else if (n) { | |
var t = e.touches[0].pageX - n.pageX | |
, r = e.touches[0].pageY - n.pageY; | |
10 < Math.sqrt(t * t + r * r) && (i = !1) | |
} | |
}); | |
var e = function() { | |
i = !1 | |
}; | |
this.on("touchleave", e), | |
this.on("touchcancel", e), | |
this.on("touchend", function(e) { | |
!(n = null) === i && ((new Date).getTime() - t < 200 && (e.preventDefault(), | |
this.trigger("tap"))) | |
}) | |
} | |
, | |
u.prototype.enableTouchActivity = function() { | |
if (this.player() && this.player().reportUserActivity) { | |
var t = nt(this.player(), this.player().reportUserActivity) | |
, r = void 0; | |
this.on("touchstart", function() { | |
t(), | |
this.clearInterval(r), | |
r = this.setInterval(t, 250) | |
}); | |
var e = function(e) { | |
t(), | |
this.clearInterval(r) | |
}; | |
this.on("touchmove", t), | |
this.on("touchend", e), | |
this.on("touchcancel", e) | |
} | |
} | |
, | |
u.prototype.setTimeout = function(e, t) { | |
var r, n, i = this; | |
return e = nt(this, e), | |
r = p.setTimeout(function() { | |
i.off("dispose", n), | |
e() | |
}, t), | |
(n = function() { | |
return i.clearTimeout(r) | |
} | |
).guid = "vjs-timeout-" + r, | |
this.on("dispose", n), | |
r | |
} | |
, | |
u.prototype.clearTimeout = function(e) { | |
p.clearTimeout(e); | |
var t = function() {}; | |
return t.guid = "vjs-timeout-" + e, | |
this.off("dispose", t), | |
e | |
} | |
, | |
u.prototype.setInterval = function(e, t) { | |
var r = this; | |
e = nt(this, e); | |
var n = p.setInterval(e, t) | |
, i = function() { | |
return r.clearInterval(n) | |
}; | |
return i.guid = "vjs-interval-" + n, | |
this.on("dispose", i), | |
n | |
} | |
, | |
u.prototype.clearInterval = function(e) { | |
p.clearInterval(e); | |
var t = function() {}; | |
return t.guid = "vjs-interval-" + e, | |
this.off("dispose", t), | |
e | |
} | |
, | |
u.prototype.requestAnimationFrame = function(e) { | |
var t, r, n = this; | |
return this.supportsRaf_ ? (e = nt(this, e), | |
t = p.requestAnimationFrame(function() { | |
n.off("dispose", r), | |
e() | |
}), | |
(r = function() { | |
return n.cancelAnimationFrame(t) | |
} | |
).guid = "vjs-raf-" + t, | |
this.on("dispose", r), | |
t) : this.setTimeout(e, 1e3 / 60) | |
} | |
, | |
u.prototype.cancelAnimationFrame = function(e) { | |
if (this.supportsRaf_) { | |
p.cancelAnimationFrame(e); | |
var t = function() {}; | |
return t.guid = "vjs-raf-" + e, | |
this.off("dispose", t), | |
e | |
} | |
return this.clearTimeout(e) | |
} | |
, | |
u.registerComponent = function(e, t) { | |
if ("string" != typeof e || !e) | |
throw new Error('Illegal component name, "' + e + '"; must be a non-empty string.'); | |
var r = u.getComponent("Tech") | |
, n = r && r.isTech(t) | |
, i = u === t || u.prototype.isPrototypeOf(t.prototype); | |
if (n || !i) { | |
var o = void 0; | |
throw o = n ? "techs must be registered using Tech.registerTech()" : "must be a Component subclass", | |
new Error('Illegal component, "' + e + '"; ' + o + ".") | |
} | |
e = mt(e), | |
u.components_ || (u.components_ = {}); | |
var a = u.getComponent("Player"); | |
if ("Player" === e && a && a.players) { | |
var s = a.players | |
, l = Object.keys(s); | |
if (s && 0 < l.length && l.map(function(e) { | |
return s[e] | |
}).every(Boolean)) | |
throw new Error("Can not register Player component after player has been created.") | |
} | |
return u.components_[e] = t | |
} | |
, | |
u.getComponent = function(e) { | |
if (e) | |
return e = mt(e), | |
u.components_ && u.components_[e] ? u.components_[e] : void 0 | |
} | |
, | |
u | |
}(); | |
function bt(e, t, r, n) { | |
return function(e, t, r) { | |
if ("number" != typeof t || t < 0 || r < t) | |
throw new Error("Failed to execute '" + e + "' on 'TimeRanges': The index provided (" + t + ") is non-numeric or out of bounds (0-" + r + ").") | |
}(e, n, r.length - 1), | |
r[n][t] | |
} | |
function Tt(e) { | |
return void 0 === e || 0 === e.length ? { | |
length: 0, | |
start: function() { | |
throw new Error("This TimeRanges object is empty") | |
}, | |
end: function() { | |
throw new Error("This TimeRanges object is empty") | |
} | |
} : { | |
length: e.length, | |
start: bt.bind(null, "start", 0, e), | |
end: bt.bind(null, "end", 1, e) | |
} | |
} | |
function wt(e, t) { | |
return Array.isArray(e) ? Tt(e) : void 0 === e || void 0 === t ? Tt() : Tt([[e, t]]) | |
} | |
function kt(e, t) { | |
var r = 0 | |
, n = void 0 | |
, i = void 0; | |
if (!t) | |
return 0; | |
e && e.length || (e = wt(0, 0)); | |
for (var o = 0; o < e.length; o++) | |
n = e.start(o), | |
t < (i = e.end(o)) && (i = t), | |
r += i - n; | |
return r / t | |
} | |
gt.prototype.supportsRaf_ = "function" == typeof p.requestAnimationFrame && "function" == typeof p.cancelAnimationFrame, | |
gt.registerComponent("Component", gt); | |
for (var St = {}, Ct = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]], Et = Ct[0], xt = void 0, jt = 0; jt < Ct.length; jt++) | |
if (Ct[jt][1]in f) { | |
xt = Ct[jt]; | |
break | |
} | |
if (xt) | |
for (var Pt = 0; Pt < xt.length; Pt++) | |
St[Et[Pt]] = xt[Pt]; | |
function Ot(e) { | |
if (e instanceof Ot) | |
return e; | |
"number" == typeof e ? this.code = e : "string" == typeof e ? this.message = e : $(e) && ("number" == typeof e.code && (this.code = e.code), | |
G(this, e)), | |
this.message || (this.message = Ot.defaultMessages[this.code] || "") | |
} | |
Ot.prototype.code = 0, | |
Ot.prototype.message = "", | |
Ot.prototype.status = null, | |
Ot.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"], | |
Ot.defaultMessages = { | |
1: "You aborted the media playback", | |
2: "A network error caused the media download to fail part-way.", | |
3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.", | |
4: "The media could not be loaded, either because the server or network failed or because the format is not supported.", | |
5: "The media is encrypted and we do not have the keys to decrypt it." | |
}; | |
for (var At = 0; At < Ot.errorTypes.length; At++) | |
Ot[Ot.errorTypes[At]] = At, | |
Ot.prototype[Ot.errorTypes[At]] = At; | |
function Mt(e) { | |
return null != e && "function" == typeof e.then | |
} | |
function Dt(e) { | |
Mt(e) && e.then(null, function(e) {}) | |
} | |
var It = function(n) { | |
return ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(e, t, r) { | |
return n[t] && (e[t] = n[t]), | |
e | |
}, { | |
cues: n.cues && Array.prototype.map.call(n.cues, function(e) { | |
return { | |
startTime: e.startTime, | |
endTime: e.endTime, | |
text: e.text, | |
id: e.id | |
} | |
}) | |
}) | |
} | |
, Rt = function(e) { | |
var t = e.$$("track") | |
, r = Array.prototype.map.call(t, function(e) { | |
return e.track | |
}); | |
return Array.prototype.map.call(t, function(e) { | |
var t = It(e.track); | |
return e.src && (t.src = e.src), | |
t | |
}).concat(Array.prototype.filter.call(e.textTracks(), function(e) { | |
return -1 === r.indexOf(e) | |
}).map(It)) | |
} | |
, Nt = function(e, r) { | |
return e.forEach(function(e) { | |
var t = r.addRemoteTextTrack(e).track; | |
!e.src && e.cues && e.cues.forEach(function(e) { | |
return t.addCue(e) | |
}) | |
}), | |
r.textTracks() | |
} | |
, Lt = "vjs-modal-dialog" | |
, Ft = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.opened_ = r.hasBeenOpened_ = r.hasBeenFilled_ = !1, | |
r.closeable(!r.options_.uncloseable), | |
r.content(r.options_.content), | |
r.contentEl_ = le("div", { | |
className: Lt + "-content" | |
}, { | |
role: "document" | |
}), | |
r.descEl_ = le("p", { | |
className: Lt + "-description vjs-control-text", | |
id: r.el().getAttribute("aria-describedby") | |
}), | |
ue(r.descEl_, r.description()), | |
r.el_.appendChild(r.descEl_), | |
r.el_.appendChild(r.contentEl_), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: this.buildCSSClass(), | |
tabIndex: -1 | |
}, { | |
"aria-describedby": this.id() + "_description", | |
"aria-hidden": "true", | |
"aria-label": this.label(), | |
role: "dialog" | |
}) | |
} | |
, | |
i.prototype.dispose = function() { | |
this.contentEl_ = null, | |
this.descEl_ = null, | |
this.previouslyActiveEl_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.buildCSSClass = function() { | |
return Lt + " vjs-hidden " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.handleKeyPress = function(e) { | |
27 === e.which && this.closeable() && this.close() | |
} | |
, | |
i.prototype.label = function() { | |
return this.localize(this.options_.label || "Modal Window") | |
} | |
, | |
i.prototype.description = function() { | |
var e = this.options_.description || this.localize("This is a modal window."); | |
return this.closeable() && (e += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.")), | |
e | |
} | |
, | |
i.prototype.open = function() { | |
if (!this.opened_) { | |
var e = this.player(); | |
this.trigger("beforemodalopen"), | |
this.opened_ = !0, | |
(this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) && this.fill(), | |
this.wasPlaying_ = !e.paused(), | |
this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(), | |
this.closeable() && this.on(this.el_.ownerDocument, "keydown", nt(this, this.handleKeyPress)), | |
this.hadControls_ = e.controls(), | |
e.controls(!1), | |
this.show(), | |
this.conditionalFocus_(), | |
this.el().setAttribute("aria-hidden", "false"), | |
this.trigger("modalopen"), | |
this.hasBeenOpened_ = !0 | |
} | |
} | |
, | |
i.prototype.opened = function(e) { | |
return "boolean" == typeof e && this[e ? "open" : "close"](), | |
this.opened_ | |
} | |
, | |
i.prototype.close = function() { | |
if (this.opened_) { | |
var e = this.player(); | |
this.trigger("beforemodalclose"), | |
this.opened_ = !1, | |
this.wasPlaying_ && this.options_.pauseOnOpen && e.play(), | |
this.closeable() && this.off(this.el_.ownerDocument, "keydown", nt(this, this.handleKeyPress)), | |
this.hadControls_ && e.controls(!0), | |
this.hide(), | |
this.el().setAttribute("aria-hidden", "true"), | |
this.trigger("modalclose"), | |
this.conditionalBlur_(), | |
this.options_.temporary && this.dispose() | |
} | |
} | |
, | |
i.prototype.closeable = function(e) { | |
if ("boolean" == typeof e) { | |
var t = this.closeable_ = !!e | |
, r = this.getChild("closeButton"); | |
if (t && !r) { | |
var n = this.contentEl_; | |
this.contentEl_ = this.el_, | |
r = this.addChild("closeButton", { | |
controlText: "Close Modal Dialog" | |
}), | |
this.contentEl_ = n, | |
this.on(r, "close", this.close) | |
} | |
!t && r && (this.off(r, "close", this.close), | |
this.removeChild(r), | |
r.dispose()) | |
} | |
return this.closeable_ | |
} | |
, | |
i.prototype.fill = function() { | |
this.fillWith(this.content()) | |
} | |
, | |
i.prototype.fillWith = function(e) { | |
var t = this.contentEl() | |
, r = t.parentNode | |
, n = t.nextSibling; | |
this.trigger("beforemodalfill"), | |
this.hasBeenFilled_ = !0, | |
r.removeChild(t), | |
this.empty(), | |
Pe(t, e), | |
this.trigger("modalfill"), | |
n ? r.insertBefore(t, n) : r.appendChild(t); | |
var i = this.getChild("closeButton"); | |
i && r.appendChild(i.el_) | |
} | |
, | |
i.prototype.empty = function() { | |
this.trigger("beforemodalempty"), | |
Ee(this.contentEl()), | |
this.trigger("modalempty") | |
} | |
, | |
i.prototype.content = function(e) { | |
return void 0 !== e && (this.content_ = e), | |
this.content_ | |
} | |
, | |
i.prototype.conditionalFocus_ = function() { | |
var e = f.activeElement | |
, t = this.player_.el_; | |
this.previouslyActiveEl_ = null, | |
(t.contains(e) || t === e) && (this.previouslyActiveEl_ = e, | |
this.focus(), | |
this.on(f, "keydown", this.handleKeyDown)) | |
} | |
, | |
i.prototype.conditionalBlur_ = function() { | |
this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(), | |
this.previouslyActiveEl_ = null), | |
this.off(f, "keydown", this.handleKeyDown) | |
} | |
, | |
i.prototype.handleKeyDown = function(e) { | |
if (9 === e.which) { | |
for (var t = this.focusableEls_(), r = this.el_.querySelector(":focus"), n = void 0, i = 0; i < t.length; i++) | |
if (r === t[i]) { | |
n = i; | |
break | |
} | |
f.activeElement === this.el_ && (n = 0), | |
e.shiftKey && 0 === n ? (t[t.length - 1].focus(), | |
e.preventDefault()) : e.shiftKey || n !== t.length - 1 || (t[0].focus(), | |
e.preventDefault()) | |
} | |
} | |
, | |
i.prototype.focusableEls_ = function() { | |
var e = this.el_.querySelectorAll("*"); | |
return Array.prototype.filter.call(e, function(e) { | |
return (e instanceof p.HTMLAnchorElement || e instanceof p.HTMLAreaElement) && e.hasAttribute("href") || (e instanceof p.HTMLInputElement || e instanceof p.HTMLSelectElement || e instanceof p.HTMLTextAreaElement || e instanceof p.HTMLButtonElement) && !e.hasAttribute("disabled") || e instanceof p.HTMLIFrameElement || e instanceof p.HTMLObjectElement || e instanceof p.HTMLEmbedElement || e.hasAttribute("tabindex") && -1 !== e.getAttribute("tabindex") || e.hasAttribute("contenteditable") | |
}) | |
} | |
, | |
i | |
}(gt); | |
Ft.prototype.options_ = { | |
pauseOnOpen: !0, | |
temporary: !0 | |
}, | |
gt.registerComponent("ModalDialog", Ft); | |
var Bt = function(o) { | |
function a() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [] | |
, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : null; | |
B(this, a); | |
var r = q(this, o.call(this)); | |
if (!t && (t = r, | |
A)) | |
for (var n in t = f.createElement("custom"), | |
a.prototype) | |
"constructor" !== n && (t[n] = a.prototype[n]); | |
t.tracks_ = [], | |
Object.defineProperty(t, "length", { | |
get: function() { | |
return this.tracks_.length | |
} | |
}); | |
for (var i = 0; i < e.length; i++) | |
t.addTrack(e[i]); | |
return q(r, t) | |
} | |
return H(a, o), | |
a.prototype.addTrack = function(e) { | |
var t = this.tracks_.length; | |
"" + t in this || Object.defineProperty(this, t, { | |
get: function() { | |
return this.tracks_[t] | |
} | |
}), | |
-1 === this.tracks_.indexOf(e) && (this.tracks_.push(e), | |
this.trigger({ | |
track: e, | |
type: "addtrack" | |
})) | |
} | |
, | |
a.prototype.removeTrack = function(e) { | |
for (var t = void 0, r = 0, n = this.length; r < n; r++) | |
if (this[r] === e) { | |
(t = this[r]).off && t.off(), | |
this.tracks_.splice(r, 1); | |
break | |
} | |
t && this.trigger({ | |
track: t, | |
type: "removetrack" | |
}) | |
} | |
, | |
a.prototype.getTrackById = function(e) { | |
for (var t = null, r = 0, n = this.length; r < n; r++) { | |
var i = this[r]; | |
if (i.id === e) { | |
t = i; | |
break | |
} | |
} | |
return t | |
} | |
, | |
a | |
}(ot); | |
for (var Ht in Bt.prototype.allowedEvents_ = { | |
change: "change", | |
addtrack: "addtrack", | |
removetrack: "removetrack" | |
}, | |
Bt.prototype.allowedEvents_) | |
Bt.prototype["on" + Ht] = null; | |
var qt = function(e, t) { | |
for (var r = 0; r < e.length; r++) | |
Object.keys(e[r]).length && t.id !== e[r].id && (e[r].enabled = !1) | |
} | |
, Vt = function(a) { | |
function s() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : []; | |
B(this, s); | |
for (var r = void 0, n = t.length - 1; 0 <= n; n--) | |
if (t[n].enabled) { | |
qt(t, t[n]); | |
break | |
} | |
if (A) { | |
for (var i in r = f.createElement("custom"), | |
Bt.prototype) | |
"constructor" !== i && (r[i] = Bt.prototype[i]); | |
for (var o in s.prototype) | |
"constructor" !== o && (r[o] = s.prototype[o]) | |
} | |
return (r = e = q(this, a.call(this, t, r))).changing_ = !1, | |
q(e, r) | |
} | |
return H(s, a), | |
s.prototype.addTrack = function(e) { | |
var t = this; | |
e.enabled && qt(this, e), | |
a.prototype.addTrack.call(this, e), | |
e.addEventListener && e.addEventListener("enabledchange", function() { | |
t.changing_ || (t.changing_ = !0, | |
qt(t, e), | |
t.changing_ = !1, | |
t.trigger("change")) | |
}) | |
} | |
, | |
s | |
}(Bt) | |
, Wt = function(e, t) { | |
for (var r = 0; r < e.length; r++) | |
Object.keys(e[r]).length && t.id !== e[r].id && (e[r].selected = !1) | |
} | |
, Ut = function(a) { | |
function s() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : []; | |
B(this, s); | |
for (var r = void 0, n = t.length - 1; 0 <= n; n--) | |
if (t[n].selected) { | |
Wt(t, t[n]); | |
break | |
} | |
if (A) { | |
for (var i in r = f.createElement("custom"), | |
Bt.prototype) | |
"constructor" !== i && (r[i] = Bt.prototype[i]); | |
for (var o in s.prototype) | |
"constructor" !== o && (r[o] = s.prototype[o]) | |
} | |
return (r = e = q(this, a.call(this, t, r))).changing_ = !1, | |
Object.defineProperty(r, "selectedIndex", { | |
get: function() { | |
for (var e = 0; e < this.length; e++) | |
if (this[e].selected) | |
return e; | |
return -1 | |
}, | |
set: function() {} | |
}), | |
q(e, r) | |
} | |
return H(s, a), | |
s.prototype.addTrack = function(e) { | |
var t = this; | |
e.selected && Wt(this, e), | |
a.prototype.addTrack.call(this, e), | |
e.addEventListener && e.addEventListener("selectedchange", function() { | |
t.changing_ || (t.changing_ = !0, | |
Wt(t, e), | |
t.changing_ = !1, | |
t.trigger("change")) | |
}) | |
} | |
, | |
s | |
}(Bt) | |
, zt = function(o) { | |
function a() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : []; | |
B(this, a); | |
var r = void 0; | |
if (A) { | |
for (var n in r = f.createElement("custom"), | |
Bt.prototype) | |
"constructor" !== n && (r[n] = Bt.prototype[n]); | |
for (var i in a.prototype) | |
"constructor" !== i && (r[i] = a.prototype[i]) | |
} | |
return e = q(this, o.call(this, t, r)), | |
q(r = e, r) | |
} | |
return H(a, o), | |
a.prototype.addTrack = function(e) { | |
o.prototype.addTrack.call(this, e), | |
e.addEventListener("modechange", nt(this, function() { | |
this.trigger("change") | |
})); | |
-1 === ["metadata", "chapters"].indexOf(e.kind) && e.addEventListener("modechange", nt(this, function() { | |
this.trigger("selectedlanguagechange") | |
})) | |
} | |
, | |
a | |
}(Bt) | |
, Gt = function() { | |
function o() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : []; | |
B(this, o); | |
var t = this; | |
if (A) | |
for (var r in t = f.createElement("custom"), | |
o.prototype) | |
"constructor" !== r && (t[r] = o.prototype[r]); | |
t.trackElements_ = [], | |
Object.defineProperty(t, "length", { | |
get: function() { | |
return this.trackElements_.length | |
} | |
}); | |
for (var n = 0, i = e.length; n < i; n++) | |
t.addTrackElement_(e[n]); | |
if (A) | |
return t | |
} | |
return o.prototype.addTrackElement_ = function(e) { | |
var t = this.trackElements_.length; | |
"" + t in this || Object.defineProperty(this, t, { | |
get: function() { | |
return this.trackElements_[t] | |
} | |
}), | |
-1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e) | |
} | |
, | |
o.prototype.getTrackElementByTrack_ = function(e) { | |
for (var t = void 0, r = 0, n = this.trackElements_.length; r < n; r++) | |
if (e === this.trackElements_[r].track) { | |
t = this.trackElements_[r]; | |
break | |
} | |
return t | |
} | |
, | |
o.prototype.removeTrackElement_ = function(e) { | |
for (var t = 0, r = this.trackElements_.length; t < r; t++) | |
if (e === this.trackElements_[t]) { | |
this.trackElements_.splice(t, 1); | |
break | |
} | |
} | |
, | |
o | |
}() | |
, $t = function() { | |
function n(e) { | |
B(this, n); | |
var t = this; | |
if (A) | |
for (var r in t = f.createElement("custom"), | |
n.prototype) | |
"constructor" !== r && (t[r] = n.prototype[r]); | |
if (n.prototype.setCues_.call(t, e), | |
Object.defineProperty(t, "length", { | |
get: function() { | |
return this.length_ | |
} | |
}), | |
A) | |
return t | |
} | |
return n.prototype.setCues_ = function(e) { | |
var t = this.length || 0 | |
, r = 0 | |
, n = e.length; | |
this.cues_ = e, | |
this.length_ = e.length; | |
var i = function(e) { | |
"" + e in this || Object.defineProperty(this, "" + e, { | |
get: function() { | |
return this.cues_[e] | |
} | |
}) | |
}; | |
if (t < n) | |
for (r = t; r < n; r++) | |
i.call(this, r) | |
} | |
, | |
n.prototype.getCueById = function(e) { | |
for (var t = null, r = 0, n = this.length; r < n; r++) { | |
var i = this[r]; | |
if (i.id === e) { | |
t = i; | |
break | |
} | |
} | |
return t | |
} | |
, | |
n | |
}() | |
, Kt = { | |
alternative: "alternative", | |
captions: "captions", | |
main: "main", | |
sign: "sign", | |
subtitles: "subtitles", | |
commentary: "commentary" | |
} | |
, Xt = { | |
alternative: "alternative", | |
descriptions: "descriptions", | |
main: "main", | |
"main-desc": "main-desc", | |
translation: "translation", | |
commentary: "commentary" | |
} | |
, Jt = { | |
subtitles: "subtitles", | |
captions: "captions", | |
descriptions: "descriptions", | |
chapters: "chapters", | |
metadata: "metadata" | |
} | |
, Qt = { | |
disabled: "disabled", | |
hidden: "hidden", | |
showing: "showing" | |
} | |
, Yt = function(s) { | |
function l() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
B(this, l); | |
var t = q(this, s.call(this)) | |
, r = t; | |
if (A) | |
for (var n in r = f.createElement("custom"), | |
l.prototype) | |
"constructor" !== n && (r[n] = l.prototype[n]); | |
var i = { | |
id: e.id || "vjs_track_" + Re(), | |
kind: e.kind || "", | |
label: e.label || "", | |
language: e.language || "" | |
} | |
, o = function(e) { | |
Object.defineProperty(r, e, { | |
get: function() { | |
return i[e] | |
}, | |
set: function() {} | |
}) | |
}; | |
for (var a in i) | |
o(a); | |
return q(t, r) | |
} | |
return H(l, s), | |
l | |
}(ot) | |
, Zt = function(e) { | |
var t = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"] | |
, r = f.createElement("a"); | |
r.href = e; | |
var n = "" === r.host && "file:" !== r.protocol | |
, i = void 0; | |
n && ((i = f.createElement("div")).innerHTML = '<a href="' + e + '"></a>', | |
r = i.firstChild, | |
i.setAttribute("style", "display:none; position:absolute;"), | |
f.body.appendChild(i)); | |
for (var o = {}, a = 0; a < t.length; a++) | |
o[t[a]] = r[t[a]]; | |
return "http:" === o.protocol && (o.host = o.host.replace(/:80$/, "")), | |
"https:" === o.protocol && (o.host = o.host.replace(/:443$/, "")), | |
o.protocol || (o.protocol = p.location.protocol), | |
n && f.body.removeChild(i), | |
o | |
} | |
, er = function(e) { | |
if (!e.match(/^https?:\/\//)) { | |
var t = f.createElement("div"); | |
t.innerHTML = '<a href="' + e + '">x</a>', | |
e = t.firstChild.href | |
} | |
return e | |
} | |
, tr = function(e) { | |
if ("string" == typeof e) { | |
var t = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e); | |
if (t) | |
return t.pop().toLowerCase() | |
} | |
return "" | |
} | |
, rr = function(e) { | |
var t = p.location | |
, r = Zt(e); | |
return (":" === r.protocol ? t.protocol : r.protocol) + r.host !== t.protocol + t.host | |
} | |
, nr = (Object.freeze || Object)({ | |
parseUrl: Zt, | |
getAbsoluteURL: er, | |
getFileExtension: tr, | |
isCrossOrigin: rr | |
}) | |
, ir = function(e, t) { | |
var r = new p.WebVTT.Parser(p,p.vttjs,p.WebVTT.StringDecoder()) | |
, n = []; | |
r.oncue = function(e) { | |
t.addCue(e) | |
} | |
, | |
r.onparsingerror = function(e) { | |
n.push(e) | |
} | |
, | |
r.onflush = function() { | |
t.trigger({ | |
type: "loadeddata", | |
target: t | |
}) | |
} | |
, | |
r.parse(e), | |
0 < n.length && (p.console && p.console.groupCollapsed && p.console.groupCollapsed("Text Track parsing errors for " + t.src), | |
n.forEach(function(e) { | |
return Z.error(e) | |
}), | |
p.console && p.console.groupEnd && p.console.groupEnd()), | |
r.flush() | |
} | |
, or = function(h) { | |
function d() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
if (B(this, d), | |
!t.tech) | |
throw new Error("A tech was not provided."); | |
var r = _t(t, { | |
kind: Jt[t.kind] || "subtitles", | |
language: t.language || t.srclang || "" | |
}) | |
, n = Qt[r.mode] || "disabled" | |
, i = r.default; | |
"metadata" !== r.kind && "chapters" !== r.kind || (n = "hidden"); | |
var o = e = q(this, h.call(this, r)); | |
if (o.tech_ = r.tech, | |
A) | |
for (var a in d.prototype) | |
"constructor" !== a && (o[a] = d.prototype[a]); | |
o.cues_ = [], | |
o.activeCues_ = []; | |
var s = new $t(o.cues_) | |
, l = new $t(o.activeCues_) | |
, u = !1 | |
, c = nt(o, function() { | |
this.activeCues = this.activeCues, | |
u && (this.trigger("cuechange"), | |
u = !1) | |
}); | |
return "disabled" !== n && o.tech_.ready(function() { | |
o.tech_.on("timeupdate", c) | |
}, !0), | |
Object.defineProperty(o, "default", { | |
get: function() { | |
return i | |
}, | |
set: function() {} | |
}), | |
Object.defineProperty(o, "mode", { | |
get: function() { | |
return n | |
}, | |
set: function(e) { | |
var t = this; | |
Qt[e] && ("showing" === (n = e) && this.tech_.ready(function() { | |
t.tech_.on("timeupdate", c) | |
}, !0), | |
this.trigger("modechange")) | |
} | |
}), | |
Object.defineProperty(o, "cues", { | |
get: function() { | |
return this.loaded_ ? s : null | |
}, | |
set: function() {} | |
}), | |
Object.defineProperty(o, "activeCues", { | |
get: function() { | |
if (!this.loaded_) | |
return null; | |
if (0 === this.cues.length) | |
return l; | |
for (var e = this.tech_.currentTime(), t = [], r = 0, n = this.cues.length; r < n; r++) { | |
var i = this.cues[r]; | |
i.startTime <= e && i.endTime >= e ? t.push(i) : i.startTime === i.endTime && i.startTime <= e && i.startTime + .5 >= e && t.push(i) | |
} | |
if (u = !1, | |
t.length !== this.activeCues_.length) | |
u = !0; | |
else | |
for (var o = 0; o < t.length; o++) | |
-1 === this.activeCues_.indexOf(t[o]) && (u = !0); | |
return this.activeCues_ = t, | |
l.setCues_(this.activeCues_), | |
l | |
}, | |
set: function() {} | |
}), | |
r.src ? (o.src = r.src, | |
function(e, i) { | |
var t = { | |
uri: e | |
} | |
, r = rr(e); | |
r && (t.cors = r), | |
y(t, nt(this, function(e, t, r) { | |
if (e) | |
return Z.error(e, t); | |
if (i.loaded_ = !0, | |
"function" != typeof p.WebVTT) { | |
if (i.tech_) { | |
var n = function() { | |
return ir(r, i) | |
}; | |
i.tech_.on("vttjsloaded", n), | |
i.tech_.on("vttjserror", function() { | |
Z.error("vttjs failed to load, stopping trying to process " + i.src), | |
i.tech_.off("vttjsloaded", n) | |
}) | |
} | |
} else | |
ir(r, i) | |
})) | |
}(r.src, o)) : o.loaded_ = !0, | |
q(e, o) | |
} | |
return H(d, h), | |
d.prototype.addCue = function(e) { | |
var t = e; | |
if (p.vttjs && !(e instanceof p.vttjs.VTTCue)) { | |
for (var r in t = new p.vttjs.VTTCue(e.startTime,e.endTime,e.text), | |
e) | |
r in t || (t[r] = e[r]); | |
t.id = e.id, | |
t.originalCue_ = e | |
} | |
for (var n = this.tech_.textTracks(), i = 0; i < n.length; i++) | |
n[i] !== this && n[i].removeCue(t); | |
this.cues_.push(t), | |
this.cues.setCues_(this.cues_) | |
} | |
, | |
d.prototype.removeCue = function(e) { | |
for (var t = this.cues_.length; t--; ) { | |
var r = this.cues_[t]; | |
if (r === e || r.originalCue_ && r.originalCue_ === e) { | |
this.cues_.splice(t, 1), | |
this.cues.setCues_(this.cues_); | |
break | |
} | |
} | |
} | |
, | |
d | |
}(Yt); | |
or.prototype.allowedEvents_ = { | |
cuechange: "cuechange" | |
}; | |
var ar = function(a) { | |
function s() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
B(this, s); | |
var r = _t(t, { | |
kind: Xt[t.kind] || "" | |
}) | |
, n = e = q(this, a.call(this, r)) | |
, i = !1; | |
if (A) | |
for (var o in s.prototype) | |
"constructor" !== o && (n[o] = s.prototype[o]); | |
return Object.defineProperty(n, "enabled", { | |
get: function() { | |
return i | |
}, | |
set: function(e) { | |
"boolean" == typeof e && e !== i && (i = e, | |
this.trigger("enabledchange")) | |
} | |
}), | |
r.enabled && (n.enabled = r.enabled), | |
n.loaded_ = !0, | |
q(e, n) | |
} | |
return H(s, a), | |
s | |
}(Yt) | |
, sr = function(a) { | |
function s() { | |
var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
B(this, s); | |
var r = _t(t, { | |
kind: Kt[t.kind] || "" | |
}) | |
, n = e = q(this, a.call(this, r)) | |
, i = !1; | |
if (A) | |
for (var o in s.prototype) | |
"constructor" !== o && (n[o] = s.prototype[o]); | |
return Object.defineProperty(n, "selected", { | |
get: function() { | |
return i | |
}, | |
set: function(e) { | |
"boolean" == typeof e && e !== i && (i = e, | |
this.trigger("selectedchange")) | |
} | |
}), | |
r.selected && (n.selected = r.selected), | |
q(e, n) | |
} | |
return H(s, a), | |
s | |
}(Yt) | |
, lr = function(a) { | |
function s() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
B(this, s); | |
var t = q(this, a.call(this)) | |
, r = void 0 | |
, n = t; | |
if (A) | |
for (var i in n = f.createElement("custom"), | |
s.prototype) | |
"constructor" !== i && (n[i] = s.prototype[i]); | |
var o = new or(e); | |
return n.kind = o.kind, | |
n.src = o.src, | |
n.srclang = o.language, | |
n.label = o.label, | |
n.default = o.default, | |
Object.defineProperty(n, "readyState", { | |
get: function() { | |
return r | |
} | |
}), | |
Object.defineProperty(n, "track", { | |
get: function() { | |
return o | |
} | |
}), | |
r = 0, | |
o.addEventListener("loadeddata", function() { | |
r = 2, | |
n.trigger({ | |
type: "load", | |
target: n | |
}) | |
}), | |
A ? q(t, n) : t | |
} | |
return H(s, a), | |
s | |
}(ot); | |
lr.prototype.allowedEvents_ = { | |
load: "load" | |
}, | |
lr.NONE = 0, | |
lr.LOADING = 1, | |
lr.LOADED = 2, | |
lr.ERROR = 3; | |
var ur = { | |
audio: { | |
ListClass: Vt, | |
TrackClass: ar, | |
capitalName: "Audio" | |
}, | |
video: { | |
ListClass: Ut, | |
TrackClass: sr, | |
capitalName: "Video" | |
}, | |
text: { | |
ListClass: zt, | |
TrackClass: or, | |
capitalName: "Text" | |
} | |
}; | |
Object.keys(ur).forEach(function(e) { | |
ur[e].getterName = e + "Tracks", | |
ur[e].privateName = e + "Tracks_" | |
}); | |
var cr = { | |
remoteText: { | |
ListClass: zt, | |
TrackClass: or, | |
capitalName: "RemoteText", | |
getterName: "remoteTextTracks", | |
privateName: "remoteTextTracks_" | |
}, | |
remoteTextEl: { | |
ListClass: Gt, | |
TrackClass: lr, | |
capitalName: "RemoteTextTrackEls", | |
getterName: "remoteTextTrackEls", | |
privateName: "remoteTextTrackEls_" | |
} | |
} | |
, hr = _t(ur, cr); | |
cr.names = Object.keys(cr), | |
ur.names = Object.keys(ur), | |
hr.names = [].concat(cr.names).concat(ur.names); | |
var dr = function(t) { | |
function i() { | |
var r = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {} | |
, e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : function() {} | |
; | |
B(this, i), | |
r.reportTouchActivity = !1; | |
var n = q(this, t.call(this, null, r, e)); | |
return n.hasStarted_ = !1, | |
n.on("playing", function() { | |
this.hasStarted_ = !0 | |
}), | |
n.on("loadstart", function() { | |
this.hasStarted_ = !1 | |
}), | |
hr.names.forEach(function(e) { | |
var t = hr[e]; | |
r && r[t.getterName] && (n[t.privateName] = r[t.getterName]) | |
}), | |
n.featuresProgressEvents || n.manualProgressOn(), | |
n.featuresTimeupdateEvents || n.manualTimeUpdatesOn(), | |
["Text", "Audio", "Video"].forEach(function(e) { | |
!1 === r["native" + e + "Tracks"] && (n["featuresNative" + e + "Tracks"] = !1) | |
}), | |
!1 === r.nativeCaptions || !1 === r.nativeTextTracks ? n.featuresNativeTextTracks = !1 : !0 !== r.nativeCaptions && !0 !== r.nativeTextTracks || (n.featuresNativeTextTracks = !0), | |
n.featuresNativeTextTracks || n.emulateTextTracks(), | |
n.autoRemoteTextTracks_ = new hr.text.ListClass, | |
n.initTrackListeners(), | |
r.nativeControlsForTouch || n.emitTapEvents(), | |
n.constructor && (n.name_ = n.constructor.name || "Unknown Tech"), | |
n | |
} | |
return H(i, t), | |
i.prototype.triggerSourceset = function(e) { | |
var t = this; | |
this.isReady_ || this.one("ready", function() { | |
return t.setTimeout(function() { | |
return t.triggerSourceset(e) | |
}, 1) | |
}), | |
this.trigger({ | |
src: e, | |
type: "sourceset" | |
}) | |
} | |
, | |
i.prototype.manualProgressOn = function() { | |
this.on("durationchange", this.onDurationChange), | |
this.manualProgress = !0, | |
this.one("ready", this.trackProgress) | |
} | |
, | |
i.prototype.manualProgressOff = function() { | |
this.manualProgress = !1, | |
this.stopTrackingProgress(), | |
this.off("durationchange", this.onDurationChange) | |
} | |
, | |
i.prototype.trackProgress = function(e) { | |
this.stopTrackingProgress(), | |
this.progressInterval = this.setInterval(nt(this, function() { | |
var e = this.bufferedPercent(); | |
this.bufferedPercent_ !== e && this.trigger("progress"), | |
1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress() | |
}), 500) | |
} | |
, | |
i.prototype.onDurationChange = function(e) { | |
this.duration_ = this.duration() | |
} | |
, | |
i.prototype.buffered = function() { | |
return wt(0, 0) | |
} | |
, | |
i.prototype.bufferedPercent = function() { | |
return kt(this.buffered(), this.duration_) | |
} | |
, | |
i.prototype.stopTrackingProgress = function() { | |
this.clearInterval(this.progressInterval) | |
} | |
, | |
i.prototype.manualTimeUpdatesOn = function() { | |
this.manualTimeUpdates = !0, | |
this.on("play", this.trackCurrentTime), | |
this.on("pause", this.stopTrackingCurrentTime) | |
} | |
, | |
i.prototype.manualTimeUpdatesOff = function() { | |
this.manualTimeUpdates = !1, | |
this.stopTrackingCurrentTime(), | |
this.off("play", this.trackCurrentTime), | |
this.off("pause", this.stopTrackingCurrentTime) | |
} | |
, | |
i.prototype.trackCurrentTime = function() { | |
this.currentTimeInterval && this.stopTrackingCurrentTime(), | |
this.currentTimeInterval = this.setInterval(function() { | |
this.trigger({ | |
type: "timeupdate", | |
target: this, | |
manuallyTriggered: !0 | |
}) | |
}, 250) | |
} | |
, | |
i.prototype.stopTrackingCurrentTime = function() { | |
this.clearInterval(this.currentTimeInterval), | |
this.trigger({ | |
type: "timeupdate", | |
target: this, | |
manuallyTriggered: !0 | |
}) | |
} | |
, | |
i.prototype.dispose = function() { | |
this.clearTracks(ur.names), | |
this.manualProgress && this.manualProgressOff(), | |
this.manualTimeUpdates && this.manualTimeUpdatesOff(), | |
t.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.clearTracks = function(e) { | |
var i = this; | |
(e = [].concat(e)).forEach(function(e) { | |
for (var t = i[e + "Tracks"]() || [], r = t.length; r--; ) { | |
var n = t[r]; | |
"text" === e && i.removeRemoteTextTrack(n), | |
t.removeTrack(n) | |
} | |
}) | |
} | |
, | |
i.prototype.cleanupAutoTextTracks = function() { | |
for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--; ) { | |
var r = e[t]; | |
this.removeRemoteTextTrack(r) | |
} | |
} | |
, | |
i.prototype.reset = function() {} | |
, | |
i.prototype.error = function(e) { | |
return void 0 !== e && (this.error_ = new Ot(e), | |
this.trigger("error")), | |
this.error_ | |
} | |
, | |
i.prototype.played = function() { | |
return this.hasStarted_ ? wt(0, 0) : wt() | |
} | |
, | |
i.prototype.setCurrentTime = function() { | |
this.manualTimeUpdates && this.trigger({ | |
type: "timeupdate", | |
target: this, | |
manuallyTriggered: !0 | |
}) | |
} | |
, | |
i.prototype.initTrackListeners = function() { | |
var i = this; | |
ur.names.forEach(function(e) { | |
var t = ur[e] | |
, r = function() { | |
i.trigger(e + "trackchange") | |
} | |
, n = i[t.getterName](); | |
n.addEventListener("removetrack", r), | |
n.addEventListener("addtrack", r), | |
i.on("dispose", function() { | |
n.removeEventListener("removetrack", r), | |
n.removeEventListener("addtrack", r) | |
}) | |
}) | |
} | |
, | |
i.prototype.addWebVttScript_ = function() { | |
var e = this; | |
if (!p.WebVTT) | |
if (f.body.contains(this.el())) { | |
if (!this.options_["vtt.js"] && K(l) && 0 < Object.keys(l).length) | |
return void this.trigger("vttjsloaded"); | |
var t = f.createElement("script"); | |
t.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js", | |
t.onload = function() { | |
e.trigger("vttjsloaded") | |
} | |
, | |
t.onerror = function() { | |
e.trigger("vttjserror") | |
} | |
, | |
this.on("dispose", function() { | |
t.onload = null, | |
t.onerror = null | |
}), | |
p.WebVTT = !0, | |
this.el().parentNode.appendChild(t) | |
} else | |
this.ready(this.addWebVttScript_) | |
} | |
, | |
i.prototype.emulateTextTracks = function() { | |
var e = this | |
, r = this.textTracks() | |
, t = this.remoteTextTracks() | |
, n = function(e) { | |
return r.addTrack(e.track) | |
} | |
, i = function(e) { | |
return r.removeTrack(e.track) | |
}; | |
t.on("addtrack", n), | |
t.on("removetrack", i), | |
this.addWebVttScript_(); | |
var o = function() { | |
return e.trigger("texttrackchange") | |
} | |
, a = function() { | |
o(); | |
for (var e = 0; e < r.length; e++) { | |
var t = r[e]; | |
t.removeEventListener("cuechange", o), | |
"showing" === t.mode && t.addEventListener("cuechange", o) | |
} | |
}; | |
a(), | |
r.addEventListener("change", a), | |
r.addEventListener("addtrack", a), | |
r.addEventListener("removetrack", a), | |
this.on("dispose", function() { | |
t.off("addtrack", n), | |
t.off("removetrack", i), | |
r.removeEventListener("change", a), | |
r.removeEventListener("addtrack", a), | |
r.removeEventListener("removetrack", a); | |
for (var e = 0; e < r.length; e++) { | |
r[e].removeEventListener("cuechange", o) | |
} | |
}) | |
} | |
, | |
i.prototype.addTextTrack = function(e, t, r) { | |
if (!e) | |
throw new Error("TextTrack kind is required but was not provided"); | |
return function(e, t, r, n) { | |
var i = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : {} | |
, o = e.textTracks(); | |
i.kind = t, | |
r && (i.label = r), | |
n && (i.language = n), | |
i.tech = e; | |
var a = new hr.text.TrackClass(i); | |
return o.addTrack(a), | |
a | |
}(this, e, t, r) | |
} | |
, | |
i.prototype.createRemoteTextTrack = function(e) { | |
var t = _t(e, { | |
tech: this | |
}); | |
return new cr.remoteTextEl.TrackClass(t) | |
} | |
, | |
i.prototype.addRemoteTextTrack = function() { | |
var e = this | |
, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {} | |
, r = arguments[1] | |
, n = this.createRemoteTextTrack(t); | |
return !0 !== r && !1 !== r && (Z.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'), | |
r = !0), | |
this.remoteTextTrackEls().addTrackElement_(n), | |
this.remoteTextTracks().addTrack(n.track), | |
!0 !== r && this.ready(function() { | |
return e.autoRemoteTextTracks_.addTrack(n.track) | |
}), | |
n | |
} | |
, | |
i.prototype.removeRemoteTextTrack = function(e) { | |
var t = this.remoteTextTrackEls().getTrackElementByTrack_(e); | |
this.remoteTextTrackEls().removeTrackElement_(t), | |
this.remoteTextTracks().removeTrack(e), | |
this.autoRemoteTextTracks_.removeTrack(e) | |
} | |
, | |
i.prototype.getVideoPlaybackQuality = function() { | |
return {} | |
} | |
, | |
i.prototype.setPoster = function() {} | |
, | |
i.prototype.playsinline = function() {} | |
, | |
i.prototype.setPlaysinline = function() {} | |
, | |
i.prototype.canPlayType = function() { | |
return "" | |
} | |
, | |
i.canPlayType = function() { | |
return "" | |
} | |
, | |
i.canPlaySource = function(e, t) { | |
return i.canPlayType(e.type) | |
} | |
, | |
i.isTech = function(e) { | |
return e.prototype instanceof i || e instanceof i || e === i | |
} | |
, | |
i.registerTech = function(e, t) { | |
if (i.techs_ || (i.techs_ = {}), | |
!i.isTech(t)) | |
throw new Error("Tech " + e + " must be a Tech"); | |
if (!i.canPlayType) | |
throw new Error("Techs must have a static canPlayType method on them"); | |
if (!i.canPlaySource) | |
throw new Error("Techs must have a static canPlaySource method on them"); | |
return e = mt(e), | |
i.techs_[e] = t, | |
"Tech" !== e && i.defaultTechOrder_.push(e), | |
t | |
} | |
, | |
i.getTech = function(e) { | |
if (e) | |
return e = mt(e), | |
i.techs_ && i.techs_[e] ? i.techs_[e] : p && p.videojs && p.videojs[e] ? (Z.warn("The " + e + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"), | |
p.videojs[e]) : void 0 | |
} | |
, | |
i | |
}(gt); | |
hr.names.forEach(function(e) { | |
var t = hr[e]; | |
dr.prototype[t.getterName] = function() { | |
return this[t.privateName] = this[t.privateName] || new t.ListClass, | |
this[t.privateName] | |
} | |
}), | |
dr.prototype.featuresVolumeControl = !0, | |
dr.prototype.featuresMuteControl = !0, | |
dr.prototype.featuresFullscreenResize = !1, | |
dr.prototype.featuresPlaybackRate = !1, | |
dr.prototype.featuresProgressEvents = !1, | |
dr.prototype.featuresSourceset = !1, | |
dr.prototype.featuresTimeupdateEvents = !1, | |
dr.prototype.featuresNativeTextTracks = !1, | |
dr.withSourceHandlers = function(i) { | |
i.registerSourceHandler = function(e, t) { | |
var r = i.sourceHandlers; | |
r || (r = i.sourceHandlers = []), | |
void 0 === t && (t = r.length), | |
r.splice(t, 0, e) | |
} | |
, | |
i.canPlayType = function(e) { | |
for (var t = i.sourceHandlers || [], r = void 0, n = 0; n < t.length; n++) | |
if (r = t[n].canPlayType(e)) | |
return r; | |
return "" | |
} | |
, | |
i.selectSourceHandler = function(e, t) { | |
for (var r = i.sourceHandlers || [], n = 0; n < r.length; n++) | |
if (r[n].canHandleSource(e, t)) | |
return r[n]; | |
return null | |
} | |
, | |
i.canPlaySource = function(e, t) { | |
var r = i.selectSourceHandler(e, t); | |
return r ? r.canHandleSource(e, t) : "" | |
} | |
; | |
["seekable", "seeking", "duration"].forEach(function(e) { | |
var t = this[e]; | |
"function" == typeof t && (this[e] = function() { | |
return this.sourceHandler_ && this.sourceHandler_[e] ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) : t.apply(this, arguments) | |
} | |
) | |
}, i.prototype), | |
i.prototype.setSource = function(e) { | |
var t = i.selectSourceHandler(e, this.options_); | |
t || (i.nativeSourceHandler ? t = i.nativeSourceHandler : Z.error("No source hander found for the current source.")), | |
this.disposeSourceHandler(), | |
this.off("dispose", this.disposeSourceHandler), | |
t !== i.nativeSourceHandler && (this.currentSource_ = e), | |
this.sourceHandler_ = t.handleSource(e, this, this.options_), | |
this.on("dispose", this.disposeSourceHandler) | |
} | |
, | |
i.prototype.disposeSourceHandler = function() { | |
this.currentSource_ && (this.clearTracks(["audio", "video"]), | |
this.currentSource_ = null), | |
this.cleanupAutoTextTracks(), | |
this.sourceHandler_ && (this.sourceHandler_.dispose && this.sourceHandler_.dispose(), | |
this.sourceHandler_ = null) | |
} | |
} | |
, | |
gt.registerComponent("Tech", dr), | |
dr.registerTech("Tech", dr), | |
dr.defaultTechOrder_ = []; | |
var pr = {} | |
, fr = {} | |
, vr = {}; | |
function yr(e, t, r) { | |
e.setTimeout(function() { | |
return function r() { | |
var n = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : []; | |
var i = arguments[2]; | |
var o = arguments[3]; | |
var a = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : []; | |
var s = 5 < arguments.length && void 0 !== arguments[5] && arguments[5]; | |
var t = e[0] | |
, l = e.slice(1); | |
if ("string" == typeof t) | |
r(n, pr[t], i, o, a, s); | |
else if (t) { | |
var u = wr(o, t); | |
if (!u.setSource) | |
return a.push(u), | |
r(n, l, i, o, a, s); | |
u.setSource(G({}, n), function(e, t) { | |
if (e) | |
return r(n, l, i, o, a, s); | |
a.push(u), | |
r(t, n.type === t.type ? l : pr[t.type], i, o, a, s) | |
}) | |
} else | |
l.length ? r(n, l, i, o, a, s) : s ? i(n, a) : r(n, pr["*"], i, o, a, !0) | |
}(t, pr[t.type], r, e) | |
}, 1) | |
} | |
function mr(e, t, r) { | |
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null | |
, i = "call" + mt(r) | |
, o = e.reduce(Tr(i), n) | |
, a = o === vr | |
, s = a ? null : t[r](o); | |
return function(e, t, r, n) { | |
for (var i = e.length - 1; 0 <= i; i--) { | |
var o = e[i]; | |
o[t] && o[t](n, r) | |
} | |
}(e, r, s, a), | |
s | |
} | |
var _r = { | |
buffered: 1, | |
currentTime: 1, | |
duration: 1, | |
seekable: 1, | |
played: 1, | |
paused: 1 | |
} | |
, gr = { | |
setCurrentTime: 1 | |
} | |
, br = { | |
play: 1, | |
pause: 1 | |
}; | |
function Tr(r) { | |
return function(e, t) { | |
return e === vr ? vr : t[r] ? t[r](e) : e | |
} | |
} | |
function wr(e, t) { | |
var r = fr[e.id()] | |
, n = null; | |
if (null == r) | |
return n = t(e), | |
fr[e.id()] = [[t, n]], | |
n; | |
for (var i = 0; i < r.length; i++) { | |
var o = r[i] | |
, a = o[0] | |
, s = o[1]; | |
a === t && (n = s) | |
} | |
return null === n && (n = t(e), | |
r.push([t, n])), | |
n | |
} | |
var kr = { | |
opus: "video/ogg", | |
ogv: "video/ogg", | |
mp4: "video/mp4", | |
mov: "video/mp4", | |
m4v: "video/mp4", | |
mkv: "video/x-matroska", | |
mp3: "audio/mpeg", | |
aac: "audio/aac", | |
oga: "audio/ogg", | |
m3u8: "application/x-mpegURL" | |
} | |
, Sr = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "" | |
, t = tr(e); | |
return kr[t.toLowerCase()] || "" | |
}; | |
function Cr(e) { | |
var t = Sr(e.src); | |
return !e.type && t && (e.type = t), | |
e | |
} | |
var Er = function(u) { | |
function c(e, t, r) { | |
B(this, c); | |
var n = _t({ | |
createEl: !1 | |
}, t) | |
, i = q(this, u.call(this, e, n, r)); | |
if (t.playerOptions.sources && 0 !== t.playerOptions.sources.length) | |
e.src(t.playerOptions.sources); | |
else | |
for (var o = 0, a = t.playerOptions.techOrder; o < a.length; o++) { | |
var s = mt(a[o]) | |
, l = dr.getTech(s); | |
if (s || (l = gt.getComponent(s)), | |
l && l.isSupported()) { | |
e.loadTech_(s); | |
break | |
} | |
} | |
return i | |
} | |
return H(c, u), | |
c | |
}(gt); | |
gt.registerComponent("MediaLoader", Er); | |
var xr = function(i) { | |
function n(e, t) { | |
B(this, n); | |
var r = q(this, i.call(this, e, t)); | |
return r.emitTapEvents(), | |
r.enable(), | |
r | |
} | |
return H(n, i), | |
n.prototype.createEl = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "div" | |
, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}; | |
t = G({ | |
innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>', | |
className: this.buildCSSClass(), | |
tabIndex: 0 | |
}, t), | |
"button" === e && Z.error("Creating a ClickableComponent with an HTML element of " + e + " is not supported; use a Button instead."), | |
r = G({ | |
role: "button" | |
}, r), | |
this.tabIndex_ = t.tabIndex; | |
var n = i.prototype.createEl.call(this, e, t, r); | |
return this.createControlTextEl(n), | |
n | |
} | |
, | |
n.prototype.dispose = function() { | |
this.controlTextEl_ = null, | |
i.prototype.dispose.call(this) | |
} | |
, | |
n.prototype.createControlTextEl = function(e) { | |
return this.controlTextEl_ = le("span", { | |
className: "vjs-control-text" | |
}, { | |
"aria-live": "polite" | |
}), | |
e && e.appendChild(this.controlTextEl_), | |
this.controlText(this.controlText_, e), | |
this.controlTextEl_ | |
} | |
, | |
n.prototype.controlText = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.el(); | |
if (void 0 === e) | |
return this.controlText_ || "Need Text"; | |
var r = this.localize(e); | |
this.controlText_ = e, | |
ue(this.controlTextEl_, r), | |
this.nonIconControl || t.setAttribute("title", r) | |
} | |
, | |
n.prototype.buildCSSClass = function() { | |
return "vjs-control vjs-button " + i.prototype.buildCSSClass.call(this) | |
} | |
, | |
n.prototype.enable = function() { | |
this.enabled_ || (this.enabled_ = !0, | |
this.removeClass("vjs-disabled"), | |
this.el_.setAttribute("aria-disabled", "false"), | |
void 0 !== this.tabIndex_ && this.el_.setAttribute("tabIndex", this.tabIndex_), | |
this.on(["tap", "click"], this.handleClick), | |
this.on("focus", this.handleFocus), | |
this.on("blur", this.handleBlur)) | |
} | |
, | |
n.prototype.disable = function() { | |
this.enabled_ = !1, | |
this.addClass("vjs-disabled"), | |
this.el_.setAttribute("aria-disabled", "true"), | |
void 0 !== this.tabIndex_ && this.el_.removeAttribute("tabIndex"), | |
this.off(["tap", "click"], this.handleClick), | |
this.off("focus", this.handleFocus), | |
this.off("blur", this.handleBlur) | |
} | |
, | |
n.prototype.handleClick = function(e) {} | |
, | |
n.prototype.handleFocus = function(e) { | |
Ge(f, "keydown", nt(this, this.handleKeyPress)) | |
} | |
, | |
n.prototype.handleKeyPress = function(e) { | |
32 === e.which || 13 === e.which ? (e.preventDefault(), | |
this.trigger("click")) : i.prototype.handleKeyPress && i.prototype.handleKeyPress.call(this, e) | |
} | |
, | |
n.prototype.handleBlur = function(e) { | |
$e(f, "keydown", nt(this, this.handleKeyPress)) | |
} | |
, | |
n | |
}(gt); | |
gt.registerComponent("ClickableComponent", xr); | |
var jr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.update(), | |
e.on("posterchange", nt(r, r.update)), | |
r | |
} | |
return H(i, n), | |
i.prototype.dispose = function() { | |
this.player().off("posterchange", this.update), | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.createEl = function() { | |
var e = le("div", { | |
className: "vjs-poster", | |
tabIndex: -1 | |
}); | |
return N || (this.fallbackImg_ = le("img"), | |
e.appendChild(this.fallbackImg_)), | |
e | |
} | |
, | |
i.prototype.update = function(e) { | |
var t = this.player().poster(); | |
this.setSrc(t), | |
t ? this.show() : this.hide() | |
} | |
, | |
i.prototype.setSrc = function(e) { | |
if (this.fallbackImg_) | |
this.fallbackImg_.src = e; | |
else { | |
var t = ""; | |
e && (t = 'url("' + e + '")'), | |
this.el_.style.backgroundImage = t | |
} | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
this.player_.controls() && (this.player_.paused() ? Dt(this.player_.play()) : this.player_.pause()) | |
} | |
, | |
i | |
}(xr); | |
gt.registerComponent("PosterImage", jr); | |
var Pr = "#222" | |
, Or = { | |
monospace: "monospace", | |
sansSerif: "sans-serif", | |
serif: "serif", | |
monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace', | |
monospaceSerif: '"Courier New", monospace', | |
proportionalSansSerif: "sans-serif", | |
proportionalSerif: "serif", | |
casual: '"Comic Sans MS", Impact, fantasy', | |
script: '"Monotype Corsiva", cursive', | |
smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif' | |
}; | |
function Ar(e, t) { | |
var r = void 0; | |
if (4 === e.length) | |
r = e[1] + e[1] + e[2] + e[2] + e[3] + e[3]; | |
else { | |
if (7 !== e.length) | |
throw new Error("Invalid color code provided, " + e + "; must be formatted as e.g. #f0e or #f604e2."); | |
r = e.slice(1) | |
} | |
return "rgba(" + parseInt(r.slice(0, 2), 16) + "," + parseInt(r.slice(2, 4), 16) + "," + parseInt(r.slice(4, 6), 16) + "," + t + ")" | |
} | |
function Mr(e, t, r) { | |
try { | |
e.style[t] = r | |
} catch (e) { | |
return | |
} | |
} | |
var Dr = function(i) { | |
function o(r, e, t) { | |
B(this, o); | |
var n = q(this, i.call(this, r, e, t)); | |
return r.on("loadstart", nt(n, n.toggleDisplay)), | |
r.on("texttrackchange", nt(n, n.updateDisplay)), | |
r.on("loadstart", nt(n, n.preselectTrack)), | |
r.ready(nt(n, function() { | |
if (r.tech_ && r.tech_.featuresNativeTextTracks) | |
this.hide(); | |
else { | |
r.on("fullscreenchange", nt(this, this.updateDisplay)); | |
for (var e = this.options_.playerOptions.tracks || [], t = 0; t < e.length; t++) | |
this.player_.addRemoteTextTrack(e[t], !0); | |
this.preselectTrack() | |
} | |
})), | |
n | |
} | |
return H(o, i), | |
o.prototype.preselectTrack = function() { | |
for (var e = { | |
captions: 1, | |
subtitles: 1 | |
}, t = this.player_.textTracks(), r = this.player_.cache_.selectedLanguage, n = void 0, i = void 0, o = void 0, a = 0; a < t.length; a++) { | |
var s = t[a]; | |
r && r.enabled && r.language === s.language ? s.kind === r.kind ? o = s : o || (o = s) : r && !r.enabled ? i = n = o = null : s.default && ("descriptions" !== s.kind || n ? s.kind in e && !i && (i = s) : n = s) | |
} | |
o ? o.mode = "showing" : i ? i.mode = "showing" : n && (n.mode = "showing") | |
} | |
, | |
o.prototype.toggleDisplay = function() { | |
this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show() | |
} | |
, | |
o.prototype.createEl = function() { | |
return i.prototype.createEl.call(this, "div", { | |
className: "vjs-text-track-display" | |
}, { | |
"aria-live": "off", | |
"aria-atomic": "true" | |
}) | |
} | |
, | |
o.prototype.clearDisplay = function() { | |
"function" == typeof p.WebVTT && p.WebVTT.processCues(p, [], this.el_) | |
} | |
, | |
o.prototype.updateDisplay = function() { | |
var e = this.player_.textTracks(); | |
this.clearDisplay(); | |
for (var t = null, r = null, n = e.length; n--; ) { | |
var i = e[n]; | |
"showing" === i.mode && ("descriptions" === i.kind ? t = i : r = i) | |
} | |
r ? ("off" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "off"), | |
this.updateForTrack(r)) : t && ("assertive" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "assertive"), | |
this.updateForTrack(t)) | |
} | |
, | |
o.prototype.updateForTrack = function(e) { | |
if ("function" == typeof p.WebVTT && e.activeCues) { | |
for (var t = [], r = 0; r < e.activeCues.length; r++) | |
t.push(e.activeCues[r]); | |
if (p.WebVTT.processCues(p, t, this.el_), | |
this.player_.textTrackSettings) | |
for (var n = this.player_.textTrackSettings.getValues(), i = t.length; i--; ) { | |
var o = t[i]; | |
if (o) { | |
var a = o.displayState; | |
if (n.color && (a.firstChild.style.color = n.color), | |
n.textOpacity && Mr(a.firstChild, "color", Ar(n.color || "#fff", n.textOpacity)), | |
n.backgroundColor && (a.firstChild.style.backgroundColor = n.backgroundColor), | |
n.backgroundOpacity && Mr(a.firstChild, "backgroundColor", Ar(n.backgroundColor || "#000", n.backgroundOpacity)), | |
n.windowColor && (n.windowOpacity ? Mr(a, "backgroundColor", Ar(n.windowColor, n.windowOpacity)) : a.style.backgroundColor = n.windowColor), | |
n.edgeStyle && ("dropshadow" === n.edgeStyle ? a.firstChild.style.textShadow = "2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px " + Pr : "raised" === n.edgeStyle ? a.firstChild.style.textShadow = "1px 1px #222, 2px 2px #222, 3px 3px " + Pr : "depressed" === n.edgeStyle ? a.firstChild.style.textShadow = "1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px " + Pr : "uniform" === n.edgeStyle && (a.firstChild.style.textShadow = "0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px " + Pr)), | |
n.fontPercent && 1 !== n.fontPercent) { | |
var s = p.parseFloat(a.style.fontSize); | |
a.style.fontSize = s * n.fontPercent + "px", | |
a.style.height = "auto", | |
a.style.top = "auto", | |
a.style.bottom = "2px" | |
} | |
n.fontFamily && "default" !== n.fontFamily && ("small-caps" === n.fontFamily ? a.firstChild.style.fontVariant = "small-caps" : a.firstChild.style.fontFamily = Or[n.fontFamily]) | |
} | |
} | |
} | |
} | |
, | |
o | |
}(gt); | |
gt.registerComponent("TextTrackDisplay", Dr); | |
var Ir = function(i) { | |
function e() { | |
return B(this, e), | |
q(this, i.apply(this, arguments)) | |
} | |
return H(e, i), | |
e.prototype.createEl = function() { | |
var e = this.player_.isAudio() | |
, t = this.localize(e ? "Audio Player" : "Video Player") | |
, r = le("span", { | |
className: "vjs-control-text", | |
innerHTML: this.localize("{1} is loading.", [t]) | |
}) | |
, n = i.prototype.createEl.call(this, "div", { | |
className: "vjs-loading-spinner", | |
dir: "ltr" | |
}); | |
return n.appendChild(r), | |
n | |
} | |
, | |
e | |
}(gt); | |
gt.registerComponent("LoadingSpinner", Ir); | |
var Rr = function(t) { | |
function e() { | |
return B(this, e), | |
q(this, t.apply(this, arguments)) | |
} | |
return H(e, t), | |
e.prototype.createEl = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}; | |
e = "button", | |
t = G({ | |
innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>', | |
className: this.buildCSSClass() | |
}, t), | |
r = G({ | |
type: "button" | |
}, r); | |
var n = gt.prototype.createEl.call(this, "button", t, r); | |
return this.createControlTextEl(n), | |
n | |
} | |
, | |
e.prototype.addChild = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = this.constructor.name; | |
return Z.warn("Adding an actionable (user controllable) child to a Button (" + r + ") is not supported; use a ClickableComponent instead."), | |
gt.prototype.addChild.call(this, e, t) | |
} | |
, | |
e.prototype.enable = function() { | |
t.prototype.enable.call(this), | |
this.el_.removeAttribute("disabled") | |
} | |
, | |
e.prototype.disable = function() { | |
t.prototype.disable.call(this), | |
this.el_.setAttribute("disabled", "disabled") | |
} | |
, | |
e.prototype.handleKeyPress = function(e) { | |
32 !== e.which && 13 !== e.which && t.prototype.handleKeyPress.call(this, e) | |
} | |
, | |
e | |
}(xr); | |
gt.registerComponent("Button", Rr); | |
var Nr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.mouseused_ = !1, | |
r.on("mousedown", r.handleMouseDown), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-big-play-button" | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
var t = this.player_.play(); | |
if (this.mouseused_ && e.clientX && e.clientY) | |
Dt(t); | |
else { | |
var r = this.player_.getChild("controlBar") | |
, n = r && r.getChild("playToggle"); | |
if (n) { | |
var i = function() { | |
return n.focus() | |
}; | |
Mt(t) ? t.then(i, function() {}) : this.setTimeout(i, 1) | |
} else | |
this.player_.focus() | |
} | |
} | |
, | |
i.prototype.handleKeyPress = function(e) { | |
this.mouseused_ = !1, | |
n.prototype.handleKeyPress.call(this, e) | |
} | |
, | |
i.prototype.handleMouseDown = function(e) { | |
this.mouseused_ = !0 | |
} | |
, | |
i | |
}(Rr); | |
Nr.prototype.controlText_ = "Play Video", | |
gt.registerComponent("BigPlayButton", Nr); | |
var Lr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.controlText(t && t.controlText || r.localize("Close")), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-close-button " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
this.trigger({ | |
type: "close", | |
bubbles: !1 | |
}) | |
} | |
, | |
i | |
}(Rr); | |
gt.registerComponent("CloseButton", Lr); | |
var Fr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "play", r.handlePlay), | |
r.on(e, "pause", r.handlePause), | |
r.on(e, "ended", r.handleEnded), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-play-control " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
this.player_.paused() ? this.player_.play() : this.player_.pause() | |
} | |
, | |
i.prototype.handleSeeked = function(e) { | |
this.removeClass("vjs-ended"), | |
this.player_.paused() ? this.handlePause(e) : this.handlePlay(e) | |
} | |
, | |
i.prototype.handlePlay = function(e) { | |
this.removeClass("vjs-ended"), | |
this.removeClass("vjs-paused"), | |
this.addClass("vjs-playing"), | |
this.controlText("Pause") | |
} | |
, | |
i.prototype.handlePause = function(e) { | |
this.removeClass("vjs-playing"), | |
this.addClass("vjs-paused"), | |
this.controlText("Play") | |
} | |
, | |
i.prototype.handleEnded = function(e) { | |
this.removeClass("vjs-playing"), | |
this.addClass("vjs-ended"), | |
this.controlText("Replay"), | |
this.one(this.player_, "seeked", this.handleSeeked) | |
} | |
, | |
i | |
}(Rr); | |
Fr.prototype.controlText_ = "Play", | |
gt.registerComponent("PlayToggle", Fr); | |
var Br = function(e, t) { | |
e = e < 0 ? 0 : e; | |
var r = Math.floor(e % 60) | |
, n = Math.floor(e / 60 % 60) | |
, i = Math.floor(e / 3600) | |
, o = Math.floor(t / 60 % 60) | |
, a = Math.floor(t / 3600); | |
return (isNaN(e) || e === 1 / 0) && (i = n = r = "-"), | |
(i = 0 < i || 0 < a ? i + ":" : "") + (n = ((i || 10 <= o) && n < 10 ? "0" + n : n) + ":") + (r = r < 10 ? "0" + r : r) | |
} | |
, Hr = Br; | |
var qr = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : e; | |
return Hr(e, t) | |
} | |
, Vr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.throttledUpdateContent = it(nt(r, r.updateContent), 25), | |
r.on(e, "timeupdate", r.throttledUpdateContent), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function(e) { | |
var t = this.buildCSSClass() | |
, r = n.prototype.createEl.call(this, "div", { | |
className: t + " vjs-time-control vjs-control", | |
innerHTML: '<span class="vjs-control-text">' + this.localize(this.labelText_) + " </span>" | |
}); | |
return this.contentEl_ = le("span", { | |
className: t + "-display" | |
}, { | |
"aria-live": "off" | |
}), | |
this.updateTextNode_(), | |
r.appendChild(this.contentEl_), | |
r | |
} | |
, | |
i.prototype.dispose = function() { | |
this.contentEl_ = null, | |
this.textNode_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.updateTextNode_ = function() { | |
if (this.contentEl_) { | |
for (; this.contentEl_.firstChild; ) | |
this.contentEl_.removeChild(this.contentEl_.firstChild); | |
this.textNode_ = f.createTextNode(this.formattedTime_ || this.formatTime_(0)), | |
this.contentEl_.appendChild(this.textNode_) | |
} | |
} | |
, | |
i.prototype.formatTime_ = function(e) { | |
return qr(e) | |
} | |
, | |
i.prototype.updateFormattedTime_ = function(e) { | |
var t = this.formatTime_(e); | |
t !== this.formattedTime_ && (this.formattedTime_ = t, | |
this.requestAnimationFrame(this.updateTextNode_)) | |
} | |
, | |
i.prototype.updateContent = function(e) {} | |
, | |
i | |
}(gt); | |
Vr.prototype.labelText_ = "Time", | |
Vr.prototype.controlText_ = "Time", | |
gt.registerComponent("TimeDisplay", Vr); | |
var Wr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "ended", r.handleEnded), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-current-time" | |
} | |
, | |
i.prototype.updateContent = function(e) { | |
var t = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); | |
this.updateFormattedTime_(t) | |
} | |
, | |
i.prototype.handleEnded = function(e) { | |
this.player_.duration() && this.updateFormattedTime_(this.player_.duration()) | |
} | |
, | |
i | |
}(Vr); | |
Wr.prototype.labelText_ = "Current Time", | |
Wr.prototype.controlText_ = "Current Time", | |
gt.registerComponent("CurrentTimeDisplay", Wr); | |
var Ur = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "durationchange", r.updateContent), | |
r.on(e, "loadedmetadata", r.throttledUpdateContent), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-duration" | |
} | |
, | |
i.prototype.updateContent = function(e) { | |
var t = this.player_.duration(); | |
t && this.duration_ !== t && (this.duration_ = t, | |
this.updateFormattedTime_(t)) | |
} | |
, | |
i | |
}(Vr); | |
Ur.prototype.labelText_ = "Duration", | |
Ur.prototype.controlText_ = "Duration", | |
gt.registerComponent("DurationDisplay", Ur); | |
var zr = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: "vjs-time-control vjs-time-divider", | |
innerHTML: "<div><span>/</span></div>" | |
}) | |
} | |
, | |
t | |
}(gt); | |
gt.registerComponent("TimeDivider", zr); | |
var Gr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "durationchange", r.throttledUpdateContent), | |
r.on(e, "ended", r.handleEnded), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-remaining-time" | |
} | |
, | |
i.prototype.formatTime_ = function(e) { | |
return "-" + n.prototype.formatTime_.call(this, e) | |
} | |
, | |
i.prototype.updateContent = function(e) { | |
this.player_.duration() && (this.player_.remainingTimeDisplay ? this.updateFormattedTime_(this.player_.remainingTimeDisplay()) : this.updateFormattedTime_(this.player_.remainingTime())) | |
} | |
, | |
i.prototype.handleEnded = function(e) { | |
this.player_.duration() && this.updateFormattedTime_(0) | |
} | |
, | |
i | |
}(Vr); | |
Gr.prototype.labelText_ = "Remaining Time", | |
Gr.prototype.controlText_ = "Remaining Time", | |
gt.registerComponent("RemainingTimeDisplay", Gr); | |
var $r = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.updateShowing(), | |
r.on(r.player(), "durationchange", r.updateShowing), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
var e = n.prototype.createEl.call(this, "div", { | |
className: "vjs-live-control vjs-control" | |
}); | |
return this.contentEl_ = le("div", { | |
className: "vjs-live-display", | |
innerHTML: '<span class="vjs-control-text">' + this.localize("Stream Type") + " </span>" + this.localize("LIVE") | |
}, { | |
"aria-live": "off" | |
}), | |
e.appendChild(this.contentEl_), | |
e | |
} | |
, | |
i.prototype.dispose = function() { | |
this.contentEl_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.updateShowing = function(e) { | |
this.player().duration() === 1 / 0 ? this.show() : this.hide() | |
} | |
, | |
i | |
}(gt); | |
gt.registerComponent("LiveDisplay", $r); | |
var Kr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.bar = r.getChild(r.options_.barName), | |
r.vertical(!!r.options_.vertical), | |
r.enable(), | |
r | |
} | |
return H(i, n), | |
i.prototype.enabled = function() { | |
return this.enabled_ | |
} | |
, | |
i.prototype.enable = function() { | |
this.enabled() || (this.on("mousedown", this.handleMouseDown), | |
this.on("touchstart", this.handleMouseDown), | |
this.on("focus", this.handleFocus), | |
this.on("blur", this.handleBlur), | |
this.on("click", this.handleClick), | |
this.on(this.player_, "controlsvisible", this.update), | |
this.playerEvent && this.on(this.player_, this.playerEvent, this.update), | |
this.removeClass("disabled"), | |
this.setAttribute("tabindex", 0), | |
this.enabled_ = !0) | |
} | |
, | |
i.prototype.disable = function() { | |
if (this.enabled()) { | |
var e = this.bar.el_.ownerDocument; | |
this.off("mousedown", this.handleMouseDown), | |
this.off("touchstart", this.handleMouseDown), | |
this.off("focus", this.handleFocus), | |
this.off("blur", this.handleBlur), | |
this.off("click", this.handleClick), | |
this.off(this.player_, "controlsvisible", this.update), | |
this.off(e, "mousemove", this.handleMouseMove), | |
this.off(e, "mouseup", this.handleMouseUp), | |
this.off(e, "touchmove", this.handleMouseMove), | |
this.off(e, "touchend", this.handleMouseUp), | |
this.removeAttribute("tabindex"), | |
this.addClass("disabled"), | |
this.playerEvent && this.off(this.player_, this.playerEvent, this.update), | |
this.enabled_ = !1 | |
} | |
} | |
, | |
i.prototype.createEl = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}; | |
return t.className = t.className + " vjs-slider", | |
t = G({ | |
tabIndex: 0 | |
}, t), | |
r = G({ | |
role: "slider", | |
"aria-valuenow": 0, | |
"aria-valuemin": 0, | |
"aria-valuemax": 100, | |
tabIndex: 0 | |
}, r), | |
n.prototype.createEl.call(this, e, t, r) | |
} | |
, | |
i.prototype.handleMouseDown = function(e) { | |
var t = this.bar.el_.ownerDocument; | |
"mousedown" === e.type && e.preventDefault(), | |
"touchstart" !== e.type || P || e.preventDefault(), | |
be(), | |
this.addClass("vjs-sliding"), | |
this.trigger("slideractive"), | |
this.on(t, "mousemove", this.handleMouseMove), | |
this.on(t, "mouseup", this.handleMouseUp), | |
this.on(t, "touchmove", this.handleMouseMove), | |
this.on(t, "touchend", this.handleMouseUp), | |
this.handleMouseMove(e) | |
} | |
, | |
i.prototype.handleMouseMove = function(e) {} | |
, | |
i.prototype.handleMouseUp = function() { | |
var e = this.bar.el_.ownerDocument; | |
Te(), | |
this.removeClass("vjs-sliding"), | |
this.trigger("sliderinactive"), | |
this.off(e, "mousemove", this.handleMouseMove), | |
this.off(e, "mouseup", this.handleMouseUp), | |
this.off(e, "touchmove", this.handleMouseMove), | |
this.off(e, "touchend", this.handleMouseUp), | |
this.update() | |
} | |
, | |
i.prototype.update = function() { | |
if (this.el_) { | |
var e = this.getPercent() | |
, t = this.bar; | |
if (t) { | |
("number" != typeof e || e != e || e < 0 || e === 1 / 0) && (e = 0); | |
var r = (100 * e).toFixed(2) + "%" | |
, n = t.el().style; | |
return this.vertical() ? n.height = r : n.width = r, | |
e | |
} | |
} | |
} | |
, | |
i.prototype.calculateDistance = function(e) { | |
var t = Se(this.el_, e); | |
return this.vertical() ? t.y : t.x | |
} | |
, | |
i.prototype.handleFocus = function() { | |
this.on(this.bar.el_.ownerDocument, "keydown", this.handleKeyPress) | |
} | |
, | |
i.prototype.handleKeyPress = function(e) { | |
37 === e.which || 40 === e.which ? (e.preventDefault(), | |
this.stepBack()) : 38 !== e.which && 39 !== e.which || (e.preventDefault(), | |
this.stepForward()) | |
} | |
, | |
i.prototype.handleBlur = function() { | |
this.off(this.bar.el_.ownerDocument, "keydown", this.handleKeyPress) | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
e.stopImmediatePropagation(), | |
e.preventDefault() | |
} | |
, | |
i.prototype.vertical = function(e) { | |
if (void 0 === e) | |
return this.vertical_ || !1; | |
this.vertical_ = !!e, | |
this.vertical_ ? this.addClass("vjs-slider-vertical") : this.addClass("vjs-slider-horizontal") | |
} | |
, | |
i | |
}(gt); | |
gt.registerComponent("Slider", Kr); | |
var Xr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.partEls_ = [], | |
r.on(e, "progress", r.update), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: "vjs-load-progress", | |
innerHTML: '<span class="vjs-control-text"><span>' + this.localize("Loaded") + "</span>: 0%</span>" | |
}) | |
} | |
, | |
i.prototype.dispose = function() { | |
this.partEls_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.update = function(e) { | |
var t = this.player_.buffered() | |
, r = this.player_.duration() | |
, n = this.player_.bufferedEnd() | |
, i = this.partEls_ | |
, o = function(e, t) { | |
var r = e / t || 0; | |
return 100 * (1 <= r ? 1 : r) + "%" | |
}; | |
this.el_.style.width = o(n, r); | |
for (var a = 0; a < t.length; a++) { | |
var s = t.start(a) | |
, l = t.end(a) | |
, u = i[a]; | |
u || (u = this.el_.appendChild(le()), | |
i[a] = u), | |
u.style.left = o(s, n), | |
u.style.width = o(l - s, n) | |
} | |
for (var c = i.length; c > t.length; c--) | |
this.el_.removeChild(i[c - 1]); | |
i.length = t.length | |
} | |
, | |
i | |
}(gt); | |
gt.registerComponent("LoadProgressBar", Xr); | |
var Jr = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: "vjs-time-tooltip" | |
}) | |
} | |
, | |
t.prototype.update = function(e, t, r) { | |
var n = we(this.el_) | |
, i = we(this.player_.el()) | |
, o = e.width * t; | |
if (i && n) { | |
var a = e.left - i.left + o | |
, s = e.width - o + (i.right - e.right) | |
, l = n.width / 2; | |
a < l ? l += l - a : s < l && (l = s), | |
l < 0 ? l = 0 : l > n.width && (l = n.width), | |
this.el_.style.right = "-" + l + "px", | |
ue(this.el_, r) | |
} | |
} | |
, | |
t | |
}(gt); | |
gt.registerComponent("TimeTooltip", Jr); | |
var Qr = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: "vjs-play-progress vjs-slider-bar", | |
innerHTML: '<span class="vjs-control-text"><span>' + this.localize("Progress") + "</span>: 0%</span>" | |
}) | |
} | |
, | |
t.prototype.update = function(n, i) { | |
var o = this; | |
this.rafId_ && this.cancelAnimationFrame(this.rafId_), | |
this.rafId_ = this.requestAnimationFrame(function() { | |
var e = o.player_.scrubbing() ? o.player_.getCache().currentTime : o.player_.currentTime() | |
, t = qr(e, o.player_.duration()) | |
, r = o.getChild("timeTooltip"); | |
r && r.update(n, i, t) | |
}) | |
} | |
, | |
t | |
}(gt); | |
Qr.prototype.options_ = { | |
children: [] | |
}, | |
M && !(8 < M) || T || k || Qr.prototype.options_.children.push("timeTooltip"), | |
gt.registerComponent("PlayProgressBar", Qr); | |
var Yr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.update = it(nt(r, r.update), 25), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: "vjs-mouse-display" | |
}) | |
} | |
, | |
i.prototype.update = function(r, n) { | |
var i = this; | |
this.rafId_ && this.cancelAnimationFrame(this.rafId_), | |
this.rafId_ = this.requestAnimationFrame(function() { | |
var e = i.player_.duration() | |
, t = qr(n * e, e); | |
i.el_.style.left = r.width * n + "px", | |
i.getChild("timeTooltip").update(r, n, t) | |
}) | |
} | |
, | |
i | |
}(gt); | |
Yr.prototype.options_ = { | |
children: ["timeTooltip"] | |
}, | |
gt.registerComponent("MouseTimeDisplay", Yr); | |
var Zr = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.setEventHandlers_(), | |
r | |
} | |
return H(i, n), | |
i.prototype.setEventHandlers_ = function() { | |
var e = this; | |
this.update = it(nt(this, this.update), 30), | |
this.on(this.player_, "timeupdate", this.update), | |
this.on(this.player_, "ended", this.handleEnded), | |
this.updateInterval = null, | |
this.on(this.player_, ["playing"], function() { | |
e.clearInterval(e.updateInterval), | |
e.updateInterval = e.setInterval(function() { | |
e.requestAnimationFrame(function() { | |
e.update() | |
}) | |
}, 30) | |
}), | |
this.on(this.player_, ["ended", "pause", "waiting"], function() { | |
e.clearInterval(e.updateInterval) | |
}), | |
this.on(this.player_, ["timeupdate", "ended"], this.update) | |
} | |
, | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: "vjs-progress-holder" | |
}, { | |
"aria-label": this.localize("Progress Bar") | |
}) | |
} | |
, | |
i.prototype.update_ = function(e, t) { | |
var r = this.player_.duration(); | |
this.el_.setAttribute("aria-valuenow", (100 * t).toFixed(2)), | |
this.el_.setAttribute("aria-valuetext", this.localize("progress bar timing: currentTime={1} duration={2}", [qr(e, r), qr(r, r)], "{1} of {2}")), | |
this.bar.update(we(this.el_), t) | |
} | |
, | |
i.prototype.update = function(e) { | |
var t = n.prototype.update.call(this); | |
return this.update_(this.getCurrentTime_(), t), | |
t | |
} | |
, | |
i.prototype.getCurrentTime_ = function() { | |
return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime() | |
} | |
, | |
i.prototype.handleEnded = function(e) { | |
this.update_(this.player_.duration(), 1) | |
} | |
, | |
i.prototype.getPercent = function() { | |
var e = this.getCurrentTime_() / this.player_.duration(); | |
return 1 <= e ? 1 : e | |
} | |
, | |
i.prototype.handleMouseDown = function(e) { | |
Oe(e) && (e.stopPropagation(), | |
this.player_.scrubbing(!0), | |
this.videoWasPlaying = !this.player_.paused(), | |
this.player_.pause(), | |
n.prototype.handleMouseDown.call(this, e)) | |
} | |
, | |
i.prototype.handleMouseMove = function(e) { | |
if (Oe(e)) { | |
var t = this.calculateDistance(e) * this.player_.duration(); | |
t === this.player_.duration() && (t -= .1), | |
this.player_.currentTime(t) | |
} | |
} | |
, | |
i.prototype.enable = function() { | |
n.prototype.enable.call(this); | |
var e = this.getChild("mouseTimeDisplay"); | |
e && e.show() | |
} | |
, | |
i.prototype.disable = function() { | |
n.prototype.disable.call(this); | |
var e = this.getChild("mouseTimeDisplay"); | |
e && e.hide() | |
} | |
, | |
i.prototype.handleMouseUp = function(e) { | |
n.prototype.handleMouseUp.call(this, e), | |
e && e.stopPropagation(), | |
this.player_.scrubbing(!1), | |
this.player_.trigger({ | |
type: "timeupdate", | |
target: this, | |
manuallyTriggered: !0 | |
}), | |
this.videoWasPlaying && Dt(this.player_.play()) | |
} | |
, | |
i.prototype.stepForward = function() { | |
this.player_.currentTime(this.player_.currentTime() + 5) | |
} | |
, | |
i.prototype.stepBack = function() { | |
this.player_.currentTime(this.player_.currentTime() - 5) | |
} | |
, | |
i.prototype.handleAction = function(e) { | |
this.player_.paused() ? this.player_.play() : this.player_.pause() | |
} | |
, | |
i.prototype.handleKeyPress = function(e) { | |
32 === e.which || 13 === e.which ? (e.preventDefault(), | |
this.handleAction(e)) : n.prototype.handleKeyPress && n.prototype.handleKeyPress.call(this, e) | |
} | |
, | |
i | |
}(Kr); | |
Zr.prototype.options_ = { | |
children: ["loadProgressBar", "playProgressBar"], | |
barName: "playProgressBar" | |
}, | |
M && !(8 < M) || T || k || Zr.prototype.options_.children.splice(1, 0, "mouseTimeDisplay"), | |
Zr.prototype.playerEvent = "timeupdate", | |
gt.registerComponent("SeekBar", Zr); | |
var en = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.handleMouseMove = it(nt(r, r.handleMouseMove), 25), | |
r.throttledHandleMouseSeek = it(nt(r, r.handleMouseSeek), 25), | |
r.enable(), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: "vjs-progress-control vjs-control" | |
}) | |
} | |
, | |
i.prototype.handleMouseMove = function(e) { | |
var t = this.getChild("seekBar"); | |
if (t) { | |
var r = t.getChild("mouseTimeDisplay") | |
, n = t.el() | |
, i = we(n) | |
, o = Se(n, e).x; | |
1 < o ? o = 1 : o < 0 && (o = 0), | |
r && r.update(i, o) | |
} | |
} | |
, | |
i.prototype.handleMouseSeek = function(e) { | |
var t = this.getChild("seekBar"); | |
t && t.handleMouseMove(e) | |
} | |
, | |
i.prototype.enabled = function() { | |
return this.enabled_ | |
} | |
, | |
i.prototype.disable = function() { | |
this.children().forEach(function(e) { | |
return e.disable && e.disable() | |
}), | |
this.enabled() && (this.off(["mousedown", "touchstart"], this.handleMouseDown), | |
this.off(this.el_, "mousemove", this.handleMouseMove), | |
this.handleMouseUp(), | |
this.addClass("disabled"), | |
this.enabled_ = !1) | |
} | |
, | |
i.prototype.enable = function() { | |
this.children().forEach(function(e) { | |
return e.enable && e.enable() | |
}), | |
this.enabled() || (this.on(["mousedown", "touchstart"], this.handleMouseDown), | |
this.on(this.el_, "mousemove", this.handleMouseMove), | |
this.removeClass("disabled"), | |
this.enabled_ = !0) | |
} | |
, | |
i.prototype.handleMouseDown = function(e) { | |
var t = this.el_.ownerDocument | |
, r = this.getChild("seekBar"); | |
r && r.handleMouseDown(e), | |
this.on(t, "mousemove", this.throttledHandleMouseSeek), | |
this.on(t, "touchmove", this.throttledHandleMouseSeek), | |
this.on(t, "mouseup", this.handleMouseUp), | |
this.on(t, "touchend", this.handleMouseUp) | |
} | |
, | |
i.prototype.handleMouseUp = function(e) { | |
var t = this.el_.ownerDocument | |
, r = this.getChild("seekBar"); | |
r && r.handleMouseUp(e), | |
this.off(t, "mousemove", this.throttledHandleMouseSeek), | |
this.off(t, "touchmove", this.throttledHandleMouseSeek), | |
this.off(t, "mouseup", this.handleMouseUp), | |
this.off(t, "touchend", this.handleMouseUp) | |
} | |
, | |
i | |
}(gt); | |
en.prototype.options_ = { | |
children: ["seekBar"] | |
}, | |
gt.registerComponent("ProgressControl", en); | |
var tn = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "fullscreenchange", r.handleFullscreenChange), | |
!1 === f[St.fullscreenEnabled] && r.disable(), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-fullscreen-control " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.handleFullscreenChange = function(e) { | |
this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen") | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen() | |
} | |
, | |
i | |
}(Rr); | |
tn.prototype.controlText_ = "Fullscreen", | |
gt.registerComponent("FullscreenToggle", tn); | |
var rn = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: "vjs-volume-level", | |
innerHTML: '<span class="vjs-control-text"></span>' | |
}) | |
} | |
, | |
t | |
}(gt); | |
gt.registerComponent("VolumeLevel", rn); | |
var nn = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on("slideractive", r.updateLastVolume_), | |
r.on(e, "volumechange", r.updateARIAAttributes), | |
e.ready(function() { | |
return r.updateARIAAttributes() | |
}), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
return n.prototype.createEl.call(this, "div", { | |
className: "vjs-volume-bar vjs-slider-bar" | |
}, { | |
"aria-label": this.localize("Volume Level"), | |
"aria-live": "polite" | |
}) | |
} | |
, | |
i.prototype.handleMouseDown = function(e) { | |
Oe(e) && n.prototype.handleMouseDown.call(this, e) | |
} | |
, | |
i.prototype.handleMouseMove = function(e) { | |
Oe(e) && (this.checkMuted(), | |
this.player_.volume(this.calculateDistance(e))) | |
} | |
, | |
i.prototype.checkMuted = function() { | |
this.player_.muted() && this.player_.muted(!1) | |
} | |
, | |
i.prototype.getPercent = function() { | |
return this.player_.muted() ? 0 : this.player_.volume() | |
} | |
, | |
i.prototype.stepForward = function() { | |
this.checkMuted(), | |
this.player_.volume(this.player_.volume() + .1) | |
} | |
, | |
i.prototype.stepBack = function() { | |
this.checkMuted(), | |
this.player_.volume(this.player_.volume() - .1) | |
} | |
, | |
i.prototype.updateARIAAttributes = function(e) { | |
var t = this.player_.muted() ? 0 : this.volumeAsPercentage_(); | |
this.el_.setAttribute("aria-valuenow", t), | |
this.el_.setAttribute("aria-valuetext", t + "%") | |
} | |
, | |
i.prototype.volumeAsPercentage_ = function() { | |
return Math.round(100 * this.player_.volume()) | |
} | |
, | |
i.prototype.updateLastVolume_ = function() { | |
var e = this | |
, t = this.player_.volume(); | |
this.one("sliderinactive", function() { | |
0 === e.player_.volume() && e.player_.lastVolume_(t) | |
}) | |
} | |
, | |
i | |
}(Kr); | |
nn.prototype.options_ = { | |
children: ["volumeLevel"], | |
barName: "volumeLevel" | |
}, | |
nn.prototype.playerEvent = "volumechange", | |
gt.registerComponent("VolumeBar", nn); | |
var on = function(o) { | |
function a(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
B(this, a), | |
t.vertical = t.vertical || !1, | |
(void 0 === t.volumeBar || K(t.volumeBar)) && (t.volumeBar = t.volumeBar || {}, | |
t.volumeBar.vertical = t.vertical); | |
var r, n, i = q(this, o.call(this, e, t)); | |
return r = i, | |
(n = e).tech_ && !n.tech_.featuresVolumeControl && r.addClass("vjs-hidden"), | |
r.on(n, "loadstart", function() { | |
n.tech_.featuresVolumeControl ? r.removeClass("vjs-hidden") : r.addClass("vjs-hidden") | |
}), | |
i.throttledHandleMouseMove = it(nt(i, i.handleMouseMove), 25), | |
i.on("mousedown", i.handleMouseDown), | |
i.on("touchstart", i.handleMouseDown), | |
i.on(i.volumeBar, ["focus", "slideractive"], function() { | |
i.volumeBar.addClass("vjs-slider-active"), | |
i.addClass("vjs-slider-active"), | |
i.trigger("slideractive") | |
}), | |
i.on(i.volumeBar, ["blur", "sliderinactive"], function() { | |
i.volumeBar.removeClass("vjs-slider-active"), | |
i.removeClass("vjs-slider-active"), | |
i.trigger("sliderinactive") | |
}), | |
i | |
} | |
return H(a, o), | |
a.prototype.createEl = function() { | |
var e = "vjs-volume-horizontal"; | |
return this.options_.vertical && (e = "vjs-volume-vertical"), | |
o.prototype.createEl.call(this, "div", { | |
className: "vjs-volume-control vjs-control " + e | |
}) | |
} | |
, | |
a.prototype.handleMouseDown = function(e) { | |
var t = this.el_.ownerDocument; | |
this.on(t, "mousemove", this.throttledHandleMouseMove), | |
this.on(t, "touchmove", this.throttledHandleMouseMove), | |
this.on(t, "mouseup", this.handleMouseUp), | |
this.on(t, "touchend", this.handleMouseUp) | |
} | |
, | |
a.prototype.handleMouseUp = function(e) { | |
var t = this.el_.ownerDocument; | |
this.off(t, "mousemove", this.throttledHandleMouseMove), | |
this.off(t, "touchmove", this.throttledHandleMouseMove), | |
this.off(t, "mouseup", this.handleMouseUp), | |
this.off(t, "touchend", this.handleMouseUp) | |
} | |
, | |
a.prototype.handleMouseMove = function(e) { | |
this.volumeBar.handleMouseMove(e) | |
} | |
, | |
a | |
}(gt); | |
on.prototype.options_ = { | |
children: ["volumeBar"] | |
}, | |
gt.registerComponent("VolumeControl", on); | |
var an = function(o) { | |
function a(e, t) { | |
B(this, a); | |
var r, n, i = q(this, o.call(this, e, t)); | |
return r = i, | |
(n = e).tech_ && !n.tech_.featuresMuteControl && r.addClass("vjs-hidden"), | |
r.on(n, "loadstart", function() { | |
n.tech_.featuresMuteControl ? r.removeClass("vjs-hidden") : r.addClass("vjs-hidden") | |
}), | |
i.on(e, ["loadstart", "volumechange"], i.update), | |
i | |
} | |
return H(a, o), | |
a.prototype.buildCSSClass = function() { | |
return "vjs-mute-control " + o.prototype.buildCSSClass.call(this) | |
} | |
, | |
a.prototype.handleClick = function(e) { | |
var t = this.player_.volume() | |
, r = this.player_.lastVolume_(); | |
if (0 === t) { | |
var n = r < .1 ? .1 : r; | |
this.player_.volume(n), | |
this.player_.muted(!1) | |
} else | |
this.player_.muted(!this.player_.muted()) | |
} | |
, | |
a.prototype.update = function(e) { | |
this.updateIcon_(), | |
this.updateControlText_() | |
} | |
, | |
a.prototype.updateIcon_ = function() { | |
var e = this.player_.volume() | |
, t = 3; | |
T && this.player_.muted(this.player_.tech_.el_.muted), | |
0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2); | |
for (var r = 0; r < 4; r++) | |
pe(this.el_, "vjs-vol-" + r); | |
de(this.el_, "vjs-vol-" + t) | |
} | |
, | |
a.prototype.updateControlText_ = function() { | |
var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute"; | |
this.controlText() !== e && this.controlText(e) | |
} | |
, | |
a | |
}(Rr); | |
an.prototype.controlText_ = "Mute", | |
gt.registerComponent("MuteToggle", an); | |
var sn = function(n) { | |
function i(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
B(this, i), | |
void 0 !== t.inline ? t.inline = t.inline : t.inline = !0, | |
(void 0 === t.volumeControl || K(t.volumeControl)) && (t.volumeControl = t.volumeControl || {}, | |
t.volumeControl.vertical = !t.inline); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, ["loadstart"], r.volumePanelState_), | |
r.on(r.volumeControl, ["slideractive"], r.sliderActive_), | |
r.on(r.volumeControl, ["sliderinactive"], r.sliderInactive_), | |
r | |
} | |
return H(i, n), | |
i.prototype.sliderActive_ = function() { | |
this.addClass("vjs-slider-active") | |
} | |
, | |
i.prototype.sliderInactive_ = function() { | |
this.removeClass("vjs-slider-active") | |
} | |
, | |
i.prototype.volumePanelState_ = function() { | |
this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-hidden"), | |
this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-mute-toggle-only") | |
} | |
, | |
i.prototype.createEl = function() { | |
var e = "vjs-volume-panel-horizontal"; | |
return this.options_.inline || (e = "vjs-volume-panel-vertical"), | |
n.prototype.createEl.call(this, "div", { | |
className: "vjs-volume-panel vjs-control " + e | |
}) | |
} | |
, | |
i | |
}(gt); | |
sn.prototype.options_ = { | |
children: ["muteToggle", "volumeControl"] | |
}, | |
gt.registerComponent("VolumePanel", sn); | |
var ln = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return t && (r.menuButton_ = t.menuButton), | |
r.focusedChild_ = -1, | |
r.on("keydown", r.handleKeyPress), | |
r | |
} | |
return H(i, n), | |
i.prototype.addItem = function(t) { | |
this.addChild(t), | |
t.on("click", nt(this, function(e) { | |
this.menuButton_ && (this.menuButton_.unpressButton(), | |
"CaptionSettingsMenuItem" !== t.name() && this.menuButton_.focus()) | |
})) | |
} | |
, | |
i.prototype.createEl = function() { | |
var e = this.options_.contentElType || "ul"; | |
this.contentEl_ = le(e, { | |
className: "vjs-menu-content" | |
}), | |
this.contentEl_.setAttribute("role", "menu"); | |
var t = n.prototype.createEl.call(this, "div", { | |
append: this.contentEl_, | |
className: "vjs-menu" | |
}); | |
return t.appendChild(this.contentEl_), | |
Ge(t, "click", function(e) { | |
e.preventDefault(), | |
e.stopImmediatePropagation() | |
}), | |
t | |
} | |
, | |
i.prototype.dispose = function() { | |
this.contentEl_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.handleKeyPress = function(e) { | |
37 === e.which || 40 === e.which ? (e.preventDefault(), | |
this.stepForward()) : 38 !== e.which && 39 !== e.which || (e.preventDefault(), | |
this.stepBack()) | |
} | |
, | |
i.prototype.stepForward = function() { | |
var e = 0; | |
void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1), | |
this.focus(e) | |
} | |
, | |
i.prototype.stepBack = function() { | |
var e = 0; | |
void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1), | |
this.focus(e) | |
} | |
, | |
i.prototype.focus = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0 | |
, t = this.children().slice(); | |
t.length && t[0].className && /vjs-menu-title/.test(t[0].className) && t.shift(), | |
0 < t.length && (e < 0 ? e = 0 : e >= t.length && (e = t.length - 1), | |
t[this.focusedChild_ = e].el_.focus()) | |
} | |
, | |
i | |
}(gt); | |
gt.registerComponent("Menu", ln); | |
var un = function(i) { | |
function o(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
B(this, o); | |
var r = q(this, i.call(this, e, t)); | |
r.menuButton_ = new Rr(e,t), | |
r.menuButton_.controlText(r.controlText_), | |
r.menuButton_.el_.setAttribute("aria-haspopup", "true"); | |
var n = Rr.prototype.buildCSSClass(); | |
return r.menuButton_.el_.className = r.buildCSSClass() + " " + n, | |
r.menuButton_.removeClass("vjs-control"), | |
r.addChild(r.menuButton_), | |
r.update(), | |
r.enabled_ = !0, | |
r.on(r.menuButton_, "tap", r.handleClick), | |
r.on(r.menuButton_, "click", r.handleClick), | |
r.on(r.menuButton_, "focus", r.handleFocus), | |
r.on(r.menuButton_, "blur", r.handleBlur), | |
r.on("keydown", r.handleSubmenuKeyPress), | |
r | |
} | |
return H(o, i), | |
o.prototype.update = function() { | |
var e = this.createMenu(); | |
this.menu && (this.menu.dispose(), | |
this.removeChild(this.menu)), | |
this.menu = e, | |
this.addChild(e), | |
this.buttonPressed_ = !1, | |
this.menuButton_.el_.setAttribute("aria-expanded", "false"), | |
this.items && this.items.length <= this.hideThreshold_ ? this.hide() : this.show() | |
} | |
, | |
o.prototype.createMenu = function() { | |
var e = new ln(this.player_,{ | |
menuButton: this | |
}); | |
if (this.hideThreshold_ = 0, | |
this.options_.title) { | |
var t = le("li", { | |
className: "vjs-menu-title", | |
innerHTML: mt(this.options_.title), | |
tabIndex: -1 | |
}); | |
this.hideThreshold_ += 1, | |
e.children_.unshift(t), | |
ce(t, e.contentEl()) | |
} | |
if (this.items = this.createItems(), | |
this.items) | |
for (var r = 0; r < this.items.length; r++) | |
e.addItem(this.items[r]); | |
return e | |
} | |
, | |
o.prototype.createItems = function() {} | |
, | |
o.prototype.createEl = function() { | |
return i.prototype.createEl.call(this, "div", { | |
className: this.buildWrapperCSSClass() | |
}, {}) | |
} | |
, | |
o.prototype.buildWrapperCSSClass = function() { | |
var e = "vjs-menu-button"; | |
return !0 === this.options_.inline ? e += "-inline" : e += "-popup", | |
"vjs-menu-button " + e + " " + Rr.prototype.buildCSSClass() + " " + i.prototype.buildCSSClass.call(this) | |
} | |
, | |
o.prototype.buildCSSClass = function() { | |
var e = "vjs-menu-button"; | |
return !0 === this.options_.inline ? e += "-inline" : e += "-popup", | |
"vjs-menu-button " + e + " " + i.prototype.buildCSSClass.call(this) | |
} | |
, | |
o.prototype.controlText = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.menuButton_.el(); | |
return this.menuButton_.controlText(e, t) | |
} | |
, | |
o.prototype.handleClick = function(e) { | |
this.one(this.menu.contentEl(), "mouseleave", nt(this, function(e) { | |
this.unpressButton(), | |
this.el_.blur() | |
})), | |
this.buttonPressed_ ? this.unpressButton() : this.pressButton() | |
} | |
, | |
o.prototype.focus = function() { | |
this.menuButton_.focus() | |
} | |
, | |
o.prototype.blur = function() { | |
this.menuButton_.blur() | |
} | |
, | |
o.prototype.handleFocus = function() { | |
Ge(f, "keydown", nt(this, this.handleKeyPress)) | |
} | |
, | |
o.prototype.handleBlur = function() { | |
$e(f, "keydown", nt(this, this.handleKeyPress)) | |
} | |
, | |
o.prototype.handleKeyPress = function(e) { | |
27 === e.which || 9 === e.which ? (this.buttonPressed_ && this.unpressButton(), | |
9 !== e.which && (e.preventDefault(), | |
this.menuButton_.el_.focus())) : 38 !== e.which && 40 !== e.which || this.buttonPressed_ || (this.pressButton(), | |
e.preventDefault()) | |
} | |
, | |
o.prototype.handleSubmenuKeyPress = function(e) { | |
27 !== e.which && 9 !== e.which || (this.buttonPressed_ && this.unpressButton(), | |
9 !== e.which && (e.preventDefault(), | |
this.menuButton_.el_.focus())) | |
} | |
, | |
o.prototype.pressButton = function() { | |
if (this.enabled_) { | |
if (this.buttonPressed_ = !0, | |
this.menu.lockShowing(), | |
this.menuButton_.el_.setAttribute("aria-expanded", "true"), | |
T && ae()) | |
return; | |
this.menu.focus() | |
} | |
} | |
, | |
o.prototype.unpressButton = function() { | |
this.enabled_ && (this.buttonPressed_ = !1, | |
this.menu.unlockShowing(), | |
this.menuButton_.el_.setAttribute("aria-expanded", "false")) | |
} | |
, | |
o.prototype.disable = function() { | |
this.unpressButton(), | |
this.enabled_ = !1, | |
this.addClass("vjs-disabled"), | |
this.menuButton_.disable() | |
} | |
, | |
o.prototype.enable = function() { | |
this.enabled_ = !0, | |
this.removeClass("vjs-disabled"), | |
this.menuButton_.enable() | |
} | |
, | |
o | |
}(gt); | |
gt.registerComponent("MenuButton", un); | |
var cn = function(o) { | |
function a(e, t) { | |
B(this, a); | |
var r = t.tracks | |
, n = q(this, o.call(this, e, t)); | |
if (n.items.length <= 1 && n.hide(), | |
!r) | |
return q(n); | |
var i = nt(n, n.update); | |
return r.addEventListener("removetrack", i), | |
r.addEventListener("addtrack", i), | |
n.player_.on("ready", i), | |
n.player_.on("dispose", function() { | |
r.removeEventListener("removetrack", i), | |
r.removeEventListener("addtrack", i) | |
}), | |
n | |
} | |
return H(a, o), | |
a | |
}(un); | |
gt.registerComponent("TrackButton", cn); | |
var hn = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.selectable = t.selectable, | |
r.isSelected_ = t.selected || !1, | |
r.multiSelectable = t.multiSelectable, | |
r.selected(r.isSelected_), | |
r.selectable ? r.multiSelectable ? r.el_.setAttribute("role", "menuitemcheckbox") : r.el_.setAttribute("role", "menuitemradio") : r.el_.setAttribute("role", "menuitem"), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function(e, t, r) { | |
return this.nonIconControl = !0, | |
n.prototype.createEl.call(this, "li", G({ | |
className: "vjs-menu-item", | |
innerHTML: '<span class="vjs-menu-item-text">' + this.localize(this.options_.label) + "</span>", | |
tabIndex: -1 | |
}, t), r) | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
this.selected(!0) | |
} | |
, | |
i.prototype.selected = function(e) { | |
this.selectable && (this.isSelected_ = e ? (this.addClass("vjs-selected"), | |
this.el_.setAttribute("aria-checked", "true"), | |
this.controlText(", selected"), | |
!0) : (this.removeClass("vjs-selected"), | |
this.el_.setAttribute("aria-checked", "false"), | |
this.controlText(""), | |
!1)) | |
} | |
, | |
i | |
}(xr); | |
gt.registerComponent("MenuItem", hn); | |
var dn = function(l) { | |
function u(e, t) { | |
B(this, u); | |
var r = t.track | |
, n = e.textTracks(); | |
t.label = r.label || r.language || "Unknown", | |
t.selected = "showing" === r.mode; | |
var i = q(this, l.call(this, e, t)); | |
i.track = r; | |
var o = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
i.handleTracksChange.apply(i, t) | |
} | |
, a = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
i.handleSelectedLanguageChange.apply(i, t) | |
}; | |
if (e.on(["loadstart", "texttrackchange"], o), | |
n.addEventListener("change", o), | |
n.addEventListener("selectedlanguagechange", a), | |
i.on("dispose", function() { | |
e.off(["loadstart", "texttrackchange"], o), | |
n.removeEventListener("change", o), | |
n.removeEventListener("selectedlanguagechange", a) | |
}), | |
void 0 === n.onchange) { | |
var s = void 0; | |
i.on(["tap", "click"], function() { | |
if ("object" !== F(p.Event)) | |
try { | |
s = new p.Event("change") | |
} catch (e) {} | |
s || (s = f.createEvent("Event")).initEvent("change", !0, !0), | |
n.dispatchEvent(s) | |
}) | |
} | |
return i.handleTracksChange(), | |
i | |
} | |
return H(u, l), | |
u.prototype.handleClick = function(e) { | |
var t = this.track.kind | |
, r = this.track.kinds | |
, n = this.player_.textTracks(); | |
if (r || (r = [t]), | |
l.prototype.handleClick.call(this, e), | |
n) | |
for (var i = 0; i < n.length; i++) { | |
var o = n[i]; | |
o === this.track && -1 < r.indexOf(o.kind) ? "showing" !== o.mode && (o.mode = "showing") : "disabled" !== o.mode && (o.mode = "disabled") | |
} | |
} | |
, | |
u.prototype.handleTracksChange = function(e) { | |
var t = "showing" === this.track.mode; | |
t !== this.isSelected_ && this.selected(t) | |
} | |
, | |
u.prototype.handleSelectedLanguageChange = function(e) { | |
if ("showing" === this.track.mode) { | |
var t = this.player_.cache_.selectedLanguage; | |
if (t && t.enabled && t.language === this.track.language && t.kind !== this.track.kind) | |
return; | |
this.player_.cache_.selectedLanguage = { | |
enabled: !0, | |
language: this.track.language, | |
kind: this.track.kind | |
} | |
} | |
} | |
, | |
u.prototype.dispose = function() { | |
this.track = null, | |
l.prototype.dispose.call(this) | |
} | |
, | |
u | |
}(hn); | |
gt.registerComponent("TextTrackMenuItem", dn); | |
var pn = function(r) { | |
function n(e, t) { | |
return B(this, n), | |
t.track = { | |
player: e, | |
kind: t.kind, | |
kinds: t.kinds, | |
default: !1, | |
mode: "disabled" | |
}, | |
t.kinds || (t.kinds = [t.kind]), | |
t.label ? t.track.label = t.label : t.track.label = t.kinds.join(" and ") + " off", | |
t.selectable = !0, | |
t.multiSelectable = !1, | |
q(this, r.call(this, e, t)) | |
} | |
return H(n, r), | |
n.prototype.handleTracksChange = function(e) { | |
for (var t = this.player().textTracks(), r = !0, n = 0, i = t.length; n < i; n++) { | |
var o = t[n]; | |
if (-1 < this.options_.kinds.indexOf(o.kind) && "showing" === o.mode) { | |
r = !1; | |
break | |
} | |
} | |
r !== this.isSelected_ && this.selected(r) | |
} | |
, | |
n.prototype.handleSelectedLanguageChange = function(e) { | |
for (var t = this.player().textTracks(), r = !0, n = 0, i = t.length; n < i; n++) { | |
var o = t[n]; | |
if (-1 < ["captions", "descriptions", "subtitles"].indexOf(o.kind) && "showing" === o.mode) { | |
r = !1; | |
break | |
} | |
} | |
r && (this.player_.cache_.selectedLanguage = { | |
enabled: !1 | |
}) | |
} | |
, | |
n | |
}(dn); | |
gt.registerComponent("OffTextTrackMenuItem", pn); | |
var fn = function(r) { | |
function n(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
return B(this, n), | |
t.tracks = e.textTracks(), | |
q(this, r.call(this, e, t)) | |
} | |
return H(n, r), | |
n.prototype.createItems = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [] | |
, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : dn | |
, r = void 0; | |
this.label_ && (r = this.label_ + " off"), | |
e.push(new pn(this.player_,{ | |
kinds: this.kinds_, | |
kind: this.kind_, | |
label: r | |
})), | |
this.hideThreshold_ += 1; | |
var n = this.player_.textTracks(); | |
Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]); | |
for (var i = 0; i < n.length; i++) { | |
var o = n[i]; | |
if (-1 < this.kinds_.indexOf(o.kind)) { | |
var a = new t(this.player_,{ | |
track: o, | |
selectable: !0, | |
multiSelectable: !1 | |
}); | |
a.addClass("vjs-" + o.kind + "-menu-item"), | |
e.push(a) | |
} | |
} | |
return e | |
} | |
, | |
n | |
}(cn); | |
gt.registerComponent("TextTrackButton", fn); | |
var vn = function(a) { | |
function s(e, t) { | |
B(this, s); | |
var r = t.track | |
, n = t.cue | |
, i = e.currentTime(); | |
t.selectable = !0, | |
t.multiSelectable = !1, | |
t.label = n.text, | |
t.selected = n.startTime <= i && i < n.endTime; | |
var o = q(this, a.call(this, e, t)); | |
return o.track = r, | |
o.cue = n, | |
r.addEventListener("cuechange", nt(o, o.update)), | |
o | |
} | |
return H(s, a), | |
s.prototype.handleClick = function(e) { | |
a.prototype.handleClick.call(this), | |
this.player_.currentTime(this.cue.startTime), | |
this.update(this.cue.startTime) | |
} | |
, | |
s.prototype.update = function(e) { | |
var t = this.cue | |
, r = this.player_.currentTime(); | |
this.selected(t.startTime <= r && r < t.endTime) | |
} | |
, | |
s | |
}(hn); | |
gt.registerComponent("ChaptersTrackMenuItem", vn); | |
var yn = function(n) { | |
function i(e, t, r) { | |
return B(this, i), | |
q(this, n.call(this, e, t, r)) | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-chapters-button " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.buildWrapperCSSClass = function() { | |
return "vjs-chapters-button " + n.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
i.prototype.update = function(e) { | |
this.track_ && (!e || "addtrack" !== e.type && "removetrack" !== e.type) || this.setTrack(this.findChaptersTrack()), | |
n.prototype.update.call(this) | |
} | |
, | |
i.prototype.setTrack = function(e) { | |
if (this.track_ !== e) { | |
if (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)), | |
this.track_) { | |
var t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); | |
t && t.removeEventListener("load", this.updateHandler_), | |
this.track_ = null | |
} | |
if (this.track_ = e, | |
this.track_) { | |
this.track_.mode = "hidden"; | |
var r = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); | |
r && r.addEventListener("load", this.updateHandler_) | |
} | |
} | |
} | |
, | |
i.prototype.findChaptersTrack = function() { | |
for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) { | |
var r = e[t]; | |
if (r.kind === this.kind_) | |
return r | |
} | |
} | |
, | |
i.prototype.getMenuCaption = function() { | |
return this.track_ && this.track_.label ? this.track_.label : this.localize(mt(this.kind_)) | |
} | |
, | |
i.prototype.createMenu = function() { | |
return this.options_.title = this.getMenuCaption(), | |
n.prototype.createMenu.call(this) | |
} | |
, | |
i.prototype.createItems = function() { | |
var e = []; | |
if (!this.track_) | |
return e; | |
var t = this.track_.cues; | |
if (!t) | |
return e; | |
for (var r = 0, n = t.length; r < n; r++) { | |
var i = t[r] | |
, o = new vn(this.player_,{ | |
track: this.track_, | |
cue: i | |
}); | |
e.push(o) | |
} | |
return e | |
} | |
, | |
i | |
}(fn); | |
yn.prototype.kind_ = "chapters", | |
yn.prototype.controlText_ = "Chapters", | |
gt.registerComponent("ChaptersButton", yn); | |
var mn = function(a) { | |
function s(e, t, r) { | |
B(this, s); | |
var n = q(this, a.call(this, e, t, r)) | |
, i = e.textTracks() | |
, o = nt(n, n.handleTracksChange); | |
return i.addEventListener("change", o), | |
n.on("dispose", function() { | |
i.removeEventListener("change", o) | |
}), | |
n | |
} | |
return H(s, a), | |
s.prototype.handleTracksChange = function(e) { | |
for (var t = this.player().textTracks(), r = !1, n = 0, i = t.length; n < i; n++) { | |
var o = t[n]; | |
if (o.kind !== this.kind_ && "showing" === o.mode) { | |
r = !0; | |
break | |
} | |
} | |
r ? this.disable() : this.enable() | |
} | |
, | |
s.prototype.buildCSSClass = function() { | |
return "vjs-descriptions-button " + a.prototype.buildCSSClass.call(this) | |
} | |
, | |
s.prototype.buildWrapperCSSClass = function() { | |
return "vjs-descriptions-button " + a.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
s | |
}(fn); | |
mn.prototype.kind_ = "descriptions", | |
mn.prototype.controlText_ = "Descriptions", | |
gt.registerComponent("DescriptionsButton", mn); | |
var _n = function(n) { | |
function i(e, t, r) { | |
return B(this, i), | |
q(this, n.call(this, e, t, r)) | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-subtitles-button " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.buildWrapperCSSClass = function() { | |
return "vjs-subtitles-button " + n.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
i | |
}(fn); | |
_n.prototype.kind_ = "subtitles", | |
_n.prototype.controlText_ = "Subtitles", | |
gt.registerComponent("SubtitlesButton", _n); | |
var gn = function(n) { | |
function i(e, t) { | |
B(this, i), | |
t.track = { | |
player: e, | |
kind: t.kind, | |
label: t.kind + " settings", | |
selectable: !1, | |
default: !1, | |
mode: "disabled" | |
}, | |
t.selectable = !1, | |
t.name = "CaptionSettingsMenuItem"; | |
var r = q(this, n.call(this, e, t)); | |
return r.addClass("vjs-texttrack-settings"), | |
r.controlText(", opens " + t.kind + " settings dialog"), | |
r | |
} | |
return H(i, n), | |
i.prototype.handleClick = function(e) { | |
this.player().getChild("textTrackSettings").open() | |
} | |
, | |
i | |
}(dn); | |
gt.registerComponent("CaptionSettingsMenuItem", gn); | |
var bn = function(n) { | |
function i(e, t, r) { | |
return B(this, i), | |
q(this, n.call(this, e, t, r)) | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-captions-button " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.buildWrapperCSSClass = function() { | |
return "vjs-captions-button " + n.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
i.prototype.createItems = function() { | |
var e = []; | |
return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new gn(this.player_,{ | |
kind: this.kind_ | |
})), | |
this.hideThreshold_ += 1), | |
n.prototype.createItems.call(this, e) | |
} | |
, | |
i | |
}(fn); | |
bn.prototype.kind_ = "captions", | |
bn.prototype.controlText_ = "Captions", | |
gt.registerComponent("CaptionsButton", bn); | |
var Tn = function(i) { | |
function e() { | |
return B(this, e), | |
q(this, i.apply(this, arguments)) | |
} | |
return H(e, i), | |
e.prototype.createEl = function(e, t, r) { | |
var n = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label); | |
return "captions" === this.options_.track.kind && (n += '\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> ' + this.localize("Captions") + "</span>\n "), | |
n += "</span>", | |
i.prototype.createEl.call(this, e, G({ | |
innerHTML: n | |
}, t), r) | |
} | |
, | |
e | |
}(dn); | |
gt.registerComponent("SubsCapsMenuItem", Tn); | |
var wn = function(n) { | |
function i(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.label_ = "subtitles", | |
-1 < ["en", "en-us", "en-ca", "fr-ca"].indexOf(r.player_.language_) && (r.label_ = "captions"), | |
r.menuButton_.controlText(mt(r.label_)), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-subs-caps-button " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.buildWrapperCSSClass = function() { | |
return "vjs-subs-caps-button " + n.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
i.prototype.createItems = function() { | |
var e = []; | |
return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new gn(this.player_,{ | |
kind: this.label_ | |
})), | |
this.hideThreshold_ += 1), | |
e = n.prototype.createItems.call(this, e, Tn) | |
} | |
, | |
i | |
}(fn); | |
wn.prototype.kinds_ = ["captions", "subtitles"], | |
wn.prototype.controlText_ = "Subtitles", | |
gt.registerComponent("SubsCapsButton", wn); | |
var kn = function(a) { | |
function s(e, t) { | |
B(this, s); | |
var r = t.track | |
, n = e.audioTracks(); | |
t.label = r.label || r.language || "Unknown", | |
t.selected = r.enabled; | |
var i = q(this, a.call(this, e, t)); | |
i.track = r, | |
i.addClass("vjs-" + r.kind + "-menu-item"); | |
var o = function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
i.handleTracksChange.apply(i, t) | |
}; | |
return n.addEventListener("change", o), | |
i.on("dispose", function() { | |
n.removeEventListener("change", o) | |
}), | |
i | |
} | |
return H(s, a), | |
s.prototype.createEl = function(e, t, r) { | |
var n = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label); | |
return "main-desc" === this.options_.track.kind && (n += '\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> ' + this.localize("Descriptions") + "</span>\n "), | |
n += "</span>", | |
a.prototype.createEl.call(this, e, G({ | |
innerHTML: n | |
}, t), r) | |
} | |
, | |
s.prototype.handleClick = function(e) { | |
var t = this.player_.audioTracks(); | |
a.prototype.handleClick.call(this, e); | |
for (var r = 0; r < t.length; r++) { | |
var n = t[r]; | |
n.enabled = n === this.track | |
} | |
} | |
, | |
s.prototype.handleTracksChange = function(e) { | |
this.selected(this.track.enabled) | |
} | |
, | |
s | |
}(hn); | |
gt.registerComponent("AudioTrackMenuItem", kn); | |
var Sn = function(r) { | |
function n(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
return B(this, n), | |
t.tracks = e.audioTracks(), | |
q(this, r.call(this, e, t)) | |
} | |
return H(n, r), | |
n.prototype.buildCSSClass = function() { | |
return "vjs-audio-button " + r.prototype.buildCSSClass.call(this) | |
} | |
, | |
n.prototype.buildWrapperCSSClass = function() { | |
return "vjs-audio-button " + r.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
n.prototype.createItems = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : []; | |
this.hideThreshold_ = 1; | |
for (var t = this.player_.audioTracks(), r = 0; r < t.length; r++) { | |
var n = t[r]; | |
e.push(new kn(this.player_,{ | |
track: n, | |
selectable: !0, | |
multiSelectable: !1 | |
})) | |
} | |
return e | |
} | |
, | |
n | |
}(cn); | |
Sn.prototype.controlText_ = "Audio Track", | |
gt.registerComponent("AudioTrackButton", Sn); | |
var Cn = function(o) { | |
function a(e, t) { | |
B(this, a); | |
var r = t.rate | |
, n = parseFloat(r, 10); | |
t.label = r, | |
t.selected = 1 === n, | |
t.selectable = !0, | |
t.multiSelectable = !1; | |
var i = q(this, o.call(this, e, t)); | |
return i.label = r, | |
i.rate = n, | |
i.on(e, "ratechange", i.update), | |
i | |
} | |
return H(a, o), | |
a.prototype.handleClick = function(e) { | |
o.prototype.handleClick.call(this), | |
this.player().playbackRate(this.rate) | |
} | |
, | |
a.prototype.update = function(e) { | |
this.selected(this.player().playbackRate() === this.rate) | |
} | |
, | |
a | |
}(hn); | |
Cn.prototype.contentElType = "button", | |
gt.registerComponent("PlaybackRateMenuItem", Cn); | |
var En = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.updateVisibility(), | |
r.updateLabel(), | |
r.on(e, "loadstart", r.updateVisibility), | |
r.on(e, "ratechange", r.updateLabel), | |
r | |
} | |
return H(i, n), | |
i.prototype.createEl = function() { | |
var e = n.prototype.createEl.call(this); | |
return this.labelEl_ = le("div", { | |
className: "vjs-playback-rate-value", | |
innerHTML: "1x" | |
}), | |
e.appendChild(this.labelEl_), | |
e | |
} | |
, | |
i.prototype.dispose = function() { | |
this.labelEl_ = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.buildCSSClass = function() { | |
return "vjs-playback-rate " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.buildWrapperCSSClass = function() { | |
return "vjs-playback-rate " + n.prototype.buildWrapperCSSClass.call(this) | |
} | |
, | |
i.prototype.createMenu = function() { | |
var e = new ln(this.player()) | |
, t = this.playbackRates(); | |
if (t) | |
for (var r = t.length - 1; 0 <= r; r--) | |
e.addChild(new Cn(this.player(),{ | |
rate: t[r] + "x" | |
})); | |
return e | |
} | |
, | |
i.prototype.updateARIAAttributes = function() { | |
this.el().setAttribute("aria-valuenow", this.player().playbackRate()) | |
} | |
, | |
i.prototype.handleClick = function(e) { | |
for (var t = this.player().playbackRate(), r = this.playbackRates(), n = r[0], i = 0; i < r.length; i++) | |
if (r[i] > t) { | |
n = r[i]; | |
break | |
} | |
this.player().playbackRate(n) | |
} | |
, | |
i.prototype.playbackRates = function() { | |
return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates | |
} | |
, | |
i.prototype.playbackRateSupported = function() { | |
return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length | |
} | |
, | |
i.prototype.updateVisibility = function(e) { | |
this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden") | |
} | |
, | |
i.prototype.updateLabel = function(e) { | |
this.playbackRateSupported() && (this.labelEl_.innerHTML = this.player().playbackRate() + "x") | |
} | |
, | |
i | |
}(un); | |
En.prototype.controlText_ = "Playback Rate", | |
gt.registerComponent("PlaybackRateMenuButton", En); | |
var xn = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.buildCSSClass = function() { | |
return "vjs-spacer " + e.prototype.buildCSSClass.call(this) | |
} | |
, | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: this.buildCSSClass() | |
}) | |
} | |
, | |
t | |
}(gt); | |
gt.registerComponent("Spacer", xn); | |
var jn = function(t) { | |
function e() { | |
return B(this, e), | |
q(this, t.apply(this, arguments)) | |
} | |
return H(e, t), | |
e.prototype.buildCSSClass = function() { | |
return "vjs-custom-control-spacer " + t.prototype.buildCSSClass.call(this) | |
} | |
, | |
e.prototype.createEl = function() { | |
var e = t.prototype.createEl.call(this, { | |
className: this.buildCSSClass() | |
}); | |
return e.innerHTML = " ", | |
e | |
} | |
, | |
e | |
}(xn); | |
gt.registerComponent("CustomControlSpacer", jn); | |
var Pn = function(e) { | |
function t() { | |
return B(this, t), | |
q(this, e.apply(this, arguments)) | |
} | |
return H(t, e), | |
t.prototype.createEl = function() { | |
return e.prototype.createEl.call(this, "div", { | |
className: "vjs-control-bar", | |
dir: "ltr" | |
}) | |
} | |
, | |
t | |
}(gt); | |
Pn.prototype.options_ = { | |
children: ["playToggle", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"] | |
}, | |
gt.registerComponent("ControlBar", Pn); | |
var On = function(n) { | |
function i(e, t) { | |
B(this, i); | |
var r = q(this, n.call(this, e, t)); | |
return r.on(e, "error", r.open), | |
r | |
} | |
return H(i, n), | |
i.prototype.buildCSSClass = function() { | |
return "vjs-error-display " + n.prototype.buildCSSClass.call(this) | |
} | |
, | |
i.prototype.content = function() { | |
var e = this.player().error(); | |
return e ? this.localize(e.message) : "" | |
} | |
, | |
i | |
}(Ft); | |
On.prototype.options_ = _t(Ft.prototype.options_, { | |
pauseOnOpen: !1, | |
fillAlways: !0, | |
temporary: !1, | |
uncloseable: !0 | |
}), | |
gt.registerComponent("ErrorDisplay", On); | |
var An = "vjs-text-track-settings" | |
, Mn = ["#000", "Black"] | |
, Dn = ["#00F", "Blue"] | |
, In = ["#0FF", "Cyan"] | |
, Rn = ["#0F0", "Green"] | |
, Nn = ["#F0F", "Magenta"] | |
, Ln = ["#F00", "Red"] | |
, Fn = ["#FFF", "White"] | |
, Bn = ["#FF0", "Yellow"] | |
, Hn = ["1", "Opaque"] | |
, qn = ["0.5", "Semi-Transparent"] | |
, Vn = ["0", "Transparent"] | |
, Wn = { | |
backgroundColor: { | |
selector: ".vjs-bg-color > select", | |
id: "captions-background-color-%s", | |
label: "Color", | |
options: [Mn, Fn, Ln, Rn, Dn, Bn, Nn, In] | |
}, | |
backgroundOpacity: { | |
selector: ".vjs-bg-opacity > select", | |
id: "captions-background-opacity-%s", | |
label: "Transparency", | |
options: [Hn, qn, Vn] | |
}, | |
color: { | |
selector: ".vjs-fg-color > select", | |
id: "captions-foreground-color-%s", | |
label: "Color", | |
options: [Fn, Mn, Ln, Rn, Dn, Bn, Nn, In] | |
}, | |
edgeStyle: { | |
selector: ".vjs-edge-style > select", | |
id: "%s", | |
label: "Text Edge Style", | |
options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]] | |
}, | |
fontFamily: { | |
selector: ".vjs-font-family > select", | |
id: "captions-font-family-%s", | |
label: "Font Family", | |
options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]] | |
}, | |
fontPercent: { | |
selector: ".vjs-font-percent > select", | |
id: "captions-font-size-%s", | |
label: "Font Size", | |
options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]], | |
default: 2, | |
parser: function(e) { | |
return "1.00" === e ? null : Number(e) | |
} | |
}, | |
textOpacity: { | |
selector: ".vjs-text-opacity > select", | |
id: "captions-foreground-opacity-%s", | |
label: "Transparency", | |
options: [Hn, qn] | |
}, | |
windowColor: { | |
selector: ".vjs-window-color > select", | |
id: "captions-window-color-%s", | |
label: "Color" | |
}, | |
windowOpacity: { | |
selector: ".vjs-window-opacity > select", | |
id: "captions-window-opacity-%s", | |
label: "Transparency", | |
options: [Vn, qn, Hn] | |
} | |
}; | |
function Un(e, t) { | |
if (t && (e = t(e)), | |
e && "none" !== e) | |
return e | |
} | |
Wn.windowColor.options = Wn.backgroundColor.options; | |
var zn = function(n) { | |
function i(e, t) { | |
B(this, i), | |
t.temporary = !1; | |
var r = q(this, n.call(this, e, t)); | |
return r.updateDisplay = nt(r, r.updateDisplay), | |
r.fill(), | |
r.hasBeenOpened_ = r.hasBeenFilled_ = !0, | |
r.endDialog = le("p", { | |
className: "vjs-control-text", | |
textContent: r.localize("End of dialog window.") | |
}), | |
r.el().appendChild(r.endDialog), | |
r.setDefaults(), | |
void 0 === t.persistTextTrackSettings && (r.options_.persistTextTrackSettings = r.options_.playerOptions.persistTextTrackSettings), | |
r.on(r.$(".vjs-done-button"), "click", function() { | |
r.saveSettings(), | |
r.close() | |
}), | |
r.on(r.$(".vjs-default-button"), "click", function() { | |
r.setDefaults(), | |
r.updateDisplay() | |
}), | |
z(Wn, function(e) { | |
r.on(r.$(e.selector), "change", r.updateDisplay) | |
}), | |
r.options_.persistTextTrackSettings && r.restoreSettings(), | |
r | |
} | |
return H(i, n), | |
i.prototype.dispose = function() { | |
this.endDialog = null, | |
n.prototype.dispose.call(this) | |
} | |
, | |
i.prototype.createElSelect_ = function(e) { | |
var r = this | |
, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "" | |
, n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : "label" | |
, i = Wn[e] | |
, o = i.id.replace("%s", this.id_) | |
, a = [t, o].join(" ").trim(); | |
return ["<" + n + ' id="' + o + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(i.label), "</" + n + ">", '<select aria-labelledby="' + a + '">'].concat(i.options.map(function(e) { | |
var t = o + "-" + e[1].replace(/\W+/g, ""); | |
return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + " " + t + '">', r.localize(e[1]), "</option>"].join("") | |
})).concat("</select>").join("") | |
} | |
, | |
i.prototype.createElFgColor_ = function() { | |
var e = "captions-text-legend-" + this.id_; | |
return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", e), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", e), "</span>", "</fieldset>"].join("") | |
} | |
, | |
i.prototype.createElBgColor_ = function() { | |
var e = "captions-background-" + this.id_; | |
return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", e), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", e), "</span>", "</fieldset>"].join("") | |
} | |
, | |
i.prototype.createElWinColor_ = function() { | |
var e = "captions-window-" + this.id_; | |
return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", e), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", e), "</span>", "</fieldset>"].join("") | |
} | |
, | |
i.prototype.createElColors_ = function() { | |
return le("div", { | |
className: "vjs-track-settings-colors", | |
innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("") | |
}) | |
} | |
, | |
i.prototype.createElFont_ = function() { | |
return le("div", { | |
className: "vjs-track-settings-font", | |
innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("") | |
}) | |
} | |
, | |
i.prototype.createElControls_ = function() { | |
var e = this.localize("restore all settings to the default values"); | |
return le("div", { | |
className: "vjs-track-settings-controls", | |
innerHTML: ['<button class="vjs-default-button" title="' + e + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + e + "</span>", "</button>", '<button class="vjs-done-button">' + this.localize("Done") + "</button>"].join("") | |
}) | |
} | |
, | |
i.prototype.content = function() { | |
return [this.createElColors_(), this.createElFont_(), this.createElControls_()] | |
} | |
, | |
i.prototype.label = function() { | |
return this.localize("Caption Settings Dialog") | |
} | |
, | |
i.prototype.description = function() { | |
return this.localize("Beginning of dialog window. Escape will cancel and close the window.") | |
} | |
, | |
i.prototype.buildCSSClass = function() { | |
return n.prototype.buildCSSClass.call(this) + " vjs-text-track-settings" | |
} | |
, | |
i.prototype.getValues = function() { | |
var a = this; | |
return function(r, n) { | |
var e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 0; | |
return U(r).reduce(function(e, t) { | |
return n(e, r[t], t) | |
}, e) | |
}(Wn, function(e, t, r) { | |
var n, i, o = (n = a.$(t.selector), | |
i = t.parser, | |
Un(n.options[n.options.selectedIndex].value, i)); | |
return void 0 !== o && (e[r] = o), | |
e | |
}, {}) | |
} | |
, | |
i.prototype.setValues = function(r) { | |
var n = this; | |
z(Wn, function(e, t) { | |
!function(e, t, r) { | |
if (t) | |
for (var n = 0; n < e.options.length; n++) | |
if (Un(e.options[n].value, r) === t) { | |
e.selectedIndex = n; | |
break | |
} | |
}(n.$(e.selector), r[t], e.parser) | |
}) | |
} | |
, | |
i.prototype.setDefaults = function() { | |
var r = this; | |
z(Wn, function(e) { | |
var t = e.hasOwnProperty("default") ? e.default : 0; | |
r.$(e.selector).selectedIndex = t | |
}) | |
} | |
, | |
i.prototype.restoreSettings = function() { | |
var e = void 0; | |
try { | |
e = JSON.parse(p.localStorage.getItem(An)) | |
} catch (e) { | |
Z.warn(e) | |
} | |
e && this.setValues(e) | |
} | |
, | |
i.prototype.saveSettings = function() { | |
if (this.options_.persistTextTrackSettings) { | |
var e = this.getValues(); | |
try { | |
Object.keys(e).length ? p.localStorage.setItem(An, JSON.stringify(e)) : p.localStorage.removeItem(An) | |
} catch (e) { | |
Z.warn(e) | |
} | |
} | |
} | |
, | |
i.prototype.updateDisplay = function() { | |
var e = this.player_.getChild("textTrackDisplay"); | |
e && e.updateDisplay() | |
} | |
, | |
i.prototype.conditionalBlur_ = function() { | |
this.previouslyActiveEl_ = null, | |
this.off(f, "keydown", this.handleKeyDown); | |
var e = this.player_.controlBar | |
, t = e && e.subsCapsButton | |
, r = e && e.captionsButton; | |
t ? t.focus() : r && r.focus() | |
} | |
, | |
i | |
}(Ft); | |
gt.registerComponent("TextTrackSettings", zn); | |
var Gn = function(o) { | |
function a(e, t) { | |
B(this, a); | |
var r = t.ResizeObserver || p.ResizeObserver; | |
null === t.ResizeObserver && (r = !1); | |
var n = _t({ | |
createEl: !r | |
}, t) | |
, i = q(this, o.call(this, e, n)); | |
return i.ResizeObserver = t.ResizeObserver || p.ResizeObserver, | |
i.loadListener_ = null, | |
i.resizeObserver_ = null, | |
i.debouncedHandler_ = function(n, i, o) { | |
var a = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : p | |
, s = void 0; | |
return function() { | |
var e = this | |
, t = arguments | |
, r = function() { | |
r = s = null, | |
o || n.apply(e, t) | |
}; | |
!s && o && n.apply(e, t), | |
a.clearTimeout(s), | |
s = a.setTimeout(r, i) | |
} | |
}(function() { | |
i.resizeHandler() | |
}, 100, !1, e), | |
r ? (i.resizeObserver_ = new i.ResizeObserver(i.debouncedHandler_), | |
i.resizeObserver_.observe(e.el())) : (i.loadListener_ = function() { | |
i.el_.contentWindow && Ge(i.el_.contentWindow, "resize", i.debouncedHandler_), | |
i.off("load", i.loadListener_) | |
} | |
, | |
i.on("load", i.loadListener_)), | |
i | |
} | |
return H(a, o), | |
a.prototype.createEl = function() { | |
return o.prototype.createEl.call(this, "iframe", { | |
className: "vjs-resize-manager" | |
}) | |
} | |
, | |
a.prototype.resizeHandler = function() { | |
this.player_.trigger("playerresize") | |
} | |
, | |
a.prototype.dispose = function() { | |
this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()), | |
this.resizeObserver_.disconnect()), | |
this.el_ && this.el_.contentWindow && $e(this.el_.contentWindow, "resize", this.debouncedHandler_), | |
this.loadListener_ && this.off("load", this.loadListener_), | |
this.ResizeObserver = null, | |
this.resizeObserver = null, | |
this.debouncedHandler_ = null, | |
this.loadListener_ = null | |
} | |
, | |
a | |
}(gt); | |
gt.registerComponent("ResizeManager", Gn); | |
var $n = function(e) { | |
var t = e.el(); | |
if (t.hasAttribute("src")) | |
return e.triggerSourceset(t.src), | |
!0; | |
var r = e.$$("source") | |
, n = [] | |
, i = ""; | |
if (!r.length) | |
return !1; | |
for (var o = 0; o < r.length; o++) { | |
var a = r[o].src; | |
a && -1 === n.indexOf(a) && n.push(a) | |
} | |
return !!n.length && (1 === n.length && (i = n[0]), | |
e.triggerSourceset(i), | |
!0) | |
} | |
, Kn = {}; | |
A || (Kn = Object.defineProperty({}, "innerHTML", { | |
get: function() { | |
return this.cloneNode(!0).innerHTML | |
}, | |
set: function(e) { | |
var t = f.createElement(this.nodeName.toLowerCase()); | |
t.innerHTML = e; | |
for (var r = f.createDocumentFragment(); t.childNodes.length; ) | |
r.appendChild(t.childNodes[0]); | |
return this.innerText = "", | |
p.Element.prototype.appendChild.call(this, r), | |
this.innerHTML | |
} | |
})); | |
var Xn = function(e, t) { | |
for (var r = {}, n = 0; n < e.length && !((r = Object.getOwnPropertyDescriptor(e[n], t)) && r.set && r.get); n++) | |
; | |
return r.enumerable = !0, | |
r.configurable = !0, | |
r | |
} | |
, Jn = function(o) { | |
var a = o.el(); | |
if (!a.resetSourceWatch_) { | |
var t = {} | |
, e = Xn([o.el(), p.HTMLMediaElement.prototype, p.Element.prototype, Kn], "innerHTML") | |
, r = function(i) { | |
return function() { | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
var n = i.apply(a, t); | |
return $n(o), | |
n | |
} | |
}; | |
["append", "appendChild", "insertAdjacentHTML"].forEach(function(e) { | |
a[e] && (t[e] = a[e], | |
a[e] = r(t[e])) | |
}), | |
Object.defineProperty(a, "innerHTML", _t(e, { | |
set: r(e.set) | |
})), | |
a.resetSourceWatch_ = function() { | |
a.resetSourceWatch_ = null, | |
Object.keys(t).forEach(function(e) { | |
a[e] = t[e] | |
}), | |
Object.defineProperty(a, "innerHTML", e) | |
} | |
, | |
o.one("sourceset", a.resetSourceWatch_) | |
} | |
} | |
, Qn = {}; | |
A || (Qn = Object.defineProperty({}, "src", { | |
get: function() { | |
return this.hasAttribute("src") ? er(p.Element.prototype.getAttribute.call(this, "src")) : "" | |
}, | |
set: function(e) { | |
return p.Element.prototype.setAttribute.call(this, "src", e), | |
e | |
} | |
})); | |
var Yn = function(n) { | |
if (n.featuresSourceset) { | |
var i = n.el(); | |
if (!i.resetSourceset_) { | |
var r = Xn([n.el(), p.HTMLMediaElement.prototype, Qn], "src") | |
, o = i.setAttribute | |
, t = i.load; | |
Object.defineProperty(i, "src", _t(r, { | |
set: function(e) { | |
var t = r.set.call(i, e); | |
return n.triggerSourceset(i.src), | |
t | |
} | |
})), | |
i.setAttribute = function(e, t) { | |
var r = o.call(i, e, t); | |
return /src/i.test(e) && n.triggerSourceset(i.src), | |
r | |
} | |
, | |
i.load = function() { | |
var e = t.call(i); | |
return $n(n) || (n.triggerSourceset(""), | |
Jn(n)), | |
e | |
} | |
, | |
i.currentSrc ? n.triggerSourceset(i.currentSrc) : $n(n) || Jn(n), | |
i.resetSourceset_ = function() { | |
i.resetSourceset_ = null, | |
i.load = t, | |
i.setAttribute = o, | |
Object.defineProperty(i, "src", r), | |
i.resetSourceWatch_ && i.resetSourceWatch_() | |
} | |
} | |
} | |
} | |
, Zn = V(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."], ["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]) | |
, ei = function(c) { | |
function h(e, t) { | |
B(this, h); | |
var r = q(this, c.call(this, e, t)) | |
, n = e.source | |
, i = !1; | |
if (n && (r.el_.currentSrc !== n.src || e.tag && 3 === e.tag.initNetworkState_) ? r.setSource(n) : r.handleLateInit_(r.el_), | |
e.enableSourceset && r.setupSourcesetHandling_(), | |
r.el_.hasChildNodes()) { | |
for (var o = r.el_.childNodes, a = o.length, s = []; a--; ) { | |
var l = o[a]; | |
"track" === l.nodeName.toLowerCase() && (r.featuresNativeTextTracks ? (r.remoteTextTrackEls().addTrackElement_(l), | |
r.remoteTextTracks().addTrack(l.track), | |
r.textTracks().addTrack(l.track), | |
i || r.el_.hasAttribute("crossorigin") || !rr(l.src) || (i = !0)) : s.push(l)) | |
} | |
for (var u = 0; u < s.length; u++) | |
r.el_.removeChild(s[u]) | |
} | |
return r.proxyNativeTracks_(), | |
r.featuresNativeTextTracks && i && Z.warn(d(Zn)), | |
r.restoreMetadataTracksInIOSNativePlayer_(), | |
(R || g || E) && !0 === e.nativeControlsForTouch && r.setControls(!0), | |
r.proxyWebkitFullscreen_(), | |
r.triggerReady(), | |
r | |
} | |
return H(h, c), | |
h.prototype.dispose = function() { | |
this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(), | |
h.disposeMediaElement(this.el_), | |
this.options_ = null, | |
c.prototype.dispose.call(this) | |
} | |
, | |
h.prototype.setupSourcesetHandling_ = function() { | |
Yn(this) | |
} | |
, | |
h.prototype.restoreMetadataTracksInIOSNativePlayer_ = function() { | |
var n = this.textTracks() | |
, i = void 0 | |
, e = function() { | |
i = []; | |
for (var e = 0; e < n.length; e++) { | |
var t = n[e]; | |
"metadata" === t.kind && i.push({ | |
track: t, | |
storedMode: t.mode | |
}) | |
} | |
}; | |
e(), | |
n.addEventListener("change", e), | |
this.on("dispose", function() { | |
return n.removeEventListener("change", e) | |
}); | |
var t = function e() { | |
for (var t = 0; t < i.length; t++) { | |
var r = i[t]; | |
"disabled" === r.track.mode && r.track.mode !== r.storedMode && (r.track.mode = r.storedMode) | |
} | |
n.removeEventListener("change", e) | |
}; | |
this.on("webkitbeginfullscreen", function() { | |
n.removeEventListener("change", e), | |
n.removeEventListener("change", t), | |
n.addEventListener("change", t) | |
}), | |
this.on("webkitendfullscreen", function() { | |
n.removeEventListener("change", e), | |
n.addEventListener("change", e), | |
n.removeEventListener("change", t) | |
}) | |
} | |
, | |
h.prototype.proxyNativeTracks_ = function() { | |
var a = this; | |
ur.names.forEach(function(e) { | |
var t = ur[e] | |
, i = a.el()[t.getterName] | |
, o = a[t.getterName](); | |
if (a["featuresNative" + t.capitalName + "Tracks"] && i && i.addEventListener) { | |
var n = { | |
change: function(e) { | |
o.trigger({ | |
type: "change", | |
target: o, | |
currentTarget: o, | |
srcElement: o | |
}) | |
}, | |
addtrack: function(e) { | |
o.addTrack(e.track) | |
}, | |
removetrack: function(e) { | |
o.removeTrack(e.track) | |
} | |
} | |
, r = function() { | |
for (var e = [], t = 0; t < o.length; t++) { | |
for (var r = !1, n = 0; n < i.length; n++) | |
if (i[n] === o[t]) { | |
r = !0; | |
break | |
} | |
r || e.push(o[t]) | |
} | |
for (; e.length; ) | |
o.removeTrack(e.shift()) | |
}; | |
Object.keys(n).forEach(function(t) { | |
var r = n[t]; | |
i.addEventListener(t, r), | |
a.on("dispose", function(e) { | |
return i.removeEventListener(t, r) | |
}) | |
}), | |
a.on("loadstart", r), | |
a.on("dispose", function(e) { | |
return a.off("loadstart", r) | |
}) | |
} | |
}) | |
} | |
, | |
h.prototype.createEl = function() { | |
var e = this.options_.tag; | |
if (!e || !this.options_.playerElIngest && !this.movingMediaElementInDOM) { | |
if (e) { | |
var t = e.cloneNode(!0); | |
e.parentNode && e.parentNode.insertBefore(t, e), | |
h.disposeMediaElement(e), | |
e = t | |
} else { | |
e = f.createElement("video"); | |
var r = _t({}, this.options_.tag && ye(this.options_.tag)); | |
R && !0 === this.options_.nativeControlsForTouch || delete r.controls, | |
ve(e, G(r, { | |
id: this.options_.techId, | |
class: "vjs-tech" | |
})) | |
} | |
e.playerId = this.options_.playerId | |
} | |
void 0 !== this.options_.preload && _e(e, "preload", this.options_.preload); | |
for (var n = ["loop", "muted", "playsinline", "autoplay"], i = 0; i < n.length; i++) { | |
var o = n[i] | |
, a = this.options_[o]; | |
void 0 !== a && (a ? _e(e, o, o) : ge(e, o), | |
e[o] = a) | |
} | |
return e | |
} | |
, | |
h.prototype.handleLateInit_ = function(e) { | |
if (0 !== e.networkState && 3 !== e.networkState) { | |
if (0 === e.readyState) { | |
var t = !1 | |
, r = function() { | |
t = !0 | |
}; | |
this.on("loadstart", r); | |
var n = function() { | |
t || this.trigger("loadstart") | |
}; | |
return this.on("loadedmetadata", n), | |
void this.ready(function() { | |
this.off("loadstart", r), | |
this.off("loadedmetadata", n), | |
t || this.trigger("loadstart") | |
}) | |
} | |
var i = ["loadstart"]; | |
i.push("loadedmetadata"), | |
2 <= e.readyState && i.push("loadeddata"), | |
3 <= e.readyState && i.push("canplay"), | |
4 <= e.readyState && i.push("canplaythrough"), | |
this.ready(function() { | |
i.forEach(function(e) { | |
this.trigger(e) | |
}, this) | |
}) | |
} | |
} | |
, | |
h.prototype.setCurrentTime = function(e) { | |
try { | |
this.el_.currentTime = e | |
} catch (e) { | |
Z(e, "Video is not ready. (Video.js)") | |
} | |
} | |
, | |
h.prototype.duration = function() { | |
var t = this; | |
if (this.el_.duration === 1 / 0 && k && P && 0 === this.el_.currentTime) { | |
return this.on("timeupdate", function e() { | |
0 < t.el_.currentTime && (t.el_.duration === 1 / 0 && t.trigger("durationchange"), | |
t.off("timeupdate", e)) | |
}), | |
NaN | |
} | |
return this.el_.duration || NaN | |
} | |
, | |
h.prototype.width = function() { | |
return this.el_.offsetWidth | |
} | |
, | |
h.prototype.height = function() { | |
return this.el_.offsetHeight | |
} | |
, | |
h.prototype.proxyWebkitFullscreen_ = function() { | |
var e = this; | |
if ("webkitDisplayingFullscreen"in this.el_) { | |
var t = function() { | |
this.trigger("fullscreenchange", { | |
isFullscreen: !1 | |
}) | |
} | |
, r = function() { | |
"webkitPresentationMode"in this.el_ && "picture-in-picture" !== this.el_.webkitPresentationMode && (this.one("webkitendfullscreen", t), | |
this.trigger("fullscreenchange", { | |
isFullscreen: !0 | |
})) | |
}; | |
this.on("webkitbeginfullscreen", r), | |
this.on("dispose", function() { | |
e.off("webkitbeginfullscreen", r), | |
e.off("webkitendfullscreen", t) | |
}) | |
} | |
} | |
, | |
h.prototype.supportsFullScreen = function() { | |
if ("function" == typeof this.el_.webkitEnterFullScreen) { | |
var e = p.navigator && p.navigator.userAgent || ""; | |
if (/Android/.test(e) || !/Chrome|Mac OS X 10.5/.test(e)) | |
return !0 | |
} | |
return !1 | |
} | |
, | |
h.prototype.enterFullScreen = function() { | |
var e = this.el_; | |
e.paused && e.networkState <= e.HAVE_METADATA ? (this.el_.play(), | |
this.setTimeout(function() { | |
e.pause(), | |
e.webkitEnterFullScreen() | |
}, 0)) : e.webkitEnterFullScreen() | |
} | |
, | |
h.prototype.exitFullScreen = function() { | |
this.el_.webkitExitFullScreen() | |
} | |
, | |
h.prototype.src = function(e) { | |
if (void 0 === e) | |
return this.el_.src; | |
this.setSrc(e) | |
} | |
, | |
h.prototype.reset = function() { | |
h.resetMediaElement(this.el_) | |
} | |
, | |
h.prototype.currentSrc = function() { | |
return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc | |
} | |
, | |
h.prototype.setControls = function(e) { | |
this.el_.controls = !!e | |
} | |
, | |
h.prototype.addTextTrack = function(e, t, r) { | |
return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, r) : c.prototype.addTextTrack.call(this, e, t, r) | |
} | |
, | |
h.prototype.createRemoteTextTrack = function(e) { | |
if (!this.featuresNativeTextTracks) | |
return c.prototype.createRemoteTextTrack.call(this, e); | |
var t = f.createElement("track"); | |
return e.kind && (t.kind = e.kind), | |
e.label && (t.label = e.label), | |
(e.language || e.srclang) && (t.srclang = e.language || e.srclang), | |
e.default && (t.default = e.default), | |
e.id && (t.id = e.id), | |
e.src && (t.src = e.src), | |
t | |
} | |
, | |
h.prototype.addRemoteTextTrack = function(e, t) { | |
var r = c.prototype.addRemoteTextTrack.call(this, e, t); | |
return this.featuresNativeTextTracks && this.el().appendChild(r), | |
r | |
} | |
, | |
h.prototype.removeRemoteTextTrack = function(e) { | |
if (c.prototype.removeRemoteTextTrack.call(this, e), | |
this.featuresNativeTextTracks) | |
for (var t = this.$$("track"), r = t.length; r--; ) | |
e !== t[r] && e !== t[r].track || this.el().removeChild(t[r]) | |
} | |
, | |
h.prototype.getVideoPlaybackQuality = function() { | |
if ("function" == typeof this.el().getVideoPlaybackQuality) | |
return this.el().getVideoPlaybackQuality(); | |
var e = {}; | |
return void 0 !== this.el().webkitDroppedFrameCount && void 0 !== this.el().webkitDecodedFrameCount && (e.droppedVideoFrames = this.el().webkitDroppedFrameCount, | |
e.totalVideoFrames = this.el().webkitDecodedFrameCount), | |
p.performance && "function" == typeof p.performance.now ? e.creationTime = p.performance.now() : p.performance && p.performance.timing && "number" == typeof p.performance.timing.navigationStart && (e.creationTime = p.Date.now() - p.performance.timing.navigationStart), | |
e | |
} | |
, | |
h | |
}(dr); | |
if (ie()) { | |
ei.TEST_VID = f.createElement("video"); | |
var ti = f.createElement("track"); | |
ti.kind = "captions", | |
ti.srclang = "en", | |
ti.label = "English", | |
ei.TEST_VID.appendChild(ti) | |
} | |
ei.isSupported = function() { | |
try { | |
ei.TEST_VID.volume = .5 | |
} catch (e) { | |
return !1 | |
} | |
return !(!ei.TEST_VID || !ei.TEST_VID.canPlayType) | |
} | |
, | |
ei.canPlayType = function(e) { | |
return ei.TEST_VID.canPlayType(e) | |
} | |
, | |
ei.canPlaySource = function(e, t) { | |
return ei.canPlayType(e.type) | |
} | |
, | |
ei.canControlVolume = function() { | |
try { | |
var e = ei.TEST_VID.volume; | |
return ei.TEST_VID.volume = e / 2 + .1, | |
e !== ei.TEST_VID.volume | |
} catch (e) { | |
return !1 | |
} | |
} | |
, | |
ei.canMuteVolume = function() { | |
try { | |
var e = ei.TEST_VID.muted; | |
return ei.TEST_VID.muted = !e, | |
ei.TEST_VID.muted ? _e(ei.TEST_VID, "muted", "muted") : ge(ei.TEST_VID, "muted"), | |
e !== ei.TEST_VID.muted | |
} catch (e) { | |
return !1 | |
} | |
} | |
, | |
ei.canControlPlaybackRate = function() { | |
if (k && P && O < 58) | |
return !1; | |
try { | |
var e = ei.TEST_VID.playbackRate; | |
return ei.TEST_VID.playbackRate = e / 2 + .1, | |
e !== ei.TEST_VID.playbackRate | |
} catch (e) { | |
return !1 | |
} | |
} | |
, | |
ei.canOverrideAttributes = function() { | |
if (A) | |
return !1; | |
try { | |
var e = function() {}; | |
Object.defineProperty(f.createElement("video"), "src", { | |
get: e, | |
set: e | |
}), | |
Object.defineProperty(f.createElement("audio"), "src", { | |
get: e, | |
set: e | |
}), | |
Object.defineProperty(f.createElement("video"), "innerHTML", { | |
get: e, | |
set: e | |
}), | |
Object.defineProperty(f.createElement("audio"), "innerHTML", { | |
get: e, | |
set: e | |
}) | |
} catch (e) { | |
return !1 | |
} | |
return !0 | |
} | |
, | |
ei.supportsNativeTextTracks = function() { | |
return I || T && P | |
} | |
, | |
ei.supportsNativeVideoTracks = function() { | |
return !(!ei.TEST_VID || !ei.TEST_VID.videoTracks) | |
} | |
, | |
ei.supportsNativeAudioTracks = function() { | |
return !(!ei.TEST_VID || !ei.TEST_VID.audioTracks) | |
} | |
, | |
ei.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"], | |
ei.prototype.featuresVolumeControl = ei.canControlVolume(), | |
ei.prototype.featuresMuteControl = ei.canMuteVolume(), | |
ei.prototype.featuresPlaybackRate = ei.canControlPlaybackRate(), | |
ei.prototype.featuresSourceset = ei.canOverrideAttributes(), | |
ei.prototype.movingMediaElementInDOM = !T, | |
ei.prototype.featuresFullscreenResize = !0, | |
ei.prototype.featuresProgressEvents = !0, | |
ei.prototype.featuresTimeupdateEvents = !0, | |
ei.prototype.featuresNativeTextTracks = ei.supportsNativeTextTracks(), | |
ei.prototype.featuresNativeVideoTracks = ei.supportsNativeVideoTracks(), | |
ei.prototype.featuresNativeAudioTracks = ei.supportsNativeAudioTracks(); | |
var ri = ei.TEST_VID && ei.TEST_VID.constructor.prototype.canPlayType | |
, ni = /^application\/(?:x-|vnd\.apple\.)mpegurl/i | |
, ii = /^video\/mp4/i; | |
ei.patchCanPlayType = function() { | |
4 <= S && !x && !P ? ei.TEST_VID.constructor.prototype.canPlayType = function(e) { | |
return e && ni.test(e) ? "maybe" : ri.call(this, e) | |
} | |
: C && (ei.TEST_VID.constructor.prototype.canPlayType = function(e) { | |
return e && ii.test(e) ? "maybe" : ri.call(this, e) | |
} | |
) | |
} | |
, | |
ei.unpatchCanPlayType = function() { | |
var e = ei.TEST_VID.constructor.prototype.canPlayType; | |
return ei.TEST_VID.constructor.prototype.canPlayType = ri, | |
e | |
} | |
, | |
ei.patchCanPlayType(), | |
ei.disposeMediaElement = function(e) { | |
if (e) { | |
for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes(); ) | |
e.removeChild(e.firstChild); | |
e.removeAttribute("src"), | |
"function" == typeof e.load && function() { | |
try { | |
e.load() | |
} catch (e) {} | |
}() | |
} | |
} | |
, | |
ei.resetMediaElement = function(e) { | |
if (e) { | |
for (var t = e.querySelectorAll("source"), r = t.length; r--; ) | |
e.removeChild(t[r]); | |
e.removeAttribute("src"), | |
"function" == typeof e.load && function() { | |
try { | |
e.load() | |
} catch (e) {} | |
}() | |
} | |
} | |
, | |
["muted", "defaultMuted", "autoplay", "controls", "loop", "playsinline"].forEach(function(e) { | |
ei.prototype[e] = function() { | |
return this.el_[e] || this.el_.hasAttribute(e) | |
} | |
}), | |
["muted", "defaultMuted", "autoplay", "loop", "playsinline"].forEach(function(t) { | |
ei.prototype["set" + mt(t)] = function(e) { | |
(this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t) | |
} | |
}), | |
["paused", "currentTime", "buffered", "volume", "poster", "preload", "error", "seeking", "seekable", "ended", "playbackRate", "defaultPlaybackRate", "played", "networkState", "readyState", "videoWidth", "videoHeight"].forEach(function(e) { | |
ei.prototype[e] = function() { | |
return this.el_[e] | |
} | |
}), | |
["volume", "src", "poster", "preload", "playbackRate", "defaultPlaybackRate"].forEach(function(t) { | |
ei.prototype["set" + mt(t)] = function(e) { | |
this.el_[t] = e | |
} | |
}), | |
["pause", "load", "play"].forEach(function(e) { | |
ei.prototype[e] = function() { | |
return this.el_[e]() | |
} | |
}), | |
dr.withSourceHandlers(ei), | |
ei.nativeSourceHandler = {}, | |
ei.nativeSourceHandler.canPlayType = function(e) { | |
try { | |
return ei.TEST_VID.canPlayType(e) | |
} catch (e) { | |
return "" | |
} | |
} | |
, | |
ei.nativeSourceHandler.canHandleSource = function(e, t) { | |
if (e.type) | |
return ei.nativeSourceHandler.canPlayType(e.type); | |
if (e.src) { | |
var r = tr(e.src); | |
return ei.nativeSourceHandler.canPlayType("video/" + r) | |
} | |
return "" | |
} | |
, | |
ei.nativeSourceHandler.handleSource = function(e, t, r) { | |
t.setSrc(e.src) | |
} | |
, | |
ei.nativeSourceHandler.dispose = function() {} | |
, | |
ei.registerSourceHandler(ei.nativeSourceHandler), | |
dr.registerTech("Html5", ei); | |
var oi = V(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "], ["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]) | |
, ai = ["progress", "abort", "suspend", "emptied", "stalled", "loadedmetadata", "loadeddata", "timeupdate", "resize", "volumechange", "texttrackchange"] | |
, si = { | |
canplay: "CanPlay", | |
canplaythrough: "CanPlayThrough", | |
playing: "Playing", | |
seeked: "Seeked" | |
} | |
, li = function(c) { | |
function h(e, t, r) { | |
if (B(this, h), | |
e.id = e.id || t.id || "vjs_video_" + Re(), | |
(t = G(h.getTagSettings(e), t)).initChildren = !1, | |
t.createEl = !1, | |
t.evented = !1, | |
t.reportTouchActivity = !1, | |
!t.language) | |
if ("function" == typeof e.closest) { | |
var n = e.closest("[lang]"); | |
n && n.getAttribute && (t.language = n.getAttribute("lang")) | |
} else | |
for (var i = e; i && 1 === i.nodeType; ) { | |
if (ye(i).hasOwnProperty("lang")) { | |
t.language = i.getAttribute("lang"); | |
break | |
} | |
i = i.parentNode | |
} | |
var o = q(this, c.call(this, null, t, r)); | |
if (o.isPosterFromTech_ = !1, | |
o.queuedCallbacks_ = [], | |
o.isReady_ = !1, | |
o.hasStarted_ = !1, | |
o.userActive_ = !1, | |
!o.options_ || !o.options_.techOrder || !o.options_.techOrder.length) | |
throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?"); | |
if (o.tag = e, | |
o.tagAttributes = e && ye(e), | |
o.language(o.options_.language), | |
t.languages) { | |
var a = {}; | |
Object.getOwnPropertyNames(t.languages).forEach(function(e) { | |
a[e.toLowerCase()] = t.languages[e] | |
}), | |
o.languages_ = a | |
} else | |
o.languages_ = h.prototype.options_.languages; | |
o.cache_ = {}, | |
o.poster_ = t.poster || "", | |
o.controls_ = !!t.controls, | |
o.cache_.lastVolume = 1, | |
e.controls = !1, | |
e.removeAttribute("controls"), | |
e.hasAttribute("autoplay") ? o.options_.autoplay = !0 : o.autoplay(o.options_.autoplay), | |
o.scrubbing_ = !1, | |
o.el_ = o.createEl(), | |
o.cache_.lastPlaybackRate = o.defaultPlaybackRate(), | |
ft(o, { | |
eventBusKey: "el_" | |
}); | |
var s = _t(o.options_); | |
if (t.plugins) { | |
var l = t.plugins; | |
Object.keys(l).forEach(function(e) { | |
if ("function" != typeof this[e]) | |
throw new Error('plugin "' + e + '" does not exist'); | |
this[e](l[e]) | |
}, o) | |
} | |
o.options_.playerOptions = s, | |
o.middleware_ = [], | |
o.initChildren(), | |
o.isAudio("audio" === e.nodeName.toLowerCase()), | |
o.controls() ? o.addClass("vjs-controls-enabled") : o.addClass("vjs-controls-disabled"), | |
o.el_.setAttribute("role", "region"), | |
o.isAudio() ? o.el_.setAttribute("aria-label", o.localize("Audio Player")) : o.el_.setAttribute("aria-label", o.localize("Video Player")), | |
o.isAudio() && o.addClass("vjs-audio"), | |
o.flexNotSupported_() && o.addClass("vjs-no-flex"), | |
T || o.addClass("vjs-workinghover"), | |
h.players[o.id_] = o; | |
var u = m.split(".")[0]; | |
return o.addClass("vjs-v" + u), | |
o.userActive(!0), | |
o.reportUserActivity(), | |
o.one("play", o.listenForUserActivity_), | |
o.on("fullscreenchange", o.handleFullscreenChange_), | |
o.on("stageclick", o.handleStageClick_), | |
o.changingSrc_ = !1, | |
o.playWaitingForReady_ = !1, | |
o.playOnLoadstart_ = null, | |
o | |
} | |
return H(h, c), | |
h.prototype.dispose = function() { | |
this.trigger("dispose"), | |
this.off("dispose"), | |
this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_), | |
this.styleEl_ = null), | |
h.players[this.id_] = null, | |
this.tag && this.tag.player && (this.tag.player = null), | |
this.el_ && this.el_.player && (this.el_.player = null), | |
this.tech_ && (this.tech_.dispose(), | |
this.isPosterFromTech_ = !1, | |
this.poster_ = ""), | |
this.playerElIngest_ && (this.playerElIngest_ = null), | |
this.tag && (this.tag = null), | |
fr[this.id()] = null, | |
c.prototype.dispose.call(this) | |
} | |
, | |
h.prototype.createEl = function() { | |
var t = this.tag | |
, r = void 0 | |
, e = this.playerElIngest_ = t.parentNode && t.parentNode.hasAttribute && t.parentNode.hasAttribute("data-vjs-player") | |
, n = "video-js" === this.tag.tagName.toLowerCase(); | |
e ? r = this.el_ = t.parentNode : n || (r = this.el_ = c.prototype.createEl.call(this, "div")); | |
var i = ye(t); | |
if (n) { | |
for (r = this.el_ = t, | |
t = this.tag = f.createElement("video"); r.children.length; ) | |
t.appendChild(r.firstChild); | |
he(r, "video-js") || de(r, "video-js"), | |
r.appendChild(t), | |
e = this.playerElIngest_ = r, | |
["autoplay", "controls", "crossOrigin", "defaultMuted", "defaultPlaybackRate", "loop", "muted", "playbackRate", "src", "volume"].forEach(function(e) { | |
void 0 !== r[e] && (t[e] = r[e]) | |
}) | |
} | |
if (t.setAttribute("tabindex", "-1"), | |
M && t.setAttribute("role", "application"), | |
t.removeAttribute("width"), | |
t.removeAttribute("height"), | |
Object.getOwnPropertyNames(i).forEach(function(e) { | |
"class" === e ? (r.className += " " + i[e], | |
n && (t.className += " " + i[e])) : (r.setAttribute(e, i[e]), | |
n && t.setAttribute(e, i[e])) | |
}), | |
t.playerId = t.id, | |
t.id += "_html5_api", | |
t.className = "vjs-tech", | |
t.player = r.player = this, | |
this.addClass("vjs-paused"), | |
!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) { | |
this.styleEl_ = tt("vjs-styles-dimensions"); | |
var o = Ae(".vjs-styles-defaults") | |
, a = Ae("head"); | |
a.insertBefore(this.styleEl_, o ? o.nextSibling : a.firstChild) | |
} | |
this.width(this.options_.width), | |
this.height(this.options_.height), | |
this.fluid(this.options_.fluid), | |
this.aspectRatio(this.options_.aspectRatio); | |
for (var s = t.getElementsByTagName("a"), l = 0; l < s.length; l++) { | |
var u = s.item(l); | |
de(u, "vjs-hidden"), | |
u.setAttribute("hidden", "hidden") | |
} | |
return t.initNetworkState_ = t.networkState, | |
t.parentNode && !e && t.parentNode.insertBefore(r, t), | |
ce(t, r), | |
this.children_.unshift(t), | |
this.el_.setAttribute("lang", this.language_), | |
this.el_ = r | |
} | |
, | |
h.prototype.width = function(e) { | |
return this.dimension("width", e) | |
} | |
, | |
h.prototype.height = function(e) { | |
return this.dimension("height", e) | |
} | |
, | |
h.prototype.dimension = function(e, t) { | |
var r = e + "_"; | |
if (void 0 === t) | |
return this[r] || 0; | |
if ("" === t) | |
return this[r] = void 0, | |
void this.updateStyleEl_(); | |
var n = parseFloat(t); | |
isNaN(n) ? Z.error('Improper value "' + t + '" supplied for for ' + e) : (this[r] = n, | |
this.updateStyleEl_()) | |
} | |
, | |
h.prototype.fluid = function(e) { | |
if (void 0 === e) | |
return !!this.fluid_; | |
this.fluid_ = !!e, | |
e ? this.addClass("vjs-fluid") : this.removeClass("vjs-fluid"), | |
this.updateStyleEl_() | |
} | |
, | |
h.prototype.aspectRatio = function(e) { | |
if (void 0 === e) | |
return this.aspectRatio_; | |
if (!/^\d+\:\d+$/.test(e)) | |
throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9."); | |
this.aspectRatio_ = e, | |
this.fluid(!0), | |
this.updateStyleEl_() | |
} | |
, | |
h.prototype.updateStyleEl_ = function() { | |
if (!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) { | |
var e = void 0 | |
, t = void 0 | |
, r = void 0 | |
, n = (void 0 !== this.aspectRatio_ && "auto" !== this.aspectRatio_ ? this.aspectRatio_ : 0 < this.videoWidth() ? this.videoWidth() + ":" + this.videoHeight() : "16:9").split(":") | |
, i = n[1] / n[0]; | |
e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / i : this.videoWidth() || 300, | |
t = void 0 !== this.height_ ? this.height_ : e * i, | |
r = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions", | |
this.addClass(r), | |
rt(this.styleEl_, "\n ." + r + " {\n width: " + e + "px;\n height: " + t + "px;\n }\n\n ." + r + ".vjs-fluid {\n padding-top: " + 100 * i + "%;\n }\n ") | |
} else { | |
var o = "number" == typeof this.width_ ? this.width_ : this.options_.width | |
, a = "number" == typeof this.height_ ? this.height_ : this.options_.height | |
, s = this.tech_ && this.tech_.el(); | |
s && (0 <= o && (s.width = o), | |
0 <= a && (s.height = a)) | |
} | |
} | |
, | |
h.prototype.loadTech_ = function(e, t) { | |
var r = this; | |
this.tech_ && this.unloadTech_(); | |
var n = mt(e) | |
, i = e.charAt(0).toLowerCase() + e.slice(1); | |
"Html5" !== n && this.tag && (dr.getTech("Html5").disposeMediaElement(this.tag), | |
this.tag.player = null, | |
this.tag = null), | |
this.techName_ = n, | |
this.isReady_ = !1; | |
var o = { | |
source: t, | |
autoplay: "string" != typeof this.autoplay() && this.autoplay(), | |
nativeControlsForTouch: this.options_.nativeControlsForTouch, | |
playerId: this.id(), | |
techId: this.id() + "_" + n + "_api", | |
playsinline: this.options_.playsinline, | |
preload: this.options_.preload, | |
loop: this.options_.loop, | |
muted: this.options_.muted, | |
poster: this.poster(), | |
language: this.language(), | |
playerElIngest: this.playerElIngest_ || !1, | |
"vtt.js": this.options_["vtt.js"], | |
canOverridePoster: !!this.options_.techCanOverridePoster, | |
enableSourceset: this.options_.enableSourceset | |
}; | |
hr.names.forEach(function(e) { | |
var t = hr[e]; | |
o[t.getterName] = r[t.privateName] | |
}), | |
G(o, this.options_[n]), | |
G(o, this.options_[i]), | |
G(o, this.options_[e.toLowerCase()]), | |
this.tag && (o.tag = this.tag), | |
t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (o.startTime = this.cache_.currentTime); | |
var a = dr.getTech(e); | |
if (!a) | |
throw new Error("No Tech named '" + n + "' exists! '" + n + "' should be registered using videojs.registerTech()'"); | |
this.tech_ = new a(o), | |
this.tech_.ready(nt(this, this.handleTechReady_), !0), | |
Nt(this.textTracksJson_ || [], this.tech_), | |
ai.forEach(function(e) { | |
r.on(r.tech_, e, r["handleTech" + mt(e) + "_"]) | |
}), | |
Object.keys(si).forEach(function(t) { | |
r.on(r.tech_, t, function(e) { | |
0 === r.tech_.playbackRate() && r.tech_.seeking() ? r.queuedCallbacks_.push({ | |
callback: r["handleTech" + si[t] + "_"].bind(r), | |
event: e | |
}) : r["handleTech" + si[t] + "_"](e) | |
}) | |
}), | |
this.on(this.tech_, "loadstart", this.handleTechLoadStart_), | |
this.on(this.tech_, "sourceset", this.handleTechSourceset_), | |
this.on(this.tech_, "waiting", this.handleTechWaiting_), | |
this.on(this.tech_, "ended", this.handleTechEnded_), | |
this.on(this.tech_, "seeking", this.handleTechSeeking_), | |
this.on(this.tech_, "play", this.handleTechPlay_), | |
this.on(this.tech_, "firstplay", this.handleTechFirstPlay_), | |
this.on(this.tech_, "pause", this.handleTechPause_), | |
this.on(this.tech_, "durationchange", this.handleTechDurationChange_), | |
this.on(this.tech_, "fullscreenchange", this.handleTechFullscreenChange_), | |
this.on(this.tech_, "error", this.handleTechError_), | |
this.on(this.tech_, "loadedmetadata", this.updateStyleEl_), | |
this.on(this.tech_, "posterchange", this.handleTechPosterChange_), | |
this.on(this.tech_, "textdata", this.handleTechTextData_), | |
this.on(this.tech_, "ratechange", this.handleTechRateChange_), | |
this.usingNativeControls(this.techGet_("controls")), | |
this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(), | |
this.tech_.el().parentNode === this.el() || "Html5" === n && this.tag || ce(this.tech_.el(), this.el()), | |
this.tag && (this.tag.player = null, | |
this.tag = null) | |
} | |
, | |
h.prototype.unloadTech_ = function() { | |
var r = this; | |
hr.names.forEach(function(e) { | |
var t = hr[e]; | |
r[t.privateName] = r[t.getterName]() | |
}), | |
this.textTracksJson_ = Rt(this.tech_), | |
this.isReady_ = !1, | |
this.tech_.dispose(), | |
this.tech_ = !1, | |
this.isPosterFromTech_ && (this.poster_ = "", | |
this.trigger("posterchange")), | |
this.isPosterFromTech_ = !1 | |
} | |
, | |
h.prototype.tech = function(e) { | |
return void 0 === e && Z.warn(d(oi)), | |
this.tech_ | |
} | |
, | |
h.prototype.addTechControlsListeners_ = function() { | |
this.removeTechControlsListeners_(), | |
this.on(this.tech_, "mousedown", this.handleTechClick_), | |
this.on(this.tech_, "touchstart", this.handleTechTouchStart_), | |
this.on(this.tech_, "touchmove", this.handleTechTouchMove_), | |
this.on(this.tech_, "touchend", this.handleTechTouchEnd_), | |
this.on(this.tech_, "tap", this.handleTechTap_) | |
} | |
, | |
h.prototype.removeTechControlsListeners_ = function() { | |
this.off(this.tech_, "tap", this.handleTechTap_), | |
this.off(this.tech_, "touchstart", this.handleTechTouchStart_), | |
this.off(this.tech_, "touchmove", this.handleTechTouchMove_), | |
this.off(this.tech_, "touchend", this.handleTechTouchEnd_), | |
this.off(this.tech_, "mousedown", this.handleTechClick_) | |
} | |
, | |
h.prototype.handleTechReady_ = function() { | |
if (this.triggerReady(), | |
this.cache_.volume && this.techCall_("setVolume", this.cache_.volume), | |
this.handleTechPosterChange_(), | |
this.handleTechDurationChange_(), | |
(this.src() || this.currentSrc()) && this.tag && this.options_.autoplay && this.paused()) | |
try { | |
delete this.tag.poster | |
} catch (e) { | |
Z("deleting tag.poster throws in some browsers", e) | |
} | |
} | |
, | |
h.prototype.handleTechLoadStart_ = function() { | |
this.removeClass("vjs-ended"), | |
this.removeClass("vjs-seeking"), | |
this.error(null), | |
this.paused() ? (this.hasStarted(!1), | |
this.trigger("loadstart")) : (this.trigger("loadstart"), | |
this.trigger("firstplay")), | |
this.manualAutoplay_(this.autoplay()) | |
} | |
, | |
h.prototype.manualAutoplay_ = function(t) { | |
var r = this; | |
if (this.tech_ && "string" == typeof t) { | |
var e = function() { | |
var t = r.muted(); | |
r.muted(!0); | |
var e = r.play(); | |
if (e && e.then && e.catch) | |
return e.catch(function(e) { | |
r.muted(t) | |
}) | |
} | |
, n = void 0; | |
if ("any" === t ? (n = this.play()) && n.then && n.catch && n.catch(function() { | |
return e() | |
}) : n = "muted" === t ? e() : this.play(), | |
n && n.then && n.catch) | |
return n.then(function() { | |
r.trigger({ | |
type: "autoplay-success", | |
autoplay: t | |
}) | |
}).catch(function(e) { | |
r.trigger({ | |
type: "autoplay-failure", | |
autoplay: t | |
}) | |
}) | |
} | |
} | |
, | |
h.prototype.updateSourceCaches_ = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "" | |
, t = e | |
, r = ""; | |
if ("string" != typeof t && (t = e.src, | |
r = e.type), | |
!/^blob:/.test(t)) { | |
this.cache_.source = this.cache_.source || {}, | |
this.cache_.sources = this.cache_.sources || [], | |
t && !r && (r = function(e, t) { | |
if (!t) | |
return ""; | |
if (e.cache_.source.src === t && e.cache_.source.type) | |
return e.cache_.source.type; | |
var r = e.cache_.sources.filter(function(e) { | |
return e.src === t | |
}); | |
if (r.length) | |
return r[0].type; | |
for (var n = e.$$("source"), i = 0; i < n.length; i++) { | |
var o = n[i]; | |
if (o.type && o.src && o.src === t) | |
return o.type | |
} | |
return Sr(t) | |
}(this, t)), | |
this.cache_.source = _t({}, e, { | |
src: t, | |
type: r | |
}); | |
for (var n = this.cache_.sources.filter(function(e) { | |
return e.src && e.src === t | |
}), i = [], o = this.$$("source"), a = [], s = 0; s < o.length; s++) { | |
var l = ye(o[s]); | |
i.push(l), | |
l.src && l.src === t && a.push(l.src) | |
} | |
a.length && !n.length ? this.cache_.sources = i : n.length || (this.cache_.sources = [this.cache_.source]), | |
this.cache_.src = t | |
} | |
} | |
, | |
h.prototype.handleTechSourceset_ = function(e) { | |
var r = this; | |
if (!this.changingSrc_ && (this.updateSourceCaches_(e.src), | |
!e.src)) { | |
this.tech_.one(["sourceset", "loadstart"], function e(t) { | |
"sourceset" !== t.type && r.updateSourceCaches_(r.techGet_("currentSrc")), | |
r.tech_.off(["sourceset", "loadstart"], e) | |
}) | |
} | |
this.trigger({ | |
src: e.src, | |
type: "sourceset" | |
}) | |
} | |
, | |
h.prototype.hasStarted = function(e) { | |
if (void 0 === e) | |
return this.hasStarted_; | |
e !== this.hasStarted_ && (this.hasStarted_ = e, | |
this.hasStarted_ ? (this.addClass("vjs-has-started"), | |
this.trigger("firstplay")) : this.removeClass("vjs-has-started")) | |
} | |
, | |
h.prototype.handleTechPlay_ = function() { | |
this.removeClass("vjs-ended"), | |
this.removeClass("vjs-paused"), | |
this.addClass("vjs-playing"), | |
this.hasStarted(!0), | |
this.trigger("play") | |
} | |
, | |
h.prototype.handleTechRateChange_ = function() { | |
0 < this.tech_.playbackRate() && 0 === this.cache_.lastPlaybackRate && (this.queuedCallbacks_.forEach(function(e) { | |
return e.callback(e.event) | |
}), | |
this.queuedCallbacks_ = []), | |
this.cache_.lastPlaybackRate = this.tech_.playbackRate(), | |
this.trigger("ratechange") | |
} | |
, | |
h.prototype.handleTechWaiting_ = function() { | |
var e = this; | |
this.addClass("vjs-waiting"), | |
this.trigger("waiting"), | |
this.one("timeupdate", function() { | |
return e.removeClass("vjs-waiting") | |
}) | |
} | |
, | |
h.prototype.handleTechCanPlay_ = function() { | |
this.removeClass("vjs-waiting"), | |
this.trigger("canplay") | |
} | |
, | |
h.prototype.handleTechCanPlayThrough_ = function() { | |
this.removeClass("vjs-waiting"), | |
this.trigger("canplaythrough") | |
} | |
, | |
h.prototype.handleTechPlaying_ = function() { | |
this.removeClass("vjs-waiting"), | |
this.trigger("playing") | |
} | |
, | |
h.prototype.handleTechSeeking_ = function() { | |
this.addClass("vjs-seeking"), | |
this.trigger("seeking") | |
} | |
, | |
h.prototype.handleTechSeeked_ = function() { | |
this.removeClass("vjs-seeking"), | |
this.trigger("seeked") | |
} | |
, | |
h.prototype.handleTechFirstPlay_ = function() { | |
this.options_.starttime && (Z.warn("Passing the `starttime` option to the player will be deprecated in 6.0"), | |
this.currentTime(this.options_.starttime)), | |
this.addClass("vjs-has-started"), | |
this.trigger("firstplay") | |
} | |
, | |
h.prototype.handleTechPause_ = function() { | |
this.removeClass("vjs-playing"), | |
this.addClass("vjs-paused"), | |
this.trigger("pause") | |
} | |
, | |
h.prototype.handleTechEnded_ = function() { | |
this.addClass("vjs-ended"), | |
this.options_.loop ? (this.currentTime(0), | |
this.play()) : this.paused() || this.pause(), | |
this.trigger("ended") | |
} | |
, | |
h.prototype.handleTechDurationChange_ = function() { | |
this.duration(this.techGet_("duration")) | |
} | |
, | |
h.prototype.handleTechClick_ = function(e) { | |
Oe(e) && this.controls_ && (this.paused() ? Dt(this.play()) : this.pause()) | |
} | |
, | |
h.prototype.handleTechTap_ = function() { | |
this.userActive(!this.userActive()) | |
} | |
, | |
h.prototype.handleTechTouchStart_ = function() { | |
this.userWasActive = this.userActive() | |
} | |
, | |
h.prototype.handleTechTouchMove_ = function() { | |
this.userWasActive && this.reportUserActivity() | |
} | |
, | |
h.prototype.handleTechTouchEnd_ = function(e) { | |
e.preventDefault() | |
} | |
, | |
h.prototype.handleFullscreenChange_ = function() { | |
this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen") | |
} | |
, | |
h.prototype.handleStageClick_ = function() { | |
this.reportUserActivity() | |
} | |
, | |
h.prototype.handleTechFullscreenChange_ = function(e, t) { | |
t && this.isFullscreen(t.isFullscreen), | |
this.trigger("fullscreenchange") | |
} | |
, | |
h.prototype.handleTechError_ = function() { | |
var e = this.tech_.error(); | |
this.error(e) | |
} | |
, | |
h.prototype.handleTechTextData_ = function() { | |
var e = null; | |
1 < arguments.length && (e = arguments[1]), | |
this.trigger("textdata", e) | |
} | |
, | |
h.prototype.getCache = function() { | |
return this.cache_ | |
} | |
, | |
h.prototype.techCall_ = function(i, o) { | |
this.ready(function() { | |
if (i in gr) | |
return e = this.middleware_, | |
t = this.tech_, | |
n = o, | |
t[r = i](e.reduce(Tr(r), n)); | |
if (i in br) | |
return mr(this.middleware_, this.tech_, i, o); | |
var e, t, r, n; | |
try { | |
this.tech_ && this.tech_[i](o) | |
} catch (e) { | |
throw Z(e), | |
e | |
} | |
}, !0) | |
} | |
, | |
h.prototype.techGet_ = function(t) { | |
if (this.tech_ && this.tech_.isReady_) { | |
if (t in _r) | |
return e = this.middleware_, | |
r = this.tech_, | |
n = t, | |
e.reduceRight(Tr(n), r[n]()); | |
if (t in br) | |
return mr(this.middleware_, this.tech_, t); | |
var e, r, n; | |
try { | |
return this.tech_[t]() | |
} catch (e) { | |
if (void 0 === this.tech_[t]) | |
throw Z("Video.js: " + t + " method not defined for " + this.techName_ + " playback technology.", e), | |
e; | |
if ("TypeError" === e.name) | |
throw Z("Video.js: " + t + " unavailable on " + this.techName_ + " playback technology element.", e), | |
this.tech_.isReady_ = !1, | |
e; | |
throw Z(e), | |
e | |
} | |
} | |
} | |
, | |
h.prototype.play = function() { | |
var t = this | |
, e = this.options_.Promise || p.Promise; | |
return e ? new e(function(e) { | |
t.play_(e) | |
} | |
) : this.play_() | |
} | |
, | |
h.prototype.play_ = function() { | |
var e = this | |
, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Dt; | |
if (this.playOnLoadstart_ && this.off("loadstart", this.playOnLoadstart_), | |
this.isReady_) { | |
if (!this.changingSrc_ && (this.src() || this.currentSrc())) | |
return void t(this.techGet_("play")); | |
this.playOnLoadstart_ = function() { | |
e.playOnLoadstart_ = null, | |
t(e.play()) | |
} | |
, | |
this.one("loadstart", this.playOnLoadstart_) | |
} else { | |
if (this.playWaitingForReady_) | |
return; | |
this.playWaitingForReady_ = !0, | |
this.ready(function() { | |
e.playWaitingForReady_ = !1, | |
t(e.play()) | |
}) | |
} | |
} | |
, | |
h.prototype.pause = function() { | |
this.techCall_("pause") | |
} | |
, | |
h.prototype.paused = function() { | |
return !1 !== this.techGet_("paused") | |
} | |
, | |
h.prototype.played = function() { | |
return this.techGet_("played") || wt(0, 0) | |
} | |
, | |
h.prototype.scrubbing = function(e) { | |
if (void 0 === e) | |
return this.scrubbing_; | |
this.scrubbing_ = !!e, | |
e ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing") | |
} | |
, | |
h.prototype.currentTime = function(e) { | |
return void 0 !== e ? (e < 0 && (e = 0), | |
void this.techCall_("setCurrentTime", e)) : (this.cache_.currentTime = this.techGet_("currentTime") || 0, | |
this.cache_.currentTime) | |
} | |
, | |
h.prototype.duration = function(e) { | |
if (void 0 === e) | |
return void 0 !== this.cache_.duration ? this.cache_.duration : NaN; | |
(e = parseFloat(e)) < 0 && (e = 1 / 0), | |
e !== this.cache_.duration && ((this.cache_.duration = e) === 1 / 0 ? this.addClass("vjs-live") : this.removeClass("vjs-live"), | |
this.trigger("durationchange")) | |
} | |
, | |
h.prototype.remainingTime = function() { | |
return this.duration() - this.currentTime() | |
} | |
, | |
h.prototype.remainingTimeDisplay = function() { | |
return Math.floor(this.duration()) - Math.floor(this.currentTime()) | |
} | |
, | |
h.prototype.buffered = function() { | |
var e = this.techGet_("buffered"); | |
return e && e.length || (e = wt(0, 0)), | |
e | |
} | |
, | |
h.prototype.bufferedPercent = function() { | |
return kt(this.buffered(), this.duration()) | |
} | |
, | |
h.prototype.bufferedEnd = function() { | |
var e = this.buffered() | |
, t = this.duration() | |
, r = e.end(e.length - 1); | |
return t < r && (r = t), | |
r | |
} | |
, | |
h.prototype.volume = function(e) { | |
var t = void 0; | |
return void 0 !== e ? (t = Math.max(0, Math.min(1, parseFloat(e))), | |
this.cache_.volume = t, | |
this.techCall_("setVolume", t), | |
void (0 < t && this.lastVolume_(t))) : (t = parseFloat(this.techGet_("volume")), | |
isNaN(t) ? 1 : t) | |
} | |
, | |
h.prototype.muted = function(e) { | |
if (void 0 === e) | |
return this.techGet_("muted") || !1; | |
this.techCall_("setMuted", e) | |
} | |
, | |
h.prototype.defaultMuted = function(e) { | |
return void 0 !== e ? this.techCall_("setDefaultMuted", e) : this.techGet_("defaultMuted") || !1 | |
} | |
, | |
h.prototype.lastVolume_ = function(e) { | |
if (void 0 === e || 0 === e) | |
return this.cache_.lastVolume; | |
this.cache_.lastVolume = e | |
} | |
, | |
h.prototype.supportsFullScreen = function() { | |
return this.techGet_("supportsFullScreen") || !1 | |
} | |
, | |
h.prototype.isFullscreen = function(e) { | |
if (void 0 === e) | |
return !!this.isFullscreen_; | |
this.isFullscreen_ = !!e | |
} | |
, | |
h.prototype.requestFullscreen = function() { | |
var r = St; | |
this.isFullscreen(!0), | |
r.requestFullscreen ? (Ge(f, r.fullscreenchange, nt(this, function e(t) { | |
this.isFullscreen(f[r.fullscreenElement]), | |
!1 === this.isFullscreen() && $e(f, r.fullscreenchange, e), | |
this.trigger("fullscreenchange") | |
})), | |
this.el_[r.requestFullscreen]()) : this.tech_.supportsFullScreen() ? this.techCall_("enterFullScreen") : (this.enterFullWindow(), | |
this.trigger("fullscreenchange")) | |
} | |
, | |
h.prototype.exitFullscreen = function() { | |
var e = St; | |
this.isFullscreen(!1), | |
e.requestFullscreen ? f[e.exitFullscreen]() : this.tech_.supportsFullScreen() ? this.techCall_("exitFullScreen") : (this.exitFullWindow(), | |
this.trigger("fullscreenchange")) | |
} | |
, | |
h.prototype.enterFullWindow = function() { | |
this.isFullWindow = !0, | |
this.docOrigOverflow = f.documentElement.style.overflow, | |
Ge(f, "keydown", nt(this, this.fullWindowOnEscKey)), | |
f.documentElement.style.overflow = "hidden", | |
de(f.body, "vjs-full-window"), | |
this.trigger("enterFullWindow") | |
} | |
, | |
h.prototype.fullWindowOnEscKey = function(e) { | |
27 === e.keyCode && (!0 === this.isFullscreen() ? this.exitFullscreen() : this.exitFullWindow()) | |
} | |
, | |
h.prototype.exitFullWindow = function() { | |
this.isFullWindow = !1, | |
$e(f, "keydown", this.fullWindowOnEscKey), | |
f.documentElement.style.overflow = this.docOrigOverflow, | |
pe(f.body, "vjs-full-window"), | |
this.trigger("exitFullWindow") | |
} | |
, | |
h.prototype.canPlayType = function(e) { | |
for (var t = void 0, r = 0, n = this.options_.techOrder; r < n.length; r++) { | |
var i = n[r] | |
, o = dr.getTech(i); | |
if (o || (o = gt.getComponent(i)), | |
o) { | |
if (o.isSupported() && (t = o.canPlayType(e))) | |
return t | |
} else | |
Z.error('The "' + i + '" tech is undefined. Skipped browser support check for that tech.') | |
} | |
return "" | |
} | |
, | |
h.prototype.selectSource = function(e) { | |
var r, n = this, t = this.options_.techOrder.map(function(e) { | |
return [e, dr.getTech(e)] | |
}).filter(function(e) { | |
var t = e[0] | |
, r = e[1]; | |
return r ? r.isSupported() : (Z.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'), | |
!1) | |
}), i = function(e, r, n) { | |
var i = void 0; | |
return e.some(function(t) { | |
return r.some(function(e) { | |
if (i = n(t, e)) | |
return !0 | |
}) | |
}), | |
i | |
}, o = function(e, t) { | |
var r = e[0]; | |
if (e[1].canPlaySource(t, n.options_[r.toLowerCase()])) | |
return { | |
source: t, | |
tech: r | |
} | |
}; | |
return (this.options_.sourceOrder ? i(e, t, (r = o, | |
function(e, t) { | |
return r(t, e) | |
} | |
)) : i(t, e, o)) || !1 | |
} | |
, | |
h.prototype.src = function(e) { | |
var i = this; | |
if (void 0 === e) | |
return this.cache_.src || ""; | |
var o = function t(e) { | |
if (Array.isArray(e)) { | |
var r = []; | |
e.forEach(function(e) { | |
e = t(e), | |
Array.isArray(e) ? r = r.concat(e) : $(e) && r.push(e) | |
}), | |
e = r | |
} else | |
e = "string" == typeof e && e.trim() ? [Cr({ | |
src: e | |
})] : $(e) && "string" == typeof e.src && e.src && e.src.trim() ? [Cr(e)] : []; | |
return e | |
}(e); | |
o.length ? (this.changingSrc_ = !0, | |
this.cache_.sources = o, | |
this.updateSourceCaches_(o[0]), | |
yr(this, o[0], function(e, t) { | |
var r, n; | |
if (i.middleware_ = t, | |
i.cache_.sources = o, | |
i.updateSourceCaches_(e), | |
i.src_(e)) | |
return 1 < o.length ? i.src(o.slice(1)) : (i.changingSrc_ = !1, | |
i.setTimeout(function() { | |
this.error({ | |
code: 4, | |
message: this.localize(this.options_.notSupportedMessage) | |
}) | |
}, 0), | |
void i.triggerReady()); | |
r = t, | |
n = i.tech_, | |
r.forEach(function(e) { | |
return e.setTech && e.setTech(n) | |
}) | |
})) : this.setTimeout(function() { | |
this.error({ | |
code: 4, | |
message: this.localize(this.options_.notSupportedMessage) | |
}) | |
}, 0) | |
} | |
, | |
h.prototype.src_ = function(e) { | |
var t, r, n = this, i = this.selectSource([e]); | |
return !i || (t = i.tech, | |
r = this.techName_, | |
mt(t) !== mt(r) ? (this.changingSrc_ = !0, | |
this.loadTech_(i.tech, i.source), | |
this.tech_.ready(function() { | |
n.changingSrc_ = !1 | |
})) : this.ready(function() { | |
this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", e) : this.techCall_("src", e.src), | |
this.changingSrc_ = !1 | |
}, !0), | |
!1) | |
} | |
, | |
h.prototype.load = function() { | |
this.techCall_("load") | |
} | |
, | |
h.prototype.reset = function() { | |
this.tech_ && this.tech_.clearTracks("text"), | |
this.loadTech_(this.options_.techOrder[0], null), | |
this.techCall_("reset") | |
} | |
, | |
h.prototype.currentSources = function() { | |
var e = this.currentSource() | |
, t = []; | |
return 0 !== Object.keys(e).length && t.push(e), | |
this.cache_.sources || t | |
} | |
, | |
h.prototype.currentSource = function() { | |
return this.cache_.source || {} | |
} | |
, | |
h.prototype.currentSrc = function() { | |
return this.currentSource() && this.currentSource().src || "" | |
} | |
, | |
h.prototype.currentType = function() { | |
return this.currentSource() && this.currentSource().type || "" | |
} | |
, | |
h.prototype.preload = function(e) { | |
return void 0 !== e ? (this.techCall_("setPreload", e), | |
void (this.options_.preload = e)) : this.techGet_("preload") | |
} | |
, | |
h.prototype.autoplay = function(e) { | |
if (void 0 === e) | |
return this.options_.autoplay || !1; | |
var t = void 0; | |
"string" == typeof e && /(any|play|muted)/.test(e) ? (this.options_.autoplay = e, | |
this.manualAutoplay_(e), | |
t = !1) : this.options_.autoplay = !!e, | |
t = t || this.options_.autoplay, | |
this.tech_ && this.techCall_("setAutoplay", t) | |
} | |
, | |
h.prototype.playsinline = function(e) { | |
return void 0 !== e ? (this.techCall_("setPlaysinline", e), | |
this.options_.playsinline = e, | |
this) : this.techGet_("playsinline") | |
} | |
, | |
h.prototype.loop = function(e) { | |
return void 0 !== e ? (this.techCall_("setLoop", e), | |
void (this.options_.loop = e)) : this.techGet_("loop") | |
} | |
, | |
h.prototype.poster = function(e) { | |
if (void 0 === e) | |
return this.poster_; | |
e || (e = ""), | |
e !== this.poster_ && (this.poster_ = e, | |
this.techCall_("setPoster", e), | |
this.isPosterFromTech_ = !1, | |
this.trigger("posterchange")) | |
} | |
, | |
h.prototype.handleTechPosterChange_ = function() { | |
if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) { | |
var e = this.tech_.poster() || ""; | |
e !== this.poster_ && (this.poster_ = e, | |
this.isPosterFromTech_ = !0, | |
this.trigger("posterchange")) | |
} | |
} | |
, | |
h.prototype.controls = function(e) { | |
if (void 0 === e) | |
return !!this.controls_; | |
e = !!e, | |
this.controls_ !== e && (this.controls_ = e, | |
this.usingNativeControls() && this.techCall_("setControls", e), | |
this.controls_ ? (this.removeClass("vjs-controls-disabled"), | |
this.addClass("vjs-controls-enabled"), | |
this.trigger("controlsenabled"), | |
this.usingNativeControls() || this.addTechControlsListeners_()) : (this.removeClass("vjs-controls-enabled"), | |
this.addClass("vjs-controls-disabled"), | |
this.trigger("controlsdisabled"), | |
this.usingNativeControls() || this.removeTechControlsListeners_())) | |
} | |
, | |
h.prototype.usingNativeControls = function(e) { | |
if (void 0 === e) | |
return !!this.usingNativeControls_; | |
e = !!e, | |
this.usingNativeControls_ !== e && (this.usingNativeControls_ = e, | |
this.usingNativeControls_ ? (this.addClass("vjs-using-native-controls"), | |
this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"), | |
this.trigger("usingcustomcontrols"))) | |
} | |
, | |
h.prototype.error = function(e) { | |
return void 0 === e ? this.error_ || null : null === e ? (this.error_ = e, | |
this.removeClass("vjs-error"), | |
void (this.errorDisplay && this.errorDisplay.close())) : (this.error_ = new Ot(e), | |
this.addClass("vjs-error"), | |
Z.error("(CODE:" + this.error_.code + " " + Ot.errorTypes[this.error_.code] + ")", this.error_.message, this.error_), | |
void this.trigger("error")) | |
} | |
, | |
h.prototype.reportUserActivity = function(e) { | |
this.userActivity_ = !0 | |
} | |
, | |
h.prototype.userActive = function(e) { | |
if (void 0 === e) | |
return this.userActive_; | |
if ((e = !!e) !== this.userActive_) { | |
if (this.userActive_ = e, | |
this.userActive_) | |
return this.userActivity_ = !0, | |
this.removeClass("vjs-user-inactive"), | |
this.addClass("vjs-user-active"), | |
void this.trigger("useractive"); | |
this.tech_ && this.tech_.one("mousemove", function(e) { | |
e.stopPropagation(), | |
e.preventDefault() | |
}), | |
this.userActivity_ = !1, | |
this.removeClass("vjs-user-active"), | |
this.addClass("vjs-user-inactive"), | |
this.trigger("userinactive") | |
} | |
} | |
, | |
h.prototype.listenForUserActivity_ = function() { | |
var t = void 0 | |
, r = void 0 | |
, n = void 0 | |
, i = nt(this, this.reportUserActivity); | |
this.on("mousedown", function() { | |
i(), | |
this.clearInterval(t), | |
t = this.setInterval(i, 250) | |
}), | |
this.on("mousemove", function(e) { | |
e.screenX === r && e.screenY === n || (r = e.screenX, | |
n = e.screenY, | |
i()) | |
}), | |
this.on("mouseup", function(e) { | |
i(), | |
this.clearInterval(t) | |
}), | |
this.on("keydown", i), | |
this.on("keyup", i); | |
var o = void 0; | |
this.setInterval(function() { | |
if (this.userActivity_) { | |
this.userActivity_ = !1, | |
this.userActive(!0), | |
this.clearTimeout(o); | |
var e = this.options_.inactivityTimeout; | |
e <= 0 || (o = this.setTimeout(function() { | |
this.userActivity_ || this.userActive(!1) | |
}, e)) | |
} | |
}, 250) | |
} | |
, | |
h.prototype.playbackRate = function(e) { | |
if (void 0 === e) | |
return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1; | |
this.techCall_("setPlaybackRate", e) | |
} | |
, | |
h.prototype.defaultPlaybackRate = function(e) { | |
return void 0 !== e ? this.techCall_("setDefaultPlaybackRate", e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1 | |
} | |
, | |
h.prototype.isAudio = function(e) { | |
if (void 0 === e) | |
return !!this.isAudio_; | |
this.isAudio_ = !!e | |
} | |
, | |
h.prototype.addTextTrack = function(e, t, r) { | |
if (this.tech_) | |
return this.tech_.addTextTrack(e, t, r) | |
} | |
, | |
h.prototype.addRemoteTextTrack = function(e, t) { | |
if (this.tech_) | |
return this.tech_.addRemoteTextTrack(e, t) | |
} | |
, | |
h.prototype.removeRemoteTextTrack = function() { | |
var e = (0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}).track | |
, t = void 0 === e ? arguments[0] : e; | |
if (this.tech_) | |
return this.tech_.removeRemoteTextTrack(t) | |
} | |
, | |
h.prototype.getVideoPlaybackQuality = function() { | |
return this.techGet_("getVideoPlaybackQuality") | |
} | |
, | |
h.prototype.videoWidth = function() { | |
return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0 | |
} | |
, | |
h.prototype.videoHeight = function() { | |
return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0 | |
} | |
, | |
h.prototype.language = function(e) { | |
if (void 0 === e) | |
return this.language_; | |
this.language_ = String(e).toLowerCase() | |
} | |
, | |
h.prototype.languages = function() { | |
return _t(h.prototype.options_.languages, this.languages_) | |
} | |
, | |
h.prototype.toJSON = function() { | |
var e = _t(this.options_) | |
, t = e.tracks; | |
e.tracks = []; | |
for (var r = 0; r < t.length; r++) { | |
var n = t[r]; | |
(n = _t(n)).player = void 0, | |
e.tracks[r] = n | |
} | |
return e | |
} | |
, | |
h.prototype.createModal = function(e, t) { | |
var r = this; | |
(t = t || {}).content = e || ""; | |
var n = new Ft(this,t); | |
return this.addChild(n), | |
n.on("dispose", function() { | |
r.removeChild(n) | |
}), | |
n.open(), | |
n | |
} | |
, | |
h.getTagSettings = function(e) { | |
var t = { | |
sources: [], | |
tracks: [] | |
} | |
, r = ye(e) | |
, n = r["data-setup"]; | |
if (he(e, "vjs-fluid") && (r.fluid = !0), | |
null !== n) { | |
var i = v(n || "{}") | |
, o = i[0] | |
, a = i[1]; | |
o && Z.error(o), | |
G(r, a) | |
} | |
if (G(t, r), | |
e.hasChildNodes()) | |
for (var s = e.childNodes, l = 0, u = s.length; l < u; l++) { | |
var c = s[l] | |
, h = c.nodeName.toLowerCase(); | |
"source" === h ? t.sources.push(ye(c)) : "track" === h && t.tracks.push(ye(c)) | |
} | |
return t | |
} | |
, | |
h.prototype.flexNotSupported_ = function() { | |
var e = f.createElement("i"); | |
return !("flexBasis"in e.style || "webkitFlexBasis"in e.style || "mozFlexBasis"in e.style || "msFlexBasis"in e.style || "msFlexOrder"in e.style) | |
} | |
, | |
h | |
}(gt); | |
hr.names.forEach(function(e) { | |
var t = hr[e]; | |
li.prototype[t.getterName] = function() { | |
return this.tech_ ? this.tech_[t.getterName]() : (this[t.privateName] = this[t.privateName] || new t.ListClass, | |
this[t.privateName]) | |
} | |
}), | |
li.players = {}; | |
var ui = p.navigator; | |
li.prototype.options_ = { | |
techOrder: dr.defaultTechOrder_, | |
html5: {}, | |
flash: {}, | |
inactivityTimeout: 2e3, | |
playbackRates: [], | |
children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "controlBar", "errorDisplay", "textTrackSettings"], | |
language: ui && (ui.languages && ui.languages[0] || ui.userLanguage || ui.language) || "en", | |
languages: {}, | |
notSupportedMessage: "No compatible source was found for this media." | |
}, | |
A || li.prototype.options_.children.push("resizeManager"), | |
["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function(e) { | |
li.prototype[e] = function() { | |
return this.techGet_(e) | |
} | |
}), | |
ai.forEach(function(e) { | |
li.prototype["handleTech" + mt(e) + "_"] = function() { | |
return this.trigger(e) | |
} | |
}), | |
gt.registerComponent("Player", li); | |
var ci = "plugin" | |
, hi = "activePlugins_" | |
, di = {} | |
, pi = function(e) { | |
return di.hasOwnProperty(e) | |
} | |
, fi = function(e) { | |
return pi(e) ? di[e] : void 0 | |
} | |
, vi = function(e, t) { | |
e[hi] = e[hi] || {}, | |
e[hi][t] = !0 | |
} | |
, yi = function(e, t, r) { | |
var n = (r ? "before" : "") + "pluginsetup"; | |
e.trigger(n, t), | |
e.trigger(n + ":" + t.name, t) | |
} | |
, mi = function(i, o) { | |
return o.prototype.name = i, | |
function() { | |
yi(this, { | |
name: i, | |
plugin: o, | |
instance: null | |
}, !0); | |
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) | |
t[r] = arguments[r]; | |
var n = new (Function.prototype.bind.apply(o, [null].concat([this].concat(t)))); | |
return this[i] = function() { | |
return n | |
} | |
, | |
yi(this, n.getEventHash()), | |
n | |
} | |
} | |
, _i = function() { | |
function o(e) { | |
if (B(this, o), | |
this.constructor === o) | |
throw new Error("Plugin must be sub-classed; not directly instantiated."); | |
this.player = e, | |
ft(this), | |
delete this.trigger, | |
yt(this, this.constructor.defaultState), | |
vi(e, this.name), | |
this.dispose = nt(this, this.dispose), | |
e.on("dispose", this.dispose) | |
} | |
return o.prototype.version = function() { | |
return this.constructor.VERSION | |
} | |
, | |
o.prototype.getEventHash = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; | |
return e.name = this.name, | |
e.plugin = this.constructor, | |
e.instance = this, | |
e | |
} | |
, | |
o.prototype.trigger = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; | |
return Ke(this.eventBusEl_, e, this.getEventHash(t)) | |
} | |
, | |
o.prototype.handleStateChanged = function(e) {} | |
, | |
o.prototype.dispose = function() { | |
var e = this.name | |
, t = this.player; | |
this.trigger("dispose"), | |
this.off(), | |
t.off("dispose", this.dispose), | |
t[hi][e] = !1, | |
this.player = this.state = null, | |
t[e] = mi(e, di[e]) | |
} | |
, | |
o.isBasic = function(e) { | |
var t = "string" == typeof e ? fi(e) : e; | |
return "function" == typeof t && !o.prototype.isPrototypeOf(t.prototype) | |
} | |
, | |
o.registerPlugin = function(e, t) { | |
if ("string" != typeof e) | |
throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + (void 0 === e ? "undefined" : F(e)) + "."); | |
if (pi(e)) | |
Z.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!'); | |
else if (li.prototype.hasOwnProperty(e)) | |
throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!'); | |
if ("function" != typeof t) | |
throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + (void 0 === t ? "undefined" : F(t)) + "."); | |
var r, n, i; | |
return di[e] = t, | |
e !== ci && (o.isBasic(t) ? li.prototype[e] = (r = e, | |
n = t, | |
i = function() { | |
yi(this, { | |
name: r, | |
plugin: n, | |
instance: null | |
}, !0); | |
var e = n.apply(this, arguments); | |
return vi(this, r), | |
yi(this, { | |
name: r, | |
plugin: n, | |
instance: e | |
}), | |
e | |
} | |
, | |
Object.keys(n).forEach(function(e) { | |
i[e] = n[e] | |
}), | |
i) : li.prototype[e] = mi(e, t)), | |
t | |
} | |
, | |
o.deregisterPlugin = function(e) { | |
if (e === ci) | |
throw new Error("Cannot de-register base plugin."); | |
pi(e) && (delete di[e], | |
delete li.prototype[e]) | |
} | |
, | |
o.getPlugins = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Object.keys(di) | |
, r = void 0; | |
return e.forEach(function(e) { | |
var t = fi(e); | |
t && ((r = r || {})[e] = t) | |
}), | |
r | |
} | |
, | |
o.getPluginVersion = function(e) { | |
var t = fi(e); | |
return t && t.VERSION || "" | |
} | |
, | |
o | |
}(); | |
_i.getPlugin = fi, | |
_i.BASE_PLUGIN_NAME = ci, | |
_i.registerPlugin(ci, _i), | |
li.prototype.usingPlugin = function(e) { | |
return !!this[hi] && !0 === this[hi][e] | |
} | |
, | |
li.prototype.hasPlugin = function(e) { | |
return !!pi(e) | |
} | |
; | |
"undefined" == typeof HTMLVideoElement && ie() && (f.createElement("video"), | |
f.createElement("audio"), | |
f.createElement("track"), | |
f.createElement("video-js")); | |
var gi = function(e) { | |
return 0 === e.indexOf("#") ? e.slice(1) : e | |
}; | |
function bi(e, r, t) { | |
var n = bi.getPlayer(e); | |
if (n) | |
return r && Z.warn('Player "' + e + '" is already initialised. Options will not be applied.'), | |
t && n.ready(t), | |
n; | |
var i = "string" == typeof e ? Ae("#" + gi(e)) : e; | |
if (!oe(i)) | |
throw new TypeError("The element or ID supplied is not valid. (videojs)"); | |
f.body.contains(i) || Z.warn("The element supplied is not included in the DOM"), | |
r = r || {}, | |
bi.hooks("beforesetup").forEach(function(e) { | |
var t = e(i, _t(r)); | |
$(t) && !Array.isArray(t) ? r = _t(r, t) : Z.error("please return an object in beforesetup hooks") | |
}); | |
var o = gt.getComponent("Player"); | |
return n = new o(i,r,t), | |
bi.hooks("setup").forEach(function(e) { | |
return e(n) | |
}), | |
n | |
} | |
if (bi.hooks_ = {}, | |
bi.hooks = function(e, t) { | |
return bi.hooks_[e] = bi.hooks_[e] || [], | |
t && (bi.hooks_[e] = bi.hooks_[e].concat(t)), | |
bi.hooks_[e] | |
} | |
, | |
bi.hook = function(e, t) { | |
bi.hooks(e, t) | |
} | |
, | |
bi.hookOnce = function(r, e) { | |
bi.hooks(r, [].concat(e).map(function(t) { | |
return function e() { | |
return bi.removeHook(r, e), | |
t.apply(void 0, arguments) | |
} | |
})) | |
} | |
, | |
bi.removeHook = function(e, t) { | |
var r = bi.hooks(e).indexOf(t); | |
return !(r <= -1) && (bi.hooks_[e] = bi.hooks_[e].slice(), | |
bi.hooks_[e].splice(r, 1), | |
!0) | |
} | |
, | |
!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE && ie()) { | |
var Ti = Ae(".vjs-styles-defaults"); | |
if (!Ti) { | |
Ti = tt("vjs-styles-defaults"); | |
var wi = Ae("head"); | |
wi && wi.insertBefore(Ti, wi.firstChild), | |
rt(Ti, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ") | |
} | |
} | |
et(1, bi), | |
bi.VERSION = m, | |
bi.options = li.prototype.options_, | |
bi.getPlayers = function() { | |
return li.players | |
} | |
, | |
bi.getPlayer = function(e) { | |
var t = li.players | |
, r = void 0; | |
if ("string" == typeof e) { | |
var n = gi(e) | |
, i = t[n]; | |
if (i) | |
return i; | |
r = Ae("#" + n) | |
} else | |
r = e; | |
if (oe(r)) { | |
var o = r | |
, a = o.player | |
, s = o.playerId; | |
if (a || t[s]) | |
return a || t[s] | |
} | |
} | |
, | |
bi.getAllPlayers = function() { | |
return Object.keys(li.players).map(function(e) { | |
return li.players[e] | |
}).filter(Boolean) | |
} | |
, | |
bi.players = li.players, | |
bi.getComponent = gt.getComponent, | |
bi.registerComponent = function(e, t) { | |
dr.isTech(t) && Z.warn("The " + e + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"), | |
gt.registerComponent.call(gt, e, t) | |
} | |
, | |
bi.getTech = dr.getTech, | |
bi.registerTech = dr.registerTech, | |
bi.use = function(e, t) { | |
pr[e] = pr[e] || [], | |
pr[e].push(t) | |
} | |
, | |
!A && Object.defineProperty ? (Object.defineProperty(bi, "middleware", { | |
value: {}, | |
writeable: !1, | |
enumerable: !0 | |
}), | |
Object.defineProperty(bi.middleware, "TERMINATOR", { | |
value: vr, | |
writeable: !1, | |
enumerable: !0 | |
})) : bi.middleware = { | |
TERMINATOR: vr | |
}, | |
bi.browser = L, | |
bi.TOUCH_ENABLED = R, | |
bi.extend = function(e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {} | |
, r = function() { | |
e.apply(this, arguments) | |
} | |
, n = {}; | |
for (var i in "object" === (void 0 === t ? "undefined" : F(t)) ? (t.constructor !== Object.prototype.constructor && (r = t.constructor), | |
n = t) : "function" == typeof t && (r = t), | |
function(e, t) { | |
if ("function" != typeof t && null !== t) | |
throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : F(t))); | |
e.prototype = Object.create(t && t.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0 | |
} | |
}), | |
t && (e.super_ = t) | |
}(r, e), | |
n) | |
n.hasOwnProperty(i) && (r.prototype[i] = n[i]); | |
return r | |
} | |
, | |
bi.mergeOptions = _t, | |
bi.bind = nt, | |
bi.registerPlugin = _i.registerPlugin, | |
bi.deregisterPlugin = _i.deregisterPlugin, | |
bi.plugin = function(e, t) { | |
return Z.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"), | |
_i.registerPlugin(e, t) | |
} | |
, | |
bi.getPlugins = _i.getPlugins, | |
bi.getPlugin = _i.getPlugin, | |
bi.getPluginVersion = _i.getPluginVersion, | |
bi.addLanguage = function(e, t) { | |
var r; | |
return e = ("" + e).toLowerCase(), | |
bi.options.languages = _t(bi.options.languages, ((r = {})[e] = t, | |
r)), | |
bi.options.languages[e] | |
} | |
, | |
bi.log = Z, | |
bi.createTimeRange = bi.createTimeRanges = wt, | |
bi.formatTime = qr, | |
bi.setFormatTime = function(e) { | |
Hr = e | |
} | |
, | |
bi.resetFormatTime = function() { | |
Hr = Br | |
} | |
, | |
bi.parseUrl = Zt, | |
bi.isCrossOrigin = rr, | |
bi.EventTarget = ot, | |
bi.on = Ge, | |
bi.one = Xe, | |
bi.off = $e, | |
bi.trigger = Ke, | |
bi.xhr = y, | |
bi.TextTrack = or, | |
bi.AudioTrack = ar, | |
bi.VideoTrack = sr, | |
["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(e) { | |
bi[e] = function() { | |
return Z.warn("videojs." + e + "() is deprecated; use videojs.dom." + e + "() instead"), | |
De[e].apply(null, arguments) | |
} | |
}), | |
bi.computedStyle = ee, | |
bi.dom = De, | |
bi.url = nr, | |
e.exports = bi | |
}, | |
"./node_modules/videojs-flash/dist/videojs-flash.es.js": function(e, t, r) { | |
"use strict"; | |
var n = r("./node_modules/video.js/dist/video.cjs.js") | |
, i = r.n(n) | |
, a = r("./node_modules/videojs-swf/package.json") | |
, o = r("./node_modules/global/window.js") | |
, s = r.n(o); | |
var l, u = i.a.getComponent("Tech"), c = i.a.dom, h = i.a.url, d = i.a.createTimeRange, p = i.a.mergeOptions, f = s.a && s.a.navigator || {}, v = function(n) { | |
function o(e, t) { | |
!function(e, t) { | |
if (!(e instanceof t)) | |
throw new TypeError("Cannot call a class as a function") | |
}(this, o); | |
var r = function(e, t) { | |
if (!e) | |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
return !t || "object" != typeof t && "function" != typeof t ? e : t | |
}(this, n.call(this, e, t)); | |
return e.source && r.ready(function() { | |
this.setSource(e.source) | |
}, !0), | |
e.startTime && r.ready(function() { | |
this.load(), | |
this.play(), | |
this.currentTime(e.startTime) | |
}, !0), | |
s.a.videojs = s.a.videojs || {}, | |
s.a.videojs.Flash = s.a.videojs.Flash || {}, | |
s.a.videojs.Flash.onReady = o.onReady, | |
s.a.videojs.Flash.onEvent = o.onEvent, | |
s.a.videojs.Flash.onError = o.onError, | |
r.on("seeked", function() { | |
this.lastSeekTarget_ = void 0 | |
}), | |
r | |
} | |
return function(e, t) { | |
if ("function" != typeof t && null !== t) | |
throw new TypeError("Super expression must either be null or a function, not " + typeof t); | |
e.prototype = Object.create(t && t.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0 | |
} | |
}), | |
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) | |
}(o, n), | |
o.prototype.createEl = function() { | |
var e = this.options_; | |
e.swf || (e.swf = "https://vjs.zencdn.net/swf/" + a.a + "/video-js.swf"); | |
var t = e.techId | |
, r = p({ | |
readyFunction: "videojs.Flash.onReady", | |
eventProxyFunction: "videojs.Flash.onEvent", | |
errorEventProxyFunction: "videojs.Flash.onError", | |
autoplay: e.autoplay, | |
preload: e.preload, | |
loop: e.loop, | |
muted: e.muted | |
}, e.flashVars) | |
, n = p({ | |
wmode: "opaque", | |
bgcolor: "#000000" | |
}, e.params) | |
, i = p({ | |
id: t, | |
name: t, | |
class: "vjs-tech" | |
}, e.attributes); | |
return this.el_ = o.embed(e.swf, r, n, i), | |
(this.el_.tech = this).el_ | |
} | |
, | |
o.prototype.play = function() { | |
this.ended() && this.setCurrentTime(0), | |
this.el_.vjs_play() | |
} | |
, | |
o.prototype.pause = function() { | |
this.el_.vjs_pause() | |
} | |
, | |
o.prototype.src = function(e) { | |
return void 0 === e ? this.currentSrc() : this.setSrc(e) | |
} | |
, | |
o.prototype.setSrc = function(e) { | |
var t = this; | |
e = h.getAbsoluteURL(e), | |
this.el_.vjs_src(e), | |
this.autoplay() && this.setTimeout(function() { | |
return t.play() | |
}, 0) | |
} | |
, | |
o.prototype.seeking = function() { | |
return void 0 !== this.lastSeekTarget_ | |
} | |
, | |
o.prototype.setCurrentTime = function(e) { | |
var t = this.seekable(); | |
t.length && (e = (e = e > t.start(0) ? e : t.start(0)) < t.end(t.length - 1) ? e : t.end(t.length - 1), | |
this.lastSeekTarget_ = e, | |
this.trigger("seeking"), | |
this.el_.vjs_setProperty("currentTime", e), | |
n.prototype.setCurrentTime.call(this)) | |
} | |
, | |
o.prototype.currentTime = function() { | |
return this.seeking() ? this.lastSeekTarget_ || 0 : this.el_.vjs_getProperty("currentTime") | |
} | |
, | |
o.prototype.currentSrc = function() { | |
return this.currentSource_ ? this.currentSource_.src : this.el_.vjs_getProperty("currentSrc") | |
} | |
, | |
o.prototype.duration = function() { | |
if (0 === this.readyState()) | |
return NaN; | |
var e = this.el_.vjs_getProperty("duration"); | |
return 0 <= e ? e : 1 / 0 | |
} | |
, | |
o.prototype.load = function() { | |
this.el_.vjs_load() | |
} | |
, | |
o.prototype.poster = function() { | |
this.el_.vjs_getProperty("poster") | |
} | |
, | |
o.prototype.setPoster = function() {} | |
, | |
o.prototype.seekable = function() { | |
var e = this.duration(); | |
return 0 === e ? d() : d(0, e) | |
} | |
, | |
o.prototype.buffered = function() { | |
var e = this.el_.vjs_getProperty("buffered"); | |
return 0 === e.length ? d() : d(e[0][0], e[0][1]) | |
} | |
, | |
o.prototype.supportsFullScreen = function() { | |
return !1 | |
} | |
, | |
o.prototype.enterFullScreen = function() { | |
return !1 | |
} | |
, | |
o.prototype.getVideoPlaybackQuality = function() { | |
var e = this.el_.vjs_getProperty("getVideoPlaybackQuality"); | |
return s.a.performance && "function" == typeof s.a.performance.now ? e.creationTime = s.a.performance.now() : s.a.performance && s.a.performance.timing && "number" == typeof s.a.performance.timing.navigationStart && (e.creationTime = s.a.Date.now() - s.a.performance.timing.navigationStart), | |
e | |
} | |
, | |
o | |
}(u), y = ["rtmpConnection", "rtmpStream", "preload", "defaultPlaybackRate", "playbackRate", "autoplay", "loop", "controls", "volume", "muted", "defaultMuted"], m = ["networkState", "readyState", "initialTime", "startOffsetTime", "paused", "ended", "videoWidth", "videoHeight"], _ = v.prototype; | |
function g(t) { | |
var e = t.charAt(0).toUpperCase() + t.slice(1); | |
_["set" + e] = function(e) { | |
return this.el_.vjs_setProperty(t, e) | |
} | |
} | |
function b(e) { | |
_[e] = function() { | |
return this.el_.vjs_getProperty(e) | |
} | |
} | |
for (var T = 0; T < y.length; T++) | |
b(y[T]), | |
g(y[T]); | |
for (var w = 0; w < m.length; w++) | |
b(m[w]); | |
v.isSupported = function() { | |
return !!(i.a.browser.IS_CHROME && !i.a.browser.IS_ANDROID || i.a.browser.IS_SAFARI && !i.a.browser.IS_IOS || i.a.browser.IS_EDGE) || 10 <= v.version()[0] | |
} | |
, | |
u.withSourceHandlers(v), | |
v.nativeSourceHandler = {}, | |
v.nativeSourceHandler.canPlayType = function(e) { | |
return e in v.formats ? "maybe" : "" | |
} | |
, | |
v.nativeSourceHandler.canHandleSource = function(e, t) { | |
var r, n, i = void 0; | |
return i = e.type ? e.type.replace(/;.*/, "").toLowerCase() : (r = e.src, | |
(n = h.getFileExtension(r)) ? "video/" + n : ""), | |
v.nativeSourceHandler.canPlayType(i) | |
} | |
, | |
v.nativeSourceHandler.handleSource = function(e, t, r) { | |
t.setSrc(e.src) | |
} | |
, | |
v.nativeSourceHandler.dispose = function() {} | |
, | |
v.registerSourceHandler(v.nativeSourceHandler), | |
v.formats = { | |
"video/flv": "FLV", | |
"video/x-flv": "FLV", | |
"video/mp4": "MP4", | |
"video/m4v": "MP4" | |
}, | |
v.onReady = function(e) { | |
var t = c.$("#" + e) | |
, r = t && t.tech; | |
r && r.el() && v.checkReady(r) | |
} | |
, | |
v.checkReady = function(e) { | |
e.el() && (e.el().vjs_getProperty ? e.triggerReady() : this.setTimeout(function() { | |
v.checkReady(e) | |
}, 50)) | |
} | |
, | |
v.onEvent = function(e, t) { | |
var r = c.$("#" + e).tech | |
, n = Array.prototype.slice.call(arguments, 2); | |
r.setTimeout(function() { | |
r.trigger(t, n) | |
}, 1) | |
} | |
, | |
v.onError = function(e, t) { | |
var r = c.$("#" + e).tech; | |
if ("srcnotfound" === t) | |
return r.error(4); | |
"string" == typeof t ? r.error("FLASH: " + t) : (t.origin = "flash", | |
r.error(t)) | |
} | |
, | |
v.version = function() { | |
var t = "0,0,0"; | |
try { | |
t = new s.a.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1] | |
} catch (e) { | |
try { | |
f.mimeTypes["application/x-shockwave-flash"].enabledPlugin && (t = (f.plugins["Shockwave Flash 2.0"] || f.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]) | |
} catch (e) {} | |
} | |
return t.split(",") | |
} | |
, | |
v.embed = function(e, t, r, n) { | |
var i = v.getEmbedCode(e, t, r, n); | |
return c.createEl("div", { | |
innerHTML: i | |
}).childNodes[0] | |
} | |
, | |
v.getEmbedCode = function(e, t, r, n) { | |
var i = "" | |
, o = "" | |
, a = ""; | |
return t && Object.getOwnPropertyNames(t).forEach(function(e) { | |
i += e + "=" + t[e] + "&" | |
}), | |
r = p({ | |
movie: e, | |
flashvars: i, | |
allowScriptAccess: "always", | |
allowNetworking: "all" | |
}, r), | |
Object.getOwnPropertyNames(r).forEach(function(e) { | |
o += '<param name="' + e + '" value="' + r[e] + '" />' | |
}), | |
n = p({ | |
data: e, | |
width: "100%", | |
height: "100%" | |
}, n), | |
Object.getOwnPropertyNames(n).forEach(function(e) { | |
a += e + '="' + n[e] + '" ' | |
}), | |
'<object type="application/x-shockwave-flash" ' + a + ">" + o + "</object>" | |
} | |
, | |
(l = v).streamingFormats = { | |
"rtmp/mp4": "MP4", | |
"rtmp/flv": "FLV" | |
}, | |
l.streamFromParts = function(e, t) { | |
return e + "&" + t | |
} | |
, | |
l.streamToParts = function(e) { | |
var t = { | |
connection: "", | |
stream: "" | |
}; | |
if (!e) | |
return t; | |
var r = e.search(/&(?![\w-]+=)/) | |
, n = void 0; | |
return -1 !== r ? n = r + 1 : 0 === (r = n = e.lastIndexOf("/") + 1) && (r = n = e.length), | |
t.connection = e.substring(0, r), | |
t.stream = e.substring(n, e.length), | |
t | |
} | |
, | |
l.isStreamingType = function(e) { | |
return e in l.streamingFormats | |
} | |
, | |
l.RTMP_RE = /^rtmp[set]?:\/\//i, | |
l.isStreamingSrc = function(e) { | |
return l.RTMP_RE.test(e) | |
} | |
, | |
l.rtmpSourceHandler = {}, | |
l.rtmpSourceHandler.canPlayType = function(e) { | |
return l.isStreamingType(e) ? "maybe" : "" | |
} | |
, | |
l.rtmpSourceHandler.canHandleSource = function(e, t) { | |
var r = l.rtmpSourceHandler.canPlayType(e.type); | |
return r || (l.isStreamingSrc(e.src) ? "maybe" : "") | |
} | |
, | |
l.rtmpSourceHandler.handleSource = function(e, t, r) { | |
var n = l.streamToParts(e.src); | |
t.setRtmpConnection(n.connection), | |
t.setRtmpStream(n.stream) | |
} | |
, | |
l.registerSourceHandler(l.rtmpSourceHandler), | |
u.getTech("Flash") ? (i.a.log.warn("Not using videojs-flash as it appears to already be registered"), | |
i.a.log.warn("videojs-flash should only be used with video.js@6 and above")) : i.a.registerTech("Flash", v), | |
v.VERSION = "2.2.0" | |
}, | |
"./node_modules/videojs-mux/dist/videojs-mux.js": function(N1, O1, P1) { | |
var W1, Q1 = Q1 || {}; | |
Q1.js = P1("./node_modules/video.js/dist/video.cjs.js"), | |
N1.exports = (W1 = P1("./node_modules/video.js/dist/video.cjs.js"), | |
function(r) { | |
function n(e) { | |
if (i[e]) | |
return i[e].exports; | |
var t = i[e] = { | |
i: e, | |
l: !1, | |
exports: {} | |
}; | |
return r[e].call(t.exports, t, t.exports, n), | |
t.l = !0, | |
t.exports | |
} | |
var i = {}; | |
return n.m = r, | |
n.c = i, | |
n.d = function(e, t, r) { | |
n.o(e, t) || Object.defineProperty(e, t, { | |
configurable: !1, | |
enumerable: !0, | |
get: r | |
}) | |
} | |
, | |
n.n = function(e) { | |
var t = e && e.__esModule ? function() { | |
return e.default | |
} | |
: function() { | |
return e | |
} | |
; | |
return n.d(t, "a", t), | |
t | |
} | |
, | |
n.o = function(e, t) { | |
return Object.prototype.hasOwnProperty.call(e, t) | |
} | |
, | |
n.p = "", | |
n(n.s = 2) | |
}([function(h2, i2, j2) { | |
h2.exports = function(r) { | |
function n(e) { | |
if (i[e]) | |
return i[e].exports; | |
var t = i[e] = { | |
i: e, | |
l: !1, | |
exports: {} | |
}; | |
return r[e].call(t.exports, t, t.exports, n), | |
t.l = !0, | |
t.exports | |
} | |
var i = {}; | |
return n.m = r, | |
n.c = i, | |
n.d = function(e, t, r) { | |
n.o(e, t) || Object.defineProperty(e, t, { | |
configurable: !1, | |
enumerable: !0, | |
get: r | |
}) | |
} | |
, | |
n.n = function(e) { | |
var t = e && e.__esModule ? function() { | |
return e.default | |
} | |
: function() { | |
return e | |
} | |
; | |
return n.d(t, "a", t), | |
t | |
} | |
, | |
n.o = function(e, t) { | |
return Object.prototype.hasOwnProperty.call(e, t) | |
} | |
, | |
n.p = "", | |
n(n.s = 16) | |
}([function(e, t) { | |
function o(e, t, r) { | |
switch (r.length) { | |
case 0: | |
return e.call(t); | |
case 1: | |
return e.call(t, r[0]); | |
case 2: | |
return e.call(t, r[0], r[1]); | |
case 3: | |
return e.call(t, r[0], r[1], r[2]) | |
} | |
return e.apply(t, r) | |
} | |
function r(e, t) { | |
var r, n, i, o = j(e) || (i = n = r = e) && "object" == typeof i && c(n) && w.call(r, "callee") && (!S.call(r, "callee") || k.call(r) == m) ? function(e, t) { | |
for (var r = -1, n = Array(e); ++r < e; ) | |
n[r] = t(r); | |
return n | |
}(e.length, String) : [], a = o.length, s = !!a; | |
for (var l in e) | |
!t && !w.call(e, l) || s && ("length" == l || u(l, a)) || o.push(l); | |
return o | |
} | |
function l(e, t, r) { | |
var n = e[t]; | |
w.call(e, t) && s(n, r) && (void 0 !== r || t in e) || (e[t] = r) | |
} | |
function u(e, t) { | |
return !!(t = null == t ? y : t) && ("number" == typeof e || b.test(e)) && -1 < e && e % 1 == 0 && e < t | |
} | |
function n(e) { | |
var t = e && e.constructor; | |
return e === ("function" == typeof t && t.prototype || T) | |
} | |
function s(e, t) { | |
return e === t || e != e && t != t | |
} | |
function c(e) { | |
return null != e && "number" == typeof (n = e.length) && -1 < n && n % 1 == 0 && n <= y && !((r = h(t = e) ? k.call(t) : "") == _ || r == g); | |
var t, r, n | |
} | |
function h(e) { | |
var t = typeof e; | |
return !!e && ("object" == t || "function" == t) | |
} | |
function i(e) { | |
return c(e) ? r(e) : function(e) { | |
if (!n(e)) | |
return C(e); | |
var t = []; | |
for (var r in Object(e)) | |
w.call(e, r) && "constructor" != r && t.push(r); | |
return t | |
}(e) | |
} | |
var d, a, p, f, v, y = 9007199254740991, m = "[object Arguments]", _ = "[object Function]", g = "[object GeneratorFunction]", b = /^(?:0|[1-9]\d*)$/, T = Object.prototype, w = T.hasOwnProperty, k = T.toString, S = T.propertyIsEnumerable, C = (f = Object.keys, | |
v = Object, | |
function(e) { | |
return f(v(e)) | |
} | |
), E = Math.max, x = !S.call({ | |
valueOf: 1 | |
}, "valueOf"), j = Array.isArray, P = (d = function(e, t) { | |
if (x || n(t) || c(t)) | |
!function(e, t, r, n) { | |
r || (r = {}); | |
for (var i = -1, o = t.length; ++i < o; ) { | |
var a = t[i] | |
, s = n ? n(r[a], e[a], a, r, e) : void 0; | |
l(r, a, void 0 === s ? e[a] : s) | |
} | |
}(t, i(t), e); | |
else | |
for (var r in t) | |
w.call(t, r) && l(e, r, t[r]) | |
} | |
, | |
a = function(e, t) { | |
var r = -1 | |
, n = t.length | |
, i = 1 < n ? t[n - 1] : void 0 | |
, o = 2 < n ? t[2] : void 0; | |
for (i = 3 < d.length && "function" == typeof i ? (n--, | |
i) : void 0, | |
o && function(e, t, r) { | |
if (!h(r)) | |
return !1; | |
var n = typeof t; | |
return !!("number" == n ? c(r) && u(t, r.length) : "string" == n && t in r) && s(r[t], e) | |
}(t[0], t[1], o) && (i = n < 3 ? void 0 : i, | |
n = 1), | |
e = Object(e); ++r < n; ) { | |
var a = t[r]; | |
a && d(e, a) | |
} | |
return e | |
} | |
, | |
p = E(void 0 === p ? a.length - 1 : p, 0), | |
function() { | |
for (var e = arguments, t = -1, r = E(e.length - p, 0), n = Array(r); ++t < r; ) | |
n[t] = e[p + t]; | |
t = -1; | |
for (var i = Array(p + 1); ++t < p; ) | |
i[t] = e[t]; | |
return i[p] = n, | |
o(a, this, i) | |
} | |
); | |
e.exports = P | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e, t, r) { | |
r = void 0 === r ? 1 : r, | |
e[t] = e[t] || 0, | |
e[t] += r | |
} | |
} | |
, function(r, e, t) { | |
(function(e) { | |
var t; | |
t = "undefined" != typeof window ? window : void 0 !== e ? e : "undefined" != typeof self ? self : {}, | |
r.exports = t | |
} | |
).call(e, t(5)) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n, i = r(18), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = o.default.methodFactory; | |
o.default.methodFactory = function(e, t, r) { | |
var n = a(e, t, r); | |
return function() { | |
for (var e = ["[mux]"], t = 0; t < arguments.length; t++) | |
e.push(arguments[t]); | |
n.apply(void 0, e) | |
} | |
} | |
, | |
o.default.setLevel(o.default.getLevel()), | |
t.default = o.default | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n = function(e) { | |
if ("string" != typeof e || "" === e) | |
return ["localhost"]; | |
var t = e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/) || [] | |
, r = t[4] | |
, n = void 0; | |
return r && (n = (r.match(/[^\.]+\.[^\.]+$/) || [])[0]), | |
[r, n] | |
}; | |
t.extractHostnameAndDomain = n, | |
t.extractHostname = function(e) { | |
return n(e)[0] | |
} | |
, | |
t.extractDomain = function(e) { | |
return n(e)[1] | |
} | |
} | |
, function(e5, f5) { | |
var g5; | |
g5 = function() { | |
return this | |
}(); | |
try { | |
g5 = g5 || Function("return this")() || eval("this") | |
} catch (e5) { | |
"object" == typeof window && (g5 = window) | |
} | |
e5.exports = g5 | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.generateUUID = function() { | |
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) { | |
var t = 16 * Math.random() | 0; | |
return ("x" === e ? t : 3 & t | 8).toString(16) | |
}) | |
} | |
, | |
t.generateShortID = function() { | |
return ("000000" + (Math.random() * Math.pow(36, 6) << 0).toString(36)).slice(-6) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e) { | |
e = (e = e || "").match(/[^\r\n]+/g) || []; | |
for (var t = {}, r = 0; r < e.length; r++) { | |
var n = e[r].split(/\s*:\s*(.+)/); | |
3 === n.length && (t[n[0]] = n[1]) | |
} | |
return t | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.findMediaElement = t.getMuxPlayerId = void 0; | |
var n = r(6) | |
, i = function(e) { | |
return e && void 0 !== e.nodeName ? (e.muxId || (e.muxId = e.id || (0, | |
n.generateShortID)()), | |
e.muxId) : e | |
}; | |
t.getMuxPlayerId = i, | |
t.findMediaElement = function(e) { | |
var t = void 0; | |
return e && void 0 !== e.nodeName ? e = i(t = e) : t = document.querySelector(e), | |
[t, e, t && t.nodeName ? t.nodeName.toLowerCase() : ""] | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
return "1" === (o.default.doNotTrack || o.default.navigator.doNotTrack || o.default.navigator.msDoNotTrack) | |
} | |
; | |
var n, i = r(2), o = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(i, e, o) { | |
(function(e) { | |
var t, r = void 0 !== e ? e : "undefined" != typeof window ? window : {}, n = o(21); | |
"undefined" != typeof document ? t = document : (t = r["__GLOBAL_DOCUMENT_CACHE@4"]) || (t = r["__GLOBAL_DOCUMENT_CACHE@4"] = n), | |
i.exports = t | |
} | |
).call(e, o(5)) | |
} | |
, function(e, t) { | |
e.exports = function(e) { | |
return e.webpackPolyfill || (e.deprecate = function() {} | |
, | |
e.paths = [], | |
e.children || (e.children = []), | |
Object.defineProperty(e, "loaded", { | |
enumerable: !0, | |
get: function() { | |
return e.l | |
} | |
}), | |
Object.defineProperty(e, "id", { | |
enumerable: !0, | |
get: function() { | |
return e.i | |
} | |
}), | |
e.webpackPolyfill = 1), | |
e | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
var n = r(40) | |
, i = r(41) | |
, o = r(14); | |
e.exports = { | |
formats: o, | |
parse: i, | |
stringify: n | |
} | |
} | |
, function(e, o, t) { | |
"use strict"; | |
var a = Object.prototype.hasOwnProperty | |
, s = function() { | |
for (var e = [], t = 0; t < 256; ++t) | |
e.push("%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase()); | |
return e | |
}(); | |
o.arrayToObject = function(e, t) { | |
for (var r = t && t.plainObjects ? Object.create(null) : {}, n = 0; n < e.length; ++n) | |
void 0 !== e[n] && (r[n] = e[n]); | |
return r | |
} | |
, | |
o.merge = function(r, n, i) { | |
if (!n) | |
return r; | |
if ("object" != typeof n) { | |
if (Array.isArray(r)) | |
r.push(n); | |
else { | |
if ("object" != typeof r) | |
return [r, n]; | |
(i.plainObjects || i.allowPrototypes || !a.call(Object.prototype, n)) && (r[n] = !0) | |
} | |
return r | |
} | |
if ("object" != typeof r) | |
return [r].concat(n); | |
var e = r; | |
return Array.isArray(r) && !Array.isArray(n) && (e = o.arrayToObject(r, i)), | |
Array.isArray(r) && Array.isArray(n) ? (n.forEach(function(e, t) { | |
a.call(r, t) ? r[t] && "object" == typeof r[t] ? r[t] = o.merge(r[t], e, i) : r.push(e) : r[t] = e | |
}), | |
r) : Object.keys(n).reduce(function(e, t) { | |
var r = n[t]; | |
return a.call(e, t) ? e[t] = o.merge(e[t], r, i) : e[t] = r, | |
e | |
}, e) | |
} | |
, | |
o.assign = function(e, r) { | |
return Object.keys(r).reduce(function(e, t) { | |
return e[t] = r[t], | |
e | |
}, e) | |
} | |
, | |
o.decode = function(t) { | |
try { | |
return decodeURIComponent(t.replace(/\+/g, " ")) | |
} catch (e) { | |
return t | |
} | |
} | |
, | |
o.encode = function(e) { | |
if (0 === e.length) | |
return e; | |
for (var t = "string" == typeof e ? e : String(e), r = "", n = 0; n < t.length; ++n) { | |
var i = t.charCodeAt(n); | |
45 === i || 46 === i || 95 === i || 126 === i || 48 <= i && i <= 57 || 65 <= i && i <= 90 || 97 <= i && i <= 122 ? r += t.charAt(n) : i < 128 ? r += s[i] : i < 2048 ? r += s[192 | i >> 6] + s[128 | 63 & i] : i < 55296 || 57344 <= i ? r += s[224 | i >> 12] + s[128 | i >> 6 & 63] + s[128 | 63 & i] : (n += 1, | |
i = 65536 + ((1023 & i) << 10 | 1023 & t.charCodeAt(n)), | |
r += s[240 | i >> 18] + s[128 | i >> 12 & 63] + s[128 | i >> 6 & 63] + s[128 | 63 & i]) | |
} | |
return r | |
} | |
, | |
o.compact = function(e) { | |
for (var t = [{ | |
obj: { | |
o: e | |
}, | |
prop: "o" | |
}], r = [], n = 0; n < t.length; ++n) | |
for (var i = t[n], o = i.obj[i.prop], a = Object.keys(o), s = 0; s < a.length; ++s) { | |
var l = a[s] | |
, u = o[l]; | |
"object" == typeof u && null !== u && -1 === r.indexOf(u) && (t.push({ | |
obj: o, | |
prop: l | |
}), | |
r.push(u)) | |
} | |
return function(e) { | |
for (var t; e.length; ) { | |
var r = e.pop(); | |
if (t = r.obj[r.prop], | |
Array.isArray(t)) { | |
for (var n = [], i = 0; i < t.length; ++i) | |
void 0 !== t[i] && n.push(t[i]); | |
r.obj[r.prop] = n | |
} | |
} | |
return t | |
}(t) | |
} | |
, | |
o.isRegExp = function(e) { | |
return "[object RegExp]" === Object.prototype.toString.call(e) | |
} | |
, | |
o.isBuffer = function(e) { | |
return null != e && !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e)) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
var n = String.prototype.replace | |
, i = /%20/g; | |
e.exports = { | |
default: "RFC3986", | |
formatters: { | |
RFC1738: function(e) { | |
return n.call(e, i, "+") | |
}, | |
RFC3986: function(e) { | |
return e | |
} | |
}, | |
RFC1738: "RFC1738", | |
RFC3986: "RFC3986" | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
function i(e) { | |
var t = {}; | |
for (var r in e) | |
e.hasOwnProperty(r) && (t[e[r]] = r); | |
return t | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(o) { | |
var a = {} | |
, s = {}; | |
return Object.keys(o).forEach(function(t) { | |
var r = !1; | |
if (o.hasOwnProperty(t) && void 0 !== o[t]) { | |
var e = t.split("_") | |
, n = e[0] | |
, i = c[n]; | |
i || (l.default.info("Data key word `" + e[0] + "` not expected in " + t), | |
i = n + "_"), | |
e.splice(1).forEach(function(e) { | |
"url" === e && (r = !0), | |
h[e] ? i += h[e] : (l.default.info("Data key word `" + e + "` not expected in " + t), | |
i += "_" + e + "_") | |
}), | |
r ? s[i] = o[t] : a[i] = o[t] | |
} | |
}), | |
(0, | |
u.default)(a, s) | |
} | |
; | |
var o = r(3) | |
, l = n(o) | |
, a = r(0) | |
, u = n(a) | |
, c = i({ | |
a: "env", | |
b: "beacon", | |
d: "ad", | |
e: "event", | |
f: "experiment", | |
m: "mux", | |
n: "response", | |
p: "player", | |
q: "request", | |
r: "retry", | |
s: "session", | |
t: "timestamp", | |
u: "viewer", | |
v: "video", | |
w: "page", | |
x: "view", | |
y: "sub" | |
}) | |
, h = i({ | |
ad: "ad", | |
ag: "aggregate", | |
ap: "api", | |
al: "application", | |
ar: "architecture", | |
as: "asset", | |
au: "autoplay", | |
av: "average", | |
bi: "bitrate", | |
br: "break", | |
bw: "browser", | |
by: "bytes", | |
ca: "cached", | |
cb: "cancel", | |
cd: "code", | |
cg: "category", | |
ch: "changed", | |
cn: "config", | |
co: "count", | |
ce: "counter", | |
cp: "complete", | |
ct: "content", | |
cu: "current", | |
dg: "downscaling", | |
dm: "domain", | |
dn: "cdn", | |
do: "downscale", | |
du: "duration", | |
dv: "device", | |
ec: "encoding", | |
en: "end", | |
eg: "engine", | |
em: "embed", | |
er: "error", | |
es: "errorcode", | |
et: "errortext", | |
ee: "event", | |
ev: "events", | |
ex: "expires", | |
fi: "first", | |
fm: "family", | |
ft: "format", | |
fq: "frequency", | |
fr: "frame", | |
fs: "fullscreen", | |
he: "headers", | |
ho: "host", | |
hn: "hostname", | |
ht: "height", | |
id: "id", | |
ii: "init", | |
in: "instance", | |
ip: "ip", | |
is: "is", | |
ke: "key", | |
la: "language", | |
lb: "labeled", | |
le: "level", | |
li: "live", | |
ld: "loaded", | |
lo: "load", | |
ls: "lists", | |
lt: "latency", | |
ma: "max", | |
md: "media", | |
me: "message", | |
mi: "mime", | |
ml: "midroll", | |
mm: "min", | |
mn: "manufacturer", | |
mx: "mux", | |
nm: "name", | |
no: "number", | |
on: "on", | |
os: "os", | |
pa: "paused", | |
pb: "playback", | |
pd: "producer", | |
pe: "percentage", | |
pf: "played", | |
pg: "program", | |
ph: "playhead", | |
pi: "plugin", | |
pl: "preroll", | |
po: "poster", | |
pr: "preload", | |
py: "property", | |
ra: "rate", | |
rd: "requested", | |
re: "rebuffer", | |
rf: "rendition", | |
ro: "ratio", | |
rp: "response", | |
rq: "request", | |
rs: "requests", | |
sa: "sample", | |
se: "session", | |
sk: "seek", | |
sm: "stream", | |
so: "source", | |
sq: "sequence", | |
sr: "series", | |
st: "start", | |
su: "startup", | |
sv: "server", | |
sw: "software", | |
ta: "tag", | |
tc: "tech", | |
te: "text", | |
th: "throughput", | |
ti: "time", | |
tl: "total", | |
to: "to", | |
tt: "title", | |
ty: "type", | |
ug: "upscaling", | |
up: "upscale", | |
ur: "url", | |
us: "user", | |
va: "variant", | |
vd: "viewed", | |
vi: "video", | |
ve: "version", | |
vw: "view", | |
vr: "viewer", | |
wd: "width", | |
wa: "watch", | |
wt: "waiting" | |
}) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
e.exports = r(17).default | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var i = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
} | |
, o = r(2) | |
, a = n(o) | |
, s = r(8) | |
, l = r(3) | |
, u = n(l) | |
, c = r(9) | |
, h = n(c) | |
, d = r(19) | |
, p = n(d) | |
, f = r(48) | |
, v = n(f) | |
, y = r(49) | |
, m = n(y) | |
, _ = {} | |
, g = function e(t) { | |
var r = arguments; | |
"string" == typeof t ? e.hasOwnProperty(t) ? a.default.setTimeout(function() { | |
r = Array.prototype.splice.call(r, 1), | |
e[t].apply(null, r) | |
}, 0) : u.default.warn("`" + t + "` is an unknown task") : "function" == typeof t ? a.default.setTimeout(function() { | |
t(e) | |
}, 0) : u.default.warn("`" + t + "` is invalid.") | |
}; | |
g.loaded = Date.now(), | |
g.VERSION = "2.7.0", | |
g.API_VERSION = "2.0", | |
g.PLAYER_TRACKED = !1, | |
g.monitor = function(e, t) { | |
return (0, | |
v.default)(g, e, t) | |
} | |
, | |
g.destroyMonitor = function(e) { | |
var t = (0, | |
s.findMediaElement)(e) | |
, r = i(t, 1) | |
, n = r[0]; | |
n && n.mux && "function" == typeof n.mux.destroy ? n.mux.destroy() : u.default.error("A video element monitor for `" + e + "` has not been initialized via `mux.monitor`.") | |
} | |
, | |
g.addHLSJS = function(e, t) { | |
var r = (0, | |
s.getMuxPlayerId)(e); | |
_[r] ? _[r].addHLSJS(t) : u.default.error("A monitor for `" + r + "` has not been initialized.") | |
} | |
, | |
g.addDashJS = function(e, t) { | |
var r = (0, | |
s.getMuxPlayerId)(e); | |
_[r] ? _[r].addDashJS(t) : u.default.error("A monitor for `" + r + "` has not been initialized.") | |
} | |
, | |
g.removeHLSJS = function(e) { | |
var t = (0, | |
s.getMuxPlayerId)(e); | |
_[t] ? _[t].removeHLSJS() : u.default.error("A monitor for `" + t + "` has not been initialized.") | |
} | |
, | |
g.removeDashJS = function(e, t) { | |
var r = (0, | |
s.getMuxPlayerId)(e); | |
_[r] ? _[r].removeDashJS(t) : u.default.error("A monitor for `" + r + "` has not been initialized.") | |
} | |
, | |
g.init = function(e, t) { | |
var r = (0, | |
s.getMuxPlayerId)(e); | |
_[r] = new p.default(g,r,t) | |
} | |
, | |
g.emit = function(e, t, r) { | |
var n = (0, | |
s.getMuxPlayerId)(e); | |
_[n] ? (_[n].emit(t, r), | |
"destroy" === t && delete _[n]) : u.default.error("A monitor for `" + n + "` has not been initialized.") | |
} | |
, | |
(0, | |
h.default)() && u.default.info("The browser's Do Not Track flag is enabled - Mux beaconing may be disabled."), | |
a.default.addEventListener("unload", function() { | |
g.WINDOW_UNLOADING = !0 | |
}, !1), | |
g.checkDoNotTrack = h.default, | |
g.log = u.default, | |
g.utils = m.default, | |
t.default = g | |
} | |
, function(r, n, i) { | |
var o, a; | |
!function(e, t) { | |
"use strict"; | |
void 0 !== (a = "function" == typeof (o = function() { | |
function i(e, t) { | |
var r = e[t]; | |
if ("function" == typeof r.bind) | |
return r.bind(e); | |
try { | |
return Function.prototype.bind.call(r, e) | |
} catch (t) { | |
return function() { | |
return Function.prototype.apply.apply(r, [e, arguments]) | |
} | |
} | |
} | |
function l(e, t) { | |
for (var r = 0; r < h.length; r++) { | |
var n = h[r]; | |
this[n] = r < e ? o : this.methodFactory(n, e, t) | |
} | |
this.log = this.debug | |
} | |
function u(e, t, r) { | |
return "debug" === (n = e) && (n = "log"), | |
typeof console !== c && (void 0 !== console[n] ? i(console, n) : void 0 !== console.log ? i(console, "log") : o) || function(e, t, r) { | |
return function() { | |
typeof console !== c && (l.call(this, t, r), | |
this[e].apply(this, arguments)) | |
} | |
} | |
.apply(this, arguments); | |
var n | |
} | |
function r(r, e, t) { | |
function n() { | |
var e; | |
if (typeof window !== c) { | |
try { | |
e = window.localStorage[a] | |
} catch (e) {} | |
if (typeof e === c) | |
try { | |
var t = window.document.cookie | |
, r = t.indexOf(encodeURIComponent(a) + "="); | |
r && (e = /^([^;]+)/.exec(t.slice(r))[1]) | |
} catch (e) {} | |
return void 0 === o.levels[e] && (e = void 0), | |
e | |
} | |
} | |
var i, o = this, a = "loglevel"; | |
r && (a += ":" + r), | |
o.levels = { | |
TRACE: 0, | |
DEBUG: 1, | |
INFO: 2, | |
WARN: 3, | |
ERROR: 4, | |
SILENT: 5 | |
}, | |
o.methodFactory = t || u, | |
o.getLevel = function() { | |
return i | |
} | |
, | |
o.setLevel = function(e, t) { | |
if ("string" == typeof e && void 0 !== o.levels[e.toUpperCase()] && (e = o.levels[e.toUpperCase()]), | |
!("number" == typeof e && 0 <= e && e <= o.levels.SILENT)) | |
throw "log.setLevel() called with invalid level: " + e; | |
if (i = e, | |
!1 !== t && function(e) { | |
var t = (h[e] || "silent").toUpperCase(); | |
if (typeof window !== c) { | |
try { | |
return window.localStorage[a] = t | |
} catch (e) {} | |
try { | |
window.document.cookie = encodeURIComponent(a) + "=" + t + ";" | |
} catch (e) {} | |
} | |
}(e), | |
l.call(o, e, r), | |
typeof console === c && e < o.levels.SILENT) | |
return "No console available for logging" | |
} | |
, | |
o.setDefaultLevel = function(e) { | |
n() || o.setLevel(e, !1) | |
} | |
, | |
o.enableAll = function(e) { | |
o.setLevel(o.levels.TRACE, e) | |
} | |
, | |
o.disableAll = function(e) { | |
o.setLevel(o.levels.SILENT, e) | |
} | |
; | |
var s = n(); | |
null == s && (s = null == e ? "WARN" : e), | |
o.setLevel(s, !1) | |
} | |
var o = function() {} | |
, c = "undefined" | |
, h = ["trace", "debug", "info", "warn", "error"] | |
, n = new r | |
, a = {}; | |
n.getLogger = function(e) { | |
if ("string" != typeof e || "" === e) | |
throw new TypeError("You must supply a name when creating a logger."); | |
var t = a[e]; | |
return t || (t = a[e] = new r(e,n.getLevel(),n.methodFactory)), | |
t | |
} | |
; | |
var e = typeof window !== c ? window.log : void 0; | |
return n.noConflict = function() { | |
return typeof window !== c && window.log === n && (window.log = e), | |
n | |
} | |
, | |
n | |
} | |
) ? o.call(n, i, n, r) : o) && (r.exports = a) | |
}() | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var a = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
} | |
, i = r(3) | |
, s = n(i) | |
, o = r(0) | |
, l = n(o) | |
, u = r(6) | |
, c = r(4) | |
, h = r(2) | |
, d = n(h) | |
, p = r(1) | |
, f = n(p) | |
, v = r(20) | |
, y = n(v) | |
, m = r(23) | |
, _ = r(24) | |
, g = r(25) | |
, b = n(g) | |
, T = r(26) | |
, w = n(T) | |
, k = r(27) | |
, S = n(k) | |
, C = r(28) | |
, E = n(C) | |
, x = r(29) | |
, j = n(x) | |
, P = r(30) | |
, O = n(P) | |
, A = r(31) | |
, M = n(A) | |
, D = r(32) | |
, I = n(D) | |
, R = r(33) | |
, N = n(R) | |
, L = r(34) | |
, F = n(L) | |
, B = r(35) | |
, H = n(B) | |
, q = r(36) | |
, V = n(q) | |
, W = r(37) | |
, U = n(W) | |
, z = r(38) | |
, G = n(z) | |
, $ = r(47) | |
, K = n($) | |
, X = ["viewstart", "ended", "loadstart", "pause", "play", "playing", "ratechange", "waiting", "adplay", "adpause", "adended", "aderror", "adplaying", "adrequest", "adresponse", "adbreakstart", "adbreakend", "rebufferstart", "rebufferend", "seeked", "error", "hb", "requestcompleted", "requestfailed", "requestcanceled"] | |
, J = function(e, t, r) { | |
var n = this; | |
this.DOM_CONTENT_LOADED_EVENT_END = d.default.performance && d.default.performance.timing.domContentLoadedEventEnd, | |
this.NAVIGATION_START = d.default.performance && d.default.performance.timing.navigationStart, | |
this.mux = e, | |
this.id = t, | |
(r = (0, | |
l.default)({ | |
debug: !1, | |
minimumRebufferDuration: 250, | |
sustainedRebufferThreshold: 1e3, | |
playbackHeartbeatTime: 25, | |
beaconDomain: "litix.io", | |
sampleRate: 1, | |
disableCookies: !1, | |
respectDoNotTrack: !0, | |
errorTranslator: function(e) { | |
return e | |
} | |
}, r)).data = r.data || {}, | |
r.data.property_key && (r.data.env_key = r.data.property_key, | |
delete r.data.property_key), | |
s.default.setLevel(r.debug ? "debug" : "warn"), | |
this.getPlayheadTime = r.getPlayheadTime, | |
this.getStateData = r.getStateData || function() {} | |
, | |
this.getAdData = r.getAdData || function() {} | |
, | |
this.minimumRebufferDuration = r.minimumRebufferDuration, | |
this.sustainedRebufferThreshold = r.sustainedRebufferThreshold, | |
this.playbackHeartbeatTime = r.playbackHeartbeatTime, | |
this.errorTranslator = r.errorTranslator, | |
this.playbackEventDispatcher = new G.default(e,r.data.env_key,r), | |
this.data = { | |
player_instance_id: (0, | |
u.generateShortID)(), | |
mux_sample_rate: r.sampleRate, | |
beacon_domain: r.beaconDomain | |
}, | |
this.data.view_sequence_number = 1, | |
this.data.player_sequence_number = 1, | |
this.oldEmit = this.emit, | |
this.emit = function(e, t) { | |
t = (0, | |
l.default)({ | |
viewer_time: Date.now() | |
}, t), | |
this.oldEmit(e, t) | |
} | |
; | |
var i = function() { | |
void 0 === this.data.view_start && (this.data.view_start = Date.now(), | |
this.emit("viewstart")) | |
} | |
.bind(this); | |
this.on("viewinit", function(e, t) { | |
this._resetVideoData(), | |
this._resetViewData(), | |
this._resetErrorData(), | |
this._updateStateData(), | |
(0, | |
l.default)(this.data, t), | |
this._initializeViewData(), | |
this.one("play", i), | |
this.one("adbreakstart", i) | |
}); | |
var o = function(e) { | |
this.emit("viewend"), | |
this.send("viewend"), | |
this.emit("viewinit", e) | |
} | |
.bind(this); | |
this.on("videochange", function(e, t) { | |
o(t) | |
}), | |
this.on("programchange", function(e, t) { | |
this.data.player_is_paused && this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."), | |
o((0, | |
l.default)(t, { | |
view_program_changed: !0 | |
})), | |
i() | |
}), | |
this.on("destroy", this.destroy); | |
var a = this.destroy.bind(this); | |
d.default.addEventListener("unload", a, !1), | |
this.on("destroy", function() { | |
d.default.removeEventListener("unload", a) | |
}), | |
this.on("playerready", function(e, t) { | |
(0, | |
l.default)(this.data, t) | |
}), | |
X.forEach(function(r) { | |
n.on(r, function(e, t) { | |
0 !== r.indexOf("ad") && this._updateStateData(), | |
(0, | |
l.default)(this.data, t), | |
this._sanitizeData() | |
}), | |
n.on("after" + r, function() { | |
("error" !== r || this.viewErrored) && this.send(r) | |
}) | |
}), | |
this.on("viewend", function(e, t) { | |
(0, | |
l.default)(n.data, t) | |
}), | |
this.one("playerready", function(e) { | |
var t = Date.now(); | |
this.data.player_init_time && (this.data.player_startup_time = t - this.data.player_init_time), | |
!this.mux.PLAYER_TRACKED && this.NAVIGATION_START && (this.mux.PLAYER_TRACKED = !0, | |
(this.data.player_init_time || this.DOM_CONTENT_LOADED_EVENT_END) && (this.data.page_load_time = Math.min(this.data.player_init_time || 1 / 0, this.DOM_CONTENT_LOADED_EVENT_END || 1 / 0) - this.NAVIGATION_START)), | |
this.send("playerready"), | |
delete this.data.player_startup_time, | |
delete this.data.page_load_time | |
}), | |
S.default.apply(this), | |
U.default.apply(this), | |
F.default.apply(this), | |
O.default.apply(this), | |
w.default.apply(this), | |
N.default.apply(this), | |
E.default.apply(this), | |
j.default.apply(this), | |
H.default.apply(this), | |
M.default.apply(this), | |
I.default.apply(this), | |
V.default.apply(this), | |
K.default.apply(this), | |
r.hlsjs && this.addHLSJS(r), | |
r.dashjs && this.addDashJS(r), | |
this.emit("viewinit", r.data) | |
}; | |
(0, | |
l.default)(J.prototype, b.default.prototype), | |
(0, | |
l.default)(J.prototype, O.default.prototype), | |
(0, | |
l.default)(J.prototype, F.default.prototype), | |
(0, | |
l.default)(J.prototype, w.default.prototype), | |
(0, | |
l.default)(J.prototype, E.default.prototype), | |
(0, | |
l.default)(J.prototype, j.default.prototype), | |
(0, | |
l.default)(J.prototype, H.default.prototype), | |
(0, | |
l.default)(J.prototype, M.default.prototype), | |
(0, | |
l.default)(J.prototype, I.default.prototype), | |
J.prototype.destroy = function() { | |
this._destroyed || (this._destroyed = !0, | |
void 0 !== this.data.view_start && (this.emit("viewend"), | |
this.send("viewend")), | |
this.playbackEventDispatcher.destroy(), | |
this.removeHLSJS(), | |
this.removeDashJS(), | |
d.default.clearTimeout(this._heartBeatTimeout)) | |
} | |
, | |
J.prototype.send = function(e) { | |
var t = (0, | |
l.default)({}, this.data); | |
if (1 === t.player_error_code && (delete t.player_error_code, | |
delete t.player_error_message), | |
t.player_source_duration === 1 / 0 || t.video_source_duration === 1 / 0 ? t.video_source_is_live = !0 : (0 < t.player_source_duration || 0 < t.video_source_duration) && (t.video_source_is_live = !1), | |
t.video_source_url = t.video_source_url || t.player_source_url, | |
t.video_source_url) { | |
var r = (0, | |
c.extractHostnameAndDomain)(t.video_source_url) | |
, n = a(r, 2) | |
, i = n[0] | |
, o = n[1]; | |
t.video_source_domain = o, | |
t.video_source_hostname = i | |
} | |
delete t.ad_request_id, | |
this.playbackEventDispatcher.send(e, t), | |
this.data.view_sequence_number++, | |
this.data.player_sequence_number++, | |
this._restartHeartBeat() | |
} | |
, | |
J.prototype._updateStateData = function() { | |
(0, | |
l.default)(this.data, this.getStateData()), | |
this.getPlayheadTime && (this.data.player_playhead_time = this.getPlayheadTime()), | |
this._sanitizeData() | |
} | |
, | |
J.prototype._sanitizeData = function() { | |
var r = this; | |
["player_width", "player_height", "video_source_width", "video_source_height", "player_playhead_time"].forEach(function(e) { | |
var t = parseInt(r.data[e], 10); | |
r.data[e] = isNaN(t) ? void 0 : t | |
}) | |
} | |
, | |
J.prototype._resetVideoData = function(e, t) { | |
var r = this; | |
Object.keys(this.data).forEach(function(e) { | |
0 === e.indexOf("video_") && delete r.data[e] | |
}) | |
} | |
, | |
J.prototype._resetViewData = function() { | |
var t = this; | |
Object.keys(this.data).forEach(function(e) { | |
0 === e.indexOf("view_") && delete t.data[e] | |
}), | |
this.data.view_sequence_number = 1 | |
} | |
, | |
J.prototype._resetErrorData = function(e, t) { | |
delete this.data.player_error_code, | |
delete this.data.player_error_message | |
} | |
, | |
J.prototype._initializeViewData = function() { | |
var e = this | |
, t = this.data.view_id = (0, | |
u.generateUUID)(); | |
this.data.video_id || (this.data.video_id = (0, | |
y.default)(this.data.player_source_url)); | |
var r = function() { | |
t === e.data.view_id && (0, | |
f.default)(e.data, "player_view_count", 1) | |
}; | |
this.data.player_is_paused ? this.one("play", r) : r() | |
} | |
, | |
J.prototype._restartHeartBeat = function() { | |
var e = this; | |
d.default.clearTimeout(this._heartBeatTimeout), | |
this.viewErrored || (this._heartBeatTimeout = d.default.setTimeout(function() { | |
e.data.player_is_paused || e.emit("hb") | |
}, 1e4)) | |
} | |
, | |
J.prototype.addHLSJS = function(e) { | |
return e.hlsjs ? this.hlsjs ? void this.mux.log.warn("An instance of HLS.js is already being monitored for this player.") : (this.hlsjs = e.hlsjs, | |
void (0, | |
m.monitorHlsJs)(this.mux, this.id, e.hlsjs, {}, e.Hls || d.default.Hls)) : void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.") | |
} | |
, | |
J.prototype.removeHLSJS = function() { | |
this.hlsjs && ((0, | |
m.stopMonitoringHlsJs)(this.hlsjs), | |
this.hlsjs = void 0) | |
} | |
, | |
J.prototype.addDashJS = function(e) { | |
return e.dashjs ? this.dashjs ? void this.mux.log.warn("An instance of Dash.js is already being monitored for this player.") : (this.dashjs = e.dashjs, | |
void (0, | |
_.monitorDashJS)(this.mux, this.id, e.dashjs)) : void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.") | |
} | |
, | |
J.prototype.removeDashJS = function() { | |
this.dashjs && ((0, | |
_.stopMonitoringDashJS)(this.dashjs), | |
this.dashjs = void 0) | |
} | |
, | |
t.default = J | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e) { | |
var t = o.default.createElement("a"); | |
t.href = e; | |
var r = t.pathname.replace(/\.[^\/.]+$/, ""); | |
return s.default.encode(t.host + r).split("=")[0] | |
} | |
; | |
var i = r(10) | |
, o = n(i) | |
, a = r(22) | |
, s = n(a) | |
} | |
, function(e, t) {} | |
, function(e, o, a) { | |
(function(n, e) { | |
var i; | |
!function(e) { | |
var t = ("object" == typeof n && n && n.exports, | |
function(e) { | |
this.message = e | |
} | |
); | |
t.prototype = new Error, | |
t.prototype.name = "InvalidCharacterError"; | |
var u = function(e) { | |
throw new t(e) | |
} | |
, c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
, s = /[\t\n\f\r ]/g | |
, r = { | |
encode: function(e) { | |
e = String(e), | |
/[^\0-\xFF]/.test(e) && u("The string to be encoded contains characters outside of the Latin1 range."); | |
for (var t, r, n, i, o = e.length % 3, a = "", s = -1, l = e.length - o; ++s < l; ) | |
t = e.charCodeAt(s) << 16, | |
r = e.charCodeAt(++s) << 8, | |
n = e.charCodeAt(++s), | |
a += c.charAt((i = t + r + n) >> 18 & 63) + c.charAt(i >> 12 & 63) + c.charAt(i >> 6 & 63) + c.charAt(63 & i); | |
return 2 == o ? (t = e.charCodeAt(s) << 8, | |
r = e.charCodeAt(++s), | |
a += c.charAt((i = t + r) >> 10) + c.charAt(i >> 4 & 63) + c.charAt(i << 2 & 63) + "=") : 1 == o && (i = e.charCodeAt(s), | |
a += c.charAt(i >> 2) + c.charAt(i << 4 & 63) + "=="), | |
a | |
}, | |
decode: function(e) { | |
var t = (e = String(e).replace(s, "")).length; | |
t % 4 == 0 && (e = e.replace(/==?$/, ""), | |
t = e.length), | |
(t % 4 == 1 || /[^+a-zA-Z0-9\/]/.test(e)) && u("Invalid character: the string to be decoded is not correctly encoded."); | |
for (var r, n, i = 0, o = "", a = -1; ++a < t; ) | |
n = c.indexOf(e.charAt(a)), | |
r = i % 4 ? 64 * r + n : n, | |
i++ % 4 && (o += String.fromCharCode(255 & r >> (-2 * i & 6))); | |
return o | |
}, | |
version: "0.1.0" | |
}; | |
void 0 !== (i = function() { | |
return r | |
} | |
.call(o, a, o, n)) && (n.exports = i) | |
}() | |
} | |
).call(o, a(11)(e), a(5)) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.stopMonitoringHlsJs = t.monitorHlsJs = void 0; | |
var i = r(2) | |
, c = n(i) | |
, o = r(7) | |
, a = n(o) | |
, v = r(4) | |
, y = function(e) { | |
if (!e) | |
return {}; | |
var t = c.default.performance.timing.navigationStart; | |
return { | |
bytesLoaded: e.total, | |
requestStart: Math.round(t + e.trequest), | |
responseStart: Math.round(t + e.tfirst), | |
responseEnd: Math.round(t + e.tload) | |
} | |
} | |
, m = function(e) { | |
if (e && "function" == typeof e.getAllResponseHeaders) | |
return (0, | |
a.default)(e.getAllResponseHeaders()) | |
}; | |
t.monitorHlsJs = function(r, n, h) { | |
var s = (3 < arguments.length && void 0 !== arguments[3] && arguments[3], | |
arguments[4]) | |
, e = r.log; | |
if (c.default.performance && c.default.performance.timing) { | |
var f = function(e, t) { | |
return r.emit(n, e, t) | |
} | |
, t = function(e, t) { | |
var r = t.levels | |
, n = t.audioTracks | |
, i = t.url | |
, o = t.stats | |
, a = t.networkDetails | |
, s = {} | |
, l = {}; | |
r.forEach(function(e, t) { | |
s[t] = { | |
width: e.width, | |
height: e.height, | |
bitrate: e.bitrate, | |
attrs: e.attrs | |
} | |
}), | |
n.forEach(function(e, t) { | |
l[t] = { | |
name: e.name, | |
language: e.lang, | |
bitrate: e.bitrate | |
} | |
}); | |
var u = y(o) | |
, c = u.bytesLoaded | |
, h = u.requestStart | |
, d = u.responseStart | |
, p = u.responseEnd; | |
f("requestcompleted", { | |
request_event_type: e, | |
request_bytes_loaded: c, | |
request_start: h, | |
request_response_start: d, | |
request_response_end: p, | |
request_type: "manifest", | |
request_hostname: (0, | |
v.extractHostname)(i), | |
request_response_headers: m(a), | |
request_rendition_lists: { | |
media: s, | |
audio: l, | |
video: {} | |
} | |
}) | |
}; | |
h.on(s.Events.MANIFEST_LOADED, t); | |
var i = function(e, t) { | |
var r = t.details | |
, n = t.level | |
, i = t.networkDetails | |
, o = t.stats | |
, a = y(o) | |
, s = a.bytesLoaded | |
, l = a.requestStart | |
, u = a.responseStart | |
, c = a.responseEnd; | |
f("requestcompleted", { | |
request_event_type: e, | |
request_bytes_loaded: s, | |
request_start: l, | |
request_response_start: u, | |
request_response_end: c, | |
request_current_level: n, | |
request_type: "manifest", | |
request_hostname: (0, | |
v.extractHostname)(r.url), | |
request_response_headers: m(i) | |
}) | |
}; | |
h.on(s.Events.LEVEL_LOADED, i); | |
var o = function(e, t) { | |
var r = t.details | |
, n = t.networkDetails | |
, i = t.stats | |
, o = y(i) | |
, a = o.bytesLoaded | |
, s = o.requestStart | |
, l = o.responseStart | |
, u = o.responseEnd; | |
f("requestcompleted", { | |
request_event_type: e, | |
request_bytes_loaded: a, | |
request_start: s, | |
request_response_start: l, | |
request_response_end: u, | |
request_type: "manifest", | |
request_hostname: (0, | |
v.extractHostname)(r.url), | |
request_response_headers: m(n) | |
}) | |
}; | |
h.on(s.Events.AUDIO_TRACK_LOADED, o); | |
var a = function(e, t) { | |
var r = t.stats | |
, n = t.networkDetails | |
, i = t.frag | |
, o = y(r) | |
, a = o.bytesLoaded | |
, s = o.requestStart | |
, l = o.responseStart | |
, u = o.responseEnd | |
, c = { | |
request_event_type: e, | |
request_bytes_loaded: a, | |
request_start: s, | |
request_response_start: l, | |
request_response_end: u, | |
request_hostname: n ? (0, | |
v.extractHostname)(n.responseURL) : void 0, | |
request_response_headers: m(n), | |
request_media_duration: i.duration | |
}; | |
"main" === i.type ? (c.request_type = "media", | |
c.request_current_level = i.level, | |
c.request_video_width = (h.levels[i.level] || {}).width, | |
c.request_video_height = (h.levels[i.level] || {}).height) : c.request_type = i.type, | |
f("requestcompleted", c) | |
}; | |
h.on(s.Events.FRAG_LOADED, a); | |
var l = function(e, t) { | |
var r = t.details | |
, n = t.response | |
, i = t.context | |
, o = t.frag; | |
if (r === s.ErrorDetails.MANIFEST_LOAD_ERROR || r === s.ErrorDetails.MANIFEST_LOAD_TIMEOUT || r === s.ErrorDetails.FRAG_LOAD_ERROR || r === s.ErrorDetails.FRAG_LOAD_TIMEOUT || r === s.ErrorDetails.LEVEL_LOAD_ERROR || r === s.ErrorDetails.LEVEL_LOAD_TIMEOUT) { | |
var a = o && o.url || i && i.url || ""; | |
f("requestfailed", { | |
request_error: r, | |
request_url: a, | |
request_hostname: (0, | |
v.extractHostname)(a), | |
request_type: r === s.ErrorDetails.FRAG_LOAD_ERROR || r === s.ErrorDetails.FRAG_LOAD_TIMEOUT ? "media" : "manifest", | |
request_error_code: n && n.code, | |
request_error_text: n && n.text | |
}) | |
} | |
}; | |
h.on(s.Events.ERROR, l); | |
var u = function(e, t) { | |
var r = t.frag | |
, n = r && r._url || ""; | |
f("requestcanceled", { | |
request_cancel: e, | |
request_url: n, | |
request_type: "media", | |
request_hostname: (0, | |
v.extractHostname)(n) | |
}) | |
}; | |
h.on(s.Events.FRAG_LOAD_EMERGENCY_ABORTED, u), | |
h._stopMuxMonitor = function() { | |
h.off(s.Events.MANIFEST_LOADED, t), | |
h.off(s.Events.LEVEL_LOADED, i), | |
h.off(s.Events.AUDIO_TRACK_LOADED, o), | |
h.off(s.Events.FRAG_LOADED, a), | |
h.off(s.Events.ERROR, l), | |
h.off(s.Events.FRAG_LOAD_EMERGENCY_ABORTED, u), | |
h.off(s.Events.DESTROYING, h._stopMuxMonitor), | |
delete h._stopMuxMonitor | |
} | |
, | |
h.on(s.Events.DESTROYING, h._stopMuxMonitor) | |
} else | |
e.warn("window.performance.timing not supported. Not tracking HLS.js.") | |
} | |
, | |
t.stopMonitoringHlsJs = function(e) { | |
e && "function" == typeof e._stopMuxMonitor && e._stopMuxMonitor() | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.stopMonitoringDashJS = t.monitorDashJS = void 0; | |
var i = r(2) | |
, s = n(i) | |
, o = r(7) | |
, d = n(o) | |
, p = r(4) | |
, j = function(e, t) { | |
if (!e || "function" != typeof e.getRequests) | |
return {}; | |
var r = e.getRequests({ | |
state: "executed" | |
}); | |
if (0 === r.length) | |
return {}; | |
var n = r[r.length - 1] | |
, i = (0, | |
p.extractHostname)(n.url) | |
, o = n.bytesLoaded | |
, a = new Date(n.requestStartDate).getTime() | |
, s = new Date(n.firstByteDate).getTime() | |
, l = new Date(n.requestEndDate).getTime() | |
, u = isNaN(n.duration) ? 0 : n.duration | |
, c = t.getMetricsFor(n.mediaType).HttpList | |
, h = void 0; | |
return 0 < c.length && (h = (0, | |
d.default)(c[c.length - 1]._responseHeaders || "")), | |
{ | |
requestStart: a, | |
requestResponseStart: s, | |
requestResponseEnd: l, | |
requestBytesLoaded: o, | |
requestResponseHeaders: h, | |
requestMediaDuration: u, | |
requestHostname: i | |
} | |
}; | |
t.monitorDashJS = function(r, n, E) { | |
var e = (3 < arguments.length && void 0 !== arguments[3] && arguments[3], | |
r.log); | |
if (E && E.on) { | |
var x = function(e, t) { | |
return r.emit(n, e, t) | |
} | |
, t = function(e) { | |
var t = e.type | |
, r = e.data | |
, n = r || {} | |
, i = n.url; | |
x("requestcompleted", { | |
request_event_type: t, | |
request_start: 0, | |
request_response_start: 0, | |
request_response_end: 0, | |
request_bytes_loaded: -1, | |
request_type: "manifest", | |
request_hostname: (0, | |
p.extractHostname)(i) | |
}) | |
}; | |
E.on("manifestLoaded", t); | |
var m = {} | |
, i = function(e) { | |
var t = e.type | |
, r = e.fragmentModel | |
, n = e.chunk | |
, i = n || {} | |
, o = i.mediaInfo | |
, a = o || {} | |
, s = a.type | |
, l = a.bitrateList | |
, u = {}; | |
(l = l || []).forEach(function(e, t) { | |
u[t] = {}, | |
u[t].width = e.width, | |
u[t].height = e.height, | |
u[t].bitrate = e.bandwidth, | |
u[t].attrs = {} | |
}), | |
"video" === s ? m.video = u : "audio" === s ? m.audio = u : m.media = u; | |
var c = j(r, E) | |
, h = c.requestStart | |
, d = c.requestResponseStart | |
, p = c.requestResponseEnd | |
, f = c.requestResponseHeaders | |
, v = c.requestMediaDuration | |
, y = c.requestHostname; | |
x("requestcompleted", { | |
request_event_type: t, | |
request_start: h, | |
request_response_start: d, | |
request_response_end: p, | |
request_bytes_loaded: -1, | |
request_type: s + "_init", | |
request_response_headers: f, | |
request_hostname: y, | |
request_media_duration: v, | |
request_rendition_lists: m | |
}) | |
}; | |
E.on("initFragmentLoaded", i); | |
var o = function(e) { | |
var t, r, n, i, o = e.type, a = e.fragmentModel, s = e.chunk, l = s || {}, u = l.mediaInfo, c = l.start, h = u || {}, d = h.type, p = j(a, E), f = p.requestStart, v = p.requestResponseStart, y = p.requestResponseEnd, m = p.requestBytesLoaded, _ = p.requestResponseHeaders, g = p.requestMediaDuration, b = p.requestHostname, T = (t = d, | |
n = (r = E).getQualityFor(t), | |
(i = r.getCurrentTrackFor(t).bitrateList) ? { | |
currentLevel: n, | |
renditionWidth: i[n].width || null, | |
renditionHeight: i[n].height || null, | |
renditionBitrate: i[n].bandwidth | |
} : {}), w = T.currentLevel, k = T.renditionWidth, S = T.renditionHeight, C = T.renditionBitrate; | |
x("requestcompleted", { | |
request_event_type: o, | |
request_start: f, | |
request_response_start: v, | |
request_response_end: y, | |
request_bytes_loaded: m, | |
request_type: d, | |
request_response_headers: _, | |
request_hostname: b, | |
request_media_start_time: c, | |
request_media_duration: g, | |
request_current_level: w, | |
request_labeled_bitrate: C, | |
request_video_width: k, | |
request_video_height: S | |
}) | |
}; | |
E.on("mediaFragmentLoaded", o); | |
var a = function(e) { | |
var t = e.error | |
, r = e.event | |
, n = (r = r || {}).request || {} | |
, i = s.default.event && s.default.event.currentTarget || {}; | |
x("requestfailed", { | |
request_error: t + "_" + r.id + "_" + n.type, | |
request_url: r.url, | |
request_hostname: (0, | |
p.extractHostname)(r.url), | |
request_type: n.mediaType, | |
request_error_code: i.status, | |
request_error_type: i.statusText | |
}) | |
}; | |
E.on("error", a), | |
E._stopMuxMonitor = function() { | |
E.off("manifestLoaded", t), | |
E.off("initFragmentLoaded", i), | |
E.off("mediaFragmentLoaded", o), | |
E.off("error", a), | |
delete E._stopMuxMonitor | |
} | |
} else | |
e.warn("Invalid dash.js player reference. Monitoring blocked.") | |
} | |
, | |
t.stopMonitoringDashJS = function(e) { | |
e && "function" == typeof e._stopMuxMonitor && e._stopMuxMonitor() | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n = function() {} | |
, o = 0; | |
n.prototype.on = function(e, t, r) { | |
return t._eventEmitterGuid = t._eventEmitterGuid || ++o, | |
this._listeners = this._listeners || {}, | |
this._listeners[e] = this._listeners[e] || [], | |
r && (t = t.bind(r)), | |
this._listeners[e].push(t), | |
t | |
} | |
, | |
n.prototype.off = function(e, r) { | |
var n = this._listeners && this._listeners[e]; | |
n && n.forEach(function(e, t) { | |
e._eventEmitterGuid === r._eventEmitterGuid && n.splice(t, 1) | |
}) | |
} | |
, | |
n.prototype.one = function(t, r, n) { | |
var i = this; | |
r._eventEmitterGuid = r._eventEmitterGuid || ++o; | |
var e = function e() { | |
i.off(t, e), | |
r.apply(n || this, arguments) | |
}; | |
e._eventEmitterGuid = r._eventEmitterGuid, | |
this.on(t, e) | |
} | |
, | |
n.prototype.emit = function(r, e) { | |
var n = this; | |
if (this._listeners) { | |
e = e || {}; | |
var t = this._listeners["before*"] || [] | |
, i = this._listeners[r] || [] | |
, o = this._listeners["after" + r] || [] | |
, a = function(e, t) { | |
(e = e.slice()).forEach(function(e) { | |
e.call(n, { | |
type: r | |
}, t) | |
}) | |
}; | |
a(t, e), | |
a(i, e), | |
a(o, e) | |
} | |
} | |
, | |
t.default = n | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n, i = r(2), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = function() { | |
this._playbackHeartbeatInterval = null, | |
this._playheadShouldBeProgressing = !1, | |
this.on("playing", function() { | |
this._playheadShouldBeProgressing = !0 | |
}), | |
this.on("play", this._startPlaybackHeartbeatInterval), | |
this.on("adbreakstart", this._startPlaybackHeartbeatInterval), | |
this.on("adplay", this._startPlaybackHeartbeatInterval), | |
this.on("seeking", this._startPlaybackHeartbeatInterval), | |
this.on("devicewake", this._startPlaybackHeartbeatInterval), | |
this.on("viewstart", this._startPlaybackHeartbeatInterval), | |
this.on("pause", this._stopPlaybackHeartbeatInterval), | |
this.on("ended", this._stopPlaybackHeartbeatInterval), | |
this.on("viewend", this._stopPlaybackHeartbeatInterval), | |
this.on("error", this._stopPlaybackHeartbeatInterval), | |
this.on("adpause", this._stopPlaybackHeartbeatInterval), | |
this.on("adbreakend", this._stopPlaybackHeartbeatInterval), | |
this.on("seeked", function() { | |
this.data.player_is_paused && this._stopPlaybackHeartbeatInterval() | |
}), | |
this.on("timeupdate", function() { | |
null !== this._playbackHeartbeatInterval && this.emit("playbackheartbeat") | |
}), | |
this.on("devicesleep", function(e, t) { | |
null !== this._playbackHeartbeatInterval && (o.default.clearInterval(this._playbackHeartbeatInterval), | |
this.emit("playbackheartbeatend", { | |
viewer_time: t.viewer_time | |
}), | |
this._playbackHeartbeatInterval = null) | |
}) | |
}; | |
a.prototype._startPlaybackHeartbeatInterval = function() { | |
var e = this; | |
null === this._playbackHeartbeatInterval && (this.emit("playbackheartbeat"), | |
this._playbackHeartbeatInterval = o.default.setInterval(function() { | |
e.emit("playbackheartbeat") | |
}, this.playbackHeartbeatTime)) | |
} | |
, | |
a.prototype._stopPlaybackHeartbeatInterval = function() { | |
this._playheadShouldBeProgressing = !1, | |
null !== this._playbackHeartbeatInterval && (o.default.clearInterval(this._playbackHeartbeatInterval), | |
this.emit("playbackheartbeatend"), | |
this._playbackHeartbeatInterval = null) | |
} | |
, | |
t.default = a | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
var t = this; | |
this.on("viewinit", function() { | |
t.viewErrored = !1 | |
}), | |
this.on("error", function() { | |
try { | |
var e = t.errorTranslator({ | |
player_error_code: t.data.player_error_code, | |
player_error_message: t.data.player_error_message | |
}); | |
e ? (t.data.player_error_code = e.player_error_code, | |
t.data.player_error_message = e.player_error_message, | |
t.viewErrored = !0) : (delete t.data.player_error_code, | |
delete t.data.player_error_message) | |
} catch (e) { | |
t.mux.log.warn("Exception in error translator callback.", e), | |
t.viewErrored = !0 | |
} | |
}) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n, i = r(1), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = function() { | |
this._watchTimeTrackerLastCheckedTime = null, | |
this.on("playbackheartbeat", this._updateWatchTime), | |
this.on("playbackheartbeatend", this._clearWatchTimeState) | |
}; | |
a.prototype._updateWatchTime = function(e, t) { | |
var r = t.viewer_time; | |
null === this._watchTimeTrackerLastCheckedTime && (this._watchTimeTrackerLastCheckedTime = r), | |
(0, | |
o.default)(this.data, "view_watch_time", r - this._watchTimeTrackerLastCheckedTime), | |
this._watchTimeTrackerLastCheckedTime = r | |
} | |
, | |
a.prototype._clearWatchTimeState = function(e, t) { | |
this._updateWatchTime(e, t), | |
this._watchTimeTrackerLastCheckedTime = null | |
} | |
, | |
t.default = a | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n, i = r(1), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = function() { | |
this._playbackTimeTrackerLastPlayheadPosition = -1, | |
this.on("playbackheartbeat", this._updatePlaybackTime), | |
this.on("playbackheartbeatend", this._clearPlaybackTimeState), | |
this.on("seeking", this._clearPlaybackTimeState) | |
}; | |
a.prototype._updatePlaybackTime = function() { | |
var e = this.data.player_playhead_time; | |
if (0 <= this._playbackTimeTrackerLastPlayheadPosition && e > this._playbackTimeTrackerLastPlayheadPosition) { | |
var t = e - this._playbackTimeTrackerLastPlayheadPosition; | |
t <= 1e3 && (0, | |
o.default)(this.data, "view_content_playback_time", t) | |
} | |
this._playbackTimeTrackerLastPlayheadPosition = e | |
} | |
, | |
a.prototype._clearPlaybackTimeState = function() { | |
this._updatePlaybackTime(), | |
this._playbackTimeTrackerLastPlayheadPosition = -1 | |
} | |
, | |
t.default = a | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n = function() { | |
this.on("playbackheartbeat", this._updatePlayheadTime), | |
this.on("playbackheartbeatend", this._updatePlayheadTime), | |
this.on("timeupdate", this._updatePlayheadTime), | |
this.on("destroy", function() { | |
this.off("timeupdate", this._updatePlayheadTime) | |
}) | |
}; | |
n.prototype._updatePlayheadTime = function(e, t) { | |
if (t.player_playhead_time) | |
this.data.player_playhead_time = t.player_playhead_time; | |
else if (this.getPlayheadTime) { | |
var r = this.getPlayheadTime(); | |
void 0 !== r && (this.data.player_playhead_time = r) | |
} | |
} | |
, | |
t.default = n | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n, i = r(1), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = function() { | |
this._lastCheckedTime = null, | |
this._lastPlayheadTime = null, | |
this._lastPlayheadTimeUpdatedTime = null, | |
this.on("playbackheartbeat", this._checkIfRebuffering), | |
this.on("playbackheartbeatend", this._cleanupRebufferTracker), | |
this.on("seeking", function() { | |
this._cleanupRebufferTracker(null, { | |
viewer_time: Date.now() | |
}) | |
}) | |
}; | |
a.prototype._checkIfRebuffering = function(e, t) { | |
if (this.isSeeking || this.isAdBreak || !this._playheadShouldBeProgressing) | |
this._cleanupRebufferTracker(e, t); | |
else { | |
if (null === this._lastCheckedTime) | |
return this._prepareRebufferTrackerState(t.viewer_time), | |
void this._updateRebufferMetrics(); | |
if (this._lastPlayheadTime === this.data.player_playhead_time) { | |
var r = t.viewer_time - this._lastPlayheadTimeUpdatedTime; | |
r >= this.sustainedRebufferThreshold && (this._rebuffering ? this._updateRebufferMetrics(t.viewer_time - this._lastCheckedTime) : (this._rebuffering = !0, | |
(0, | |
o.default)(this.data, "view_rebuffer_count", 1), | |
this._updateRebufferMetrics(r), | |
this.emit("rebufferstart"))), | |
this._lastCheckedTime = t.viewer_time | |
} else | |
this._cleanupRebufferTracker(e, t, !0) | |
} | |
} | |
, | |
a.prototype._clearRebufferTrackerState = function() { | |
this._lastCheckedTime = null, | |
this._lastPlayheadTime = null, | |
this._lastPlayheadTimeUpdatedTime = null | |
} | |
, | |
a.prototype._prepareRebufferTrackerState = function(e) { | |
this._lastCheckedTime = e, | |
this._lastPlayheadTime = this.data.player_playhead_time, | |
this._lastPlayheadTimeUpdatedTime = e | |
} | |
, | |
a.prototype._cleanupRebufferTracker = function(e, t) { | |
var r = 2 < arguments.length && void 0 !== arguments[2] && arguments[2]; | |
if (this._rebuffering) | |
this._rebuffering = !1, | |
this._updateRebufferMetrics(t.viewer_time - this._lastCheckedTime), | |
this.emit("rebufferend", { | |
viewer_time: t.viewer_time | |
}); | |
else { | |
if (null === this._lastCheckedTime) | |
return void this._updateRebufferMetrics(); | |
var n = this.data.player_playhead_time - this._lastPlayheadTime | |
, i = t.viewer_time - this._lastPlayheadTimeUpdatedTime; | |
0 < n && i - n > this.minimumRebufferDuration ? ((0, | |
o.default)(this.data, "view_rebuffer_count", 1), | |
this._updateRebufferMetrics(i - n), | |
this.emit("rebufferstart", { | |
viewer_time: this._lastPlayheadTimeUpdatedTime | |
}), | |
this.emit("rebufferend", { | |
viewer_time: this._lastPlayheadTimeUpdatedTime + i - n | |
})) : this._updateRebufferMetrics() | |
} | |
r ? this._prepareRebufferTrackerState(t.viewer_time) : this._clearRebufferTrackerState() | |
} | |
, | |
a.prototype._updateRebufferMetrics = function(e) { | |
0 < e && (0, | |
o.default)(this.data, "view_rebuffer_duration", e), | |
0 <= this.data.view_watch_time && 0 < this.data.view_rebuffer_count && (this.data.view_rebuffer_frequency = this.data.view_rebuffer_count / this.data.view_watch_time, | |
this.data.view_rebuffer_percentage = this.data.view_rebuffer_duration / this.data.view_watch_time) | |
} | |
, | |
t.default = a | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n = function() { | |
this.on("viewinit", function() { | |
var e = this.data | |
, n = e.view_id; | |
if (!e.view_program_changed) { | |
var t = function(e, t) { | |
var r = t.viewer_time; | |
"playing" === e.type && void 0 === this.data.view_time_to_first_frame ? this.calculateTimeToFirstFrame(r || Date.now(), n) : "adplaying" !== e.type || void 0 !== this.data.view_time_to_first_frame && !this.inPrerollPosition() || this.calculateTimeToFirstFrame(r || Date.now(), n) | |
}; | |
this.one("playing", t), | |
this.one("adplaying", t), | |
this.one("viewend", function() { | |
this.off("playing", t), | |
this.off("adplaying", t) | |
}) | |
} | |
}) | |
}; | |
n.prototype.calculateTimeToFirstFrame = function(e, t) { | |
t === this.data.view_id && (this._updateWatchTime(null, { | |
viewer_time: e | |
}), | |
this.data.view_time_to_first_frame = this.data.view_watch_time, | |
(this.data.player_autoplay_on || this.data.video_is_autoplay) && this.NAVIGATION_START && (this.data.view_aggregate_startup_time = this.data.view_start + this.data.view_watch_time - this.NAVIGATION_START)) | |
} | |
, | |
t.default = n | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
var t = this; | |
this.on("viewinit", function() { | |
this._lastPlayheadPosition = -1 | |
}); | |
var e = ["playing", "hb"]; | |
["pause", "rebufferstart", "seeking", "error", "adbreakstart", "hb"].forEach(function(e) { | |
t.on(e, function() { | |
if (0 <= this._lastPlayheadPosition && 0 <= this.data.player_playhead_time && 0 <= this._lastPlayerWidth && 0 < this._lastSourceWidth && 0 <= this._lastPlayerHeight && 0 < this._lastSourceHeight) { | |
var e = this.data.player_playhead_time - this._lastPlayheadPosition; | |
if (e < 0) | |
return void (this._lastPlayheadPosition = -1); | |
var t = Math.min(this._lastPlayerWidth / this._lastSourceWidth, this._lastPlayerHeight / this._lastSourceHeight) | |
, r = Math.max(0, t - 1) | |
, n = Math.max(0, 1 - t); | |
this.data.view_max_upscale_percentage = Math.max(this.data.view_max_upscale_percentage || 0, r), | |
this.data.view_max_downscale_percentage = Math.max(this.data.view_max_downscale_percentage || 0, n), | |
(0, | |
o.default)(this.data, "view_total_content_playback_time", e), | |
(0, | |
o.default)(this.data, "view_total_upscaling", r * e), | |
(0, | |
o.default)(this.data, "view_total_downscaling", n * e) | |
} | |
this._lastPlayheadPosition = -1 | |
}) | |
}), | |
e.forEach(function(e) { | |
t.on(e, function() { | |
this._lastPlayheadPosition = this.data.player_playhead_time, | |
this._lastPlayerWidth = this.data.player_width, | |
this._lastPlayerHeight = this.data.player_height, | |
this._lastSourceWidth = this.data.video_source_width, | |
this._lastSourceHeight = this.data.video_source_height | |
}) | |
}) | |
} | |
; | |
var n, i = r(1), o = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
this.isSeeking = !1, | |
this.on("seeking", function(e, t) { | |
(0, | |
s.default)(this.data, t), | |
this._lastSeekingTime = Date.now(), | |
!1 === this.isSeeking && (this.isSeeking = !0, | |
this.send("seeking")) | |
}), | |
this.on("seeked", function() { | |
this.isSeeking = !1; | |
var e = this._lastSeekingTime || Date.now() | |
, t = Date.now() - e; | |
(0, | |
o.default)(this.data, "view_seek_count", 1), | |
(0, | |
o.default)(this.data, "view_seek_duration", t); | |
var r = this.data.view_max_seek_time || 0; | |
this.data.view_max_seek_time = Math.max(r, t) | |
}), | |
this.on("viewend", function() { | |
this.isSeeking = !1 | |
}) | |
} | |
; | |
var i = r(1) | |
, o = n(i) | |
, a = r(0) | |
, s = n(a) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var c = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
} | |
, i = r(1) | |
, o = n(i) | |
, h = r(4) | |
, a = r(0) | |
, s = n(a) | |
, l = function(e, t) { | |
e.push(t), | |
e.sort(function(e, t) { | |
return e.viewer_time - t.viewer_time | |
}) | |
} | |
, u = ["adbreakstart", "adrequest", "adresponse", "adplay", "adplaying", "adpause", "adended", "adbreakend", "aderror"] | |
, d = function() { | |
var t = this; | |
this.on("viewinit", function() { | |
this.isAdBreak = !1, | |
this._currentAdRequestNumber = 0, | |
this._currentAdResponseNumber = 0, | |
this._adRequests = [], | |
this._adResponses = [], | |
this._adHasPlayed = !1, | |
this._wouldBeNewAdPlay = !0, | |
this._prerollPlayTime = void 0 | |
}), | |
u.forEach(function(e) { | |
return t.on(e, t._updateAdData) | |
}); | |
var e = function() { | |
t.isAdBreak = !1 | |
}; | |
this.on("adbreakstart", function() { | |
this.isAdBreak = !0 | |
}), | |
this.on("play", e), | |
this.on("playing", e), | |
this.on("viewend", e), | |
this.on("adrequest", function(e, t) { | |
t = (0, | |
s.default)({ | |
ad_request_id: "generatedAdRequestId" + this._currentAdRequestNumber++ | |
}, t), | |
l(this._adRequests, t), | |
(0, | |
o.default)(this.data, "view_ad_request_count"), | |
this.inPrerollPosition() && (this.data.view_preroll_requested = !0, | |
this._adHasPlayed || (0, | |
o.default)(this.data, "view_preroll_request_count")) | |
}), | |
this.on("adresponse", function(e, t) { | |
t = (0, | |
s.default)({ | |
ad_request_id: "generatedAdRequestId" + this._currentAdResponseNumber++ | |
}, t), | |
l(this._adResponses, t); | |
var r = this.findAdRequest(t.ad_request_id); | |
r && (0, | |
o.default)(this.data, "view_ad_request_time", Math.max(0, t.viewer_time - r.viewer_time)) | |
}), | |
this.on("adplay", function(e, t) { | |
this._adHasPlayed = !0, | |
this._wouldBeNewAdPlay && (this._wouldBeNewAdPlay = !1, | |
(0, | |
o.default)(this.data, "view_ad_played_count")), | |
this.inPrerollPosition() && !this.data.view_preroll_played && (this.data.view_preroll_played = !0, | |
0 < this._adRequests.length && (this.data.view_preroll_request_time = Math.max(0, t.viewer_time - this._adRequests[0].viewer_time)), | |
this.data.view_start && (this.data.view_startup_preroll_request_time = Math.max(0, t.viewer_time - this.data.view_start)), | |
this._prerollPlayTime = t.viewer_time) | |
}), | |
this.on("adplaying", function(e, t) { | |
this.inPrerollPosition() && void 0 === this.data.view_preroll_load_time && void 0 !== this._prerollPlayTime && (this.data.view_preroll_load_time = t.viewer_time - this._prerollPlayTime, | |
this.data.view_startup_preroll_load_time = t.viewer_time - this._prerollPlayTime) | |
}), | |
this.on("adended", function() { | |
this._wouldBeNewAdPlay = !0 | |
}), | |
this.on("aderror", function() { | |
this._wouldBeNewAdPlay = !0 | |
}) | |
}; | |
d.prototype.inPrerollPosition = function() { | |
return void 0 === this.data.view_content_playback_time || this.data.view_content_playback_time <= 1e3 | |
} | |
, | |
d.prototype.findAdRequest = function(e) { | |
for (var t = 0; t < this._adRequests.length; t++) | |
if (this._adRequests[t].ad_request_id === e) | |
return this._adRequests[t] | |
} | |
, | |
d.prototype._updateAdData = function(e, t) { | |
if (this.inPrerollPosition()) { | |
if (!this.data.view_preroll_ad_tag_hostname && t.ad_tag_url) { | |
var r = (0, | |
h.extractHostnameAndDomain)(t.ad_tag_url) | |
, n = c(r, 2) | |
, i = n[0] | |
, o = n[1]; | |
this.data.view_preroll_ad_tag_domain = o, | |
this.data.view_preroll_ad_tag_hostname = i | |
} | |
if (!this.data.view_preroll_ad_asset_hostname && t.ad_asset_url) { | |
var a = (0, | |
h.extractHostnameAndDomain)(t.ad_asset_url) | |
, s = c(a, 2) | |
, l = s[0] | |
, u = s[1]; | |
this.data.view_preroll_ad_asset_domain = u, | |
this.data.view_preroll_ad_asset_hostname = l | |
} | |
} | |
} | |
, | |
t.default = d | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
var t = this | |
, r = void 0 | |
, e = void 0 | |
, n = function() { | |
r && ((0, | |
a.default)(t.data, "view_waiting_rebuffer_duration", Date.now() - r), | |
r = !1, | |
window.clearInterval(e)) | |
} | |
, i = !1 | |
, o = function() { | |
i = !1, | |
n() | |
}; | |
this.on("waiting", function() { | |
i && ((0, | |
a.default)(t.data, "view_waiting_rebuffer_count", 1), | |
r = Date.now(), | |
e = window.setInterval(function() { | |
if (r) { | |
var e = Date.now(); | |
(0, | |
a.default)(t.data, "view_waiting_rebuffer_duration", e - r), | |
r = e | |
} | |
}, 250)) | |
}), | |
this.on("playing", function() { | |
n(), | |
i = !0 | |
}), | |
this.on("pause", o), | |
this.on("seeking", o) | |
} | |
; | |
var n, i = r(1), a = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
var e = this; | |
this.one("playbackheartbeat", a), | |
this.on("playbackheartbeatend", function() { | |
e.off("before*", s), | |
e.one("playbackheartbeat", a) | |
}) | |
} | |
; | |
var n, i = r(0), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, a = function() { | |
this.lastWallClockTime = Date.now(), | |
this.on("before*", s) | |
}, s = function(e) { | |
var t = Date.now() | |
, r = this.lastWallClockTime; | |
3e4 < (this.lastWallClockTime = t) - r && (this.emit("devicesleep", { | |
viewer_time: r | |
}), | |
(0, | |
o.default)(this.data, { | |
viewer_time: r | |
}), | |
this.send("devicesleep"), | |
this.emit("devicewake", { | |
viewer_time: t | |
}), | |
(0, | |
o.default)(this.data, { | |
viewer_time: t | |
}), | |
this.send("devicewake")) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { | |
return typeof e | |
} | |
: function(e) { | |
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e | |
} | |
, s = r(39) | |
, i = r(3) | |
, l = n(i) | |
, o = r(43) | |
, a = n(o) | |
, u = r(9) | |
, h = n(u) | |
, d = r(15) | |
, p = n(d) | |
, f = r(44) | |
, v = n(f) | |
, y = r(46) | |
, m = n(y) | |
, _ = r(0) | |
, g = n(_) | |
, b = ["env_key", "view_id", "view_sequence_number", "player_sequence_number", "beacon_domain", "player_playhead_time", "viewer_time", "mux_api_version", "event", "video_id"] | |
, T = ["viewstart", "error", "ended", "viewend"] | |
, w = function(e, t) { | |
var r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}; | |
this.mux = e, | |
this.envKey = t, | |
this.eventQueue = new v.default((0, | |
a.default)(t, r.beaconDomain)), | |
this.previousBeaconData = null, | |
this.lastEventTime = null, | |
this.sampleRate = r.sampleRate, | |
this.disableCookies = r.disableCookies, | |
this.respectDoNotTrack = r.respectDoNotTrack, | |
this.pageLevelData = { | |
mux_api_version: this.mux.API_VERSION, | |
mux_embed_version: this.mux.VERSION, | |
page_url: window.location.href, | |
viewer_application_name: m.default.name, | |
viewer_application_version: m.default.version, | |
viewer_application_engine: m.default.layout, | |
viewer_device_name: m.default.product, | |
viewer_device_category: "", | |
viewer_device_manufacturer: m.default.manufacturer, | |
viewer_os_family: m.default.os && m.default.os.family, | |
viewer_os_architecture: m.default.os && m.default.os.architecture, | |
viewer_os_version: m.default.os && m.default.os.version | |
}, | |
this.viewerData = this.disableCookies ? {} : (0, | |
s.getAndUpdateViewerData)() | |
}; | |
w.prototype.send = function(e, t) { | |
if (e) { | |
if (this.respectDoNotTrack && (0, | |
h.default)()) | |
return l.default.info("Not sending `" + e + "` because Do Not Track is enabled in your browser"); | |
if (!t || "object" !== (void 0 === t ? "undefined" : c(t))) | |
return l.default.error("A data object was expected in send() but was not provided"); | |
var r = this.disableCookies ? {} : (0, | |
s.getAndUpdateSessionData)() | |
, n = {}; | |
(0, | |
g.default)(n, this.pageLevelData), | |
(0, | |
g.default)(n, t), | |
(0, | |
g.default)(n, r), | |
(0, | |
g.default)(n, this.viewerData), | |
n.event = e, | |
n.env_key = this.envKey, | |
n.user_id && (n.viewer_user_id = n.user_id, | |
delete n.user_id); | |
var i = n.mux_sample_number >= this.sampleRate | |
, o = this._deduplicateBeaconData(e, n) | |
, a = (0, | |
p.default)(o); | |
if (this.lastEventTime = Date.now(), | |
i) | |
return l.default.info("Not sending event due to sample rate restriction", e, n, a); | |
if (!this.envKey) | |
return l.default.info("Not sending event due to missing environment key", e, n, a); | |
if (!this.rateLimited) | |
if (l.default.info("Sending event", e, n, a), | |
this.rateLimited = !this.eventQueue.queueEvent(e, a), | |
this.mux.WINDOW_UNLOADING && "viewend" === e) | |
this.eventQueue.destroy(!0); | |
else if (0 <= T.indexOf(e) && this.eventQueue.flushEvents(), | |
this.rateLimited) | |
return n.event = "eventrateexceeded", | |
a = (0, | |
p.default)(n), | |
this.eventQueue.queueEvent(n.event, a), | |
l.default.error("Beaconing disabled due to rate limit.") | |
} | |
} | |
, | |
w.prototype.destroy = function() { | |
this.eventQueue.destroy(!1) | |
} | |
, | |
w.prototype._deduplicateBeaconData = function(e, a) { | |
var s = this | |
, l = {} | |
, t = a.view_id; | |
if (!t || "viewstart" === e || "viewend" === e || !this.previousBeaconData || 6e5 <= Date.now() - this.lastEventTime) | |
l = (0, | |
g.default)({}, a), | |
t && (this.previousBeaconData = l), | |
t && "viewend" === e && (this.previousBeaconData = null); | |
else { | |
var u = 0 === e.indexOf("request"); | |
Object.keys(a).forEach(function(e) { | |
var t, r, n, i, o = a[e]; | |
(o !== s.previousBeaconData[e] || -1 < b.indexOf(e) || (t = u, | |
r = e, | |
n = o, | |
i = s.previousBeaconData[e], | |
t && 0 === r.indexOf("request_") && ("request_response_headers" === r || "object" !== (void 0 === n ? "undefined" : c(n)) || "object" !== (void 0 === i ? "undefined" : c(i)) || Object.keys(n || {}).length !== Object.keys(i || {}).length))) && (l[e] = o, | |
s.previousBeaconData[e] = o) | |
}) | |
} | |
return l | |
} | |
, | |
t.default = w | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.getAndUpdateSessionData = t.getAndUpdateViewerData = void 0; | |
var i = r(12) | |
, o = n(i) | |
, a = r(42) | |
, s = n(a) | |
, l = r(6) | |
, u = function() { | |
var t = void 0; | |
try { | |
t = o.default.parse(s.default.get("muxData") || "") | |
} catch (e) { | |
t = {} | |
} | |
return t | |
} | |
, c = function(e) { | |
s.default.set("muxData", o.default.stringify(e), { | |
expires: 7300 | |
}) | |
}; | |
t.getAndUpdateViewerData = function() { | |
var e = u(); | |
return e.mux_viewer_id = e.mux_viewer_id || (0, | |
l.generateUUID)(), | |
e.msn = e.msn || Math.random(), | |
c(e), | |
{ | |
mux_viewer_id: e.mux_viewer_id, | |
mux_sample_number: e.msn | |
} | |
} | |
, | |
t.getAndUpdateSessionData = function() { | |
var e = u() | |
, t = Date.now(); | |
return e.session_start && (e.sst = e.session_start, | |
delete e.session_start), | |
e.session_id && (e.sid = e.session_id, | |
delete e.session_id), | |
e.session_expires && (e.sex = e.session_expires, | |
delete e.session_expires), | |
(!e.sex || e.sex < t) && (e.sid = (0, | |
l.generateUUID)(), | |
e.sst = t), | |
e.sex = t + 15e5, | |
c(e), | |
{ | |
session_id: e.sid, | |
session_start: e.sst, | |
session_expires: e.sex | |
} | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
var k = r(13) | |
, S = r(14) | |
, C = { | |
brackets: function(e) { | |
return e + "[]" | |
}, | |
indices: function(e, t) { | |
return e + "[" + t + "]" | |
}, | |
repeat: function(e) { | |
return e | |
} | |
} | |
, n = Date.prototype.toISOString | |
, E = { | |
delimiter: "&", | |
encode: !0, | |
encoder: k.encode, | |
encodeValuesOnly: !1, | |
serializeDate: function(e) { | |
return n.call(e) | |
}, | |
skipNulls: !1, | |
strictNullHandling: !1 | |
} | |
, x = function e(t, r, n, i, o, a, s, l, u, c, h, d) { | |
var p = t; | |
if ("function" == typeof s) | |
p = s(r, p); | |
else if (p instanceof Date) | |
p = c(p); | |
else if (null === p) { | |
if (i) | |
return a && !d ? a(r, E.encoder) : r; | |
p = "" | |
} | |
if ("string" == typeof p || "number" == typeof p || "boolean" == typeof p || k.isBuffer(p)) | |
return a ? [h(d ? r : a(r, E.encoder)) + "=" + h(a(p, E.encoder))] : [h(r) + "=" + h(String(p))]; | |
var f, v = []; | |
if (void 0 === p) | |
return v; | |
if (Array.isArray(s)) | |
f = s; | |
else { | |
var y = Object.keys(p); | |
f = l ? y.sort(l) : y | |
} | |
for (var m = 0; m < f.length; ++m) { | |
var _ = f[m]; | |
o && null === p[_] || (v = Array.isArray(p) ? v.concat(e(p[_], n(r, _), n, i, o, a, s, l, u, c, h, d)) : v.concat(e(p[_], r + (u ? "." + _ : "[" + _ + "]"), n, i, o, a, s, l, u, c, h, d))) | |
} | |
return v | |
}; | |
e.exports = function(e, t) { | |
var r = e | |
, n = t ? k.assign({}, t) : {}; | |
if (null !== n.encoder && void 0 !== n.encoder && "function" != typeof n.encoder) | |
throw new TypeError("Encoder has to be a function."); | |
var i = void 0 === n.delimiter ? E.delimiter : n.delimiter | |
, o = "boolean" == typeof n.strictNullHandling ? n.strictNullHandling : E.strictNullHandling | |
, a = "boolean" == typeof n.skipNulls ? n.skipNulls : E.skipNulls | |
, s = "boolean" == typeof n.encode ? n.encode : E.encode | |
, l = "function" == typeof n.encoder ? n.encoder : E.encoder | |
, u = "function" == typeof n.sort ? n.sort : null | |
, c = void 0 !== n.allowDots && n.allowDots | |
, h = "function" == typeof n.serializeDate ? n.serializeDate : E.serializeDate | |
, d = "boolean" == typeof n.encodeValuesOnly ? n.encodeValuesOnly : E.encodeValuesOnly; | |
if (void 0 === n.format) | |
n.format = S.default; | |
else if (!Object.prototype.hasOwnProperty.call(S.formatters, n.format)) | |
throw new TypeError("Unknown format option provided."); | |
var p, f, v = S.formatters[n.format]; | |
"function" == typeof n.filter ? (f = n.filter, | |
r = f("", r)) : Array.isArray(n.filter) && (f = n.filter, | |
p = f); | |
var y, m = []; | |
if ("object" != typeof r || null === r) | |
return ""; | |
y = n.arrayFormat in C ? n.arrayFormat : "indices"in n ? n.indices ? "indices" : "repeat" : "indices"; | |
var _ = C[y]; | |
p || (p = Object.keys(r)), | |
u && p.sort(u); | |
for (var g = 0; g < p.length; ++g) { | |
var b = p[g]; | |
a && null === r[b] || (m = m.concat(x(r[b], b, _, o, a, s ? l : null, f, u, c, h, v, d))) | |
} | |
var T = m.join(i) | |
, w = !0 === n.addQueryPrefix ? "?" : ""; | |
return 0 < T.length ? w + T : "" | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
var u = r(13) | |
, d = Object.prototype.hasOwnProperty | |
, p = { | |
allowDots: !1, | |
allowPrototypes: !1, | |
arrayLimit: 20, | |
decoder: u.decode, | |
delimiter: "&", | |
depth: 5, | |
parameterLimit: 1e3, | |
plainObjects: !1, | |
strictNullHandling: !1 | |
} | |
, c = function(e, t, r) { | |
if (e) { | |
var n = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e | |
, i = /(\[[^[\]]*])/g | |
, o = /(\[[^[\]]*])/.exec(n) | |
, a = o ? n.slice(0, o.index) : n | |
, s = []; | |
if (a) { | |
if (!r.plainObjects && d.call(Object.prototype, a) && !r.allowPrototypes) | |
return; | |
s.push(a) | |
} | |
for (var l = 0; null !== (o = i.exec(n)) && l < r.depth; ) { | |
if (l += 1, | |
!r.plainObjects && d.call(Object.prototype, o[1].slice(1, -1)) && !r.allowPrototypes) | |
return; | |
s.push(o[1]) | |
} | |
return o && s.push("[" + n.slice(o.index) + "]"), | |
function(e, t, r) { | |
for (var n = t, i = e.length - 1; 0 <= i; --i) { | |
var o, a = e[i]; | |
if ("[]" === a) | |
o = (o = []).concat(n); | |
else { | |
o = r.plainObjects ? Object.create(null) : {}; | |
var s = "[" === a.charAt(0) && "]" === a.charAt(a.length - 1) ? a.slice(1, -1) : a | |
, l = parseInt(s, 10); | |
!isNaN(l) && a !== s && String(l) === s && 0 <= l && r.parseArrays && l <= r.arrayLimit ? (o = [])[l] = n : o[s] = n | |
} | |
n = o | |
} | |
return n | |
}(s, t, r) | |
} | |
}; | |
e.exports = function(e, t) { | |
var r = t ? u.assign({}, t) : {}; | |
if (null !== r.decoder && void 0 !== r.decoder && "function" != typeof r.decoder) | |
throw new TypeError("Decoder has to be a function."); | |
if (r.ignoreQueryPrefix = !0 === r.ignoreQueryPrefix, | |
r.delimiter = "string" == typeof r.delimiter || u.isRegExp(r.delimiter) ? r.delimiter : p.delimiter, | |
r.depth = "number" == typeof r.depth ? r.depth : p.depth, | |
r.arrayLimit = "number" == typeof r.arrayLimit ? r.arrayLimit : p.arrayLimit, | |
r.parseArrays = !1 !== r.parseArrays, | |
r.decoder = "function" == typeof r.decoder ? r.decoder : p.decoder, | |
r.allowDots = "boolean" == typeof r.allowDots ? r.allowDots : p.allowDots, | |
r.plainObjects = "boolean" == typeof r.plainObjects ? r.plainObjects : p.plainObjects, | |
r.allowPrototypes = "boolean" == typeof r.allowPrototypes ? r.allowPrototypes : p.allowPrototypes, | |
r.parameterLimit = "number" == typeof r.parameterLimit ? r.parameterLimit : p.parameterLimit, | |
r.strictNullHandling = "boolean" == typeof r.strictNullHandling ? r.strictNullHandling : p.strictNullHandling, | |
"" === e || null == e) | |
return r.plainObjects ? Object.create(null) : {}; | |
for (var n = "string" == typeof e ? function(e, t) { | |
for (var r = {}, n = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, i = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, o = n.split(t.delimiter, i), a = 0; a < o.length; ++a) { | |
var s, l, u = o[a], c = u.indexOf("]="), h = -1 === c ? u.indexOf("=") : c + 1; | |
l = -1 === h ? (s = t.decoder(u, p.decoder), | |
t.strictNullHandling ? null : "") : (s = t.decoder(u.slice(0, h), p.decoder), | |
t.decoder(u.slice(h + 1), p.decoder)), | |
d.call(r, s) ? r[s] = [].concat(r[s]).concat(l) : r[s] = l | |
} | |
return r | |
}(e, r) : e, i = r.plainObjects ? Object.create(null) : {}, o = Object.keys(n), a = 0; a < o.length; ++a) { | |
var s = o[a] | |
, l = c(s, n[s], r); | |
i = u.merge(i, l, r) | |
} | |
return u.compact(i) | |
} | |
} | |
, function(i, o, a) { | |
"use strict"; | |
var s, l, u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { | |
return typeof e | |
} | |
: function(e) { | |
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e | |
} | |
; | |
!function(e) { | |
var t = !1; | |
if (void 0 !== (l = "function" == typeof (s = e) ? s.call(o, a, o, i) : s) && (i.exports = l), | |
t = !0, | |
"object" === u(o) && (i.exports = e(), | |
t = !0), | |
!t) { | |
var r = window.Cookies | |
, n = window.Cookies = e(); | |
n.noConflict = function() { | |
return window.Cookies = r, | |
n | |
} | |
} | |
}(function() { | |
var p = function() { | |
for (var e = 0, t = {}; e < arguments.length; e++) { | |
var r = arguments[e]; | |
for (var n in r) | |
t[n] = r[n] | |
} | |
return t | |
}; | |
return function e(h) { | |
function d(e, t, r) { | |
var n; | |
if ("undefined" != typeof document) { | |
if (1 < arguments.length) { | |
if ("number" == typeof (r = p({ | |
path: "/" | |
}, d.defaults, r)).expires) { | |
var i = new Date; | |
i.setMilliseconds(i.getMilliseconds() + 864e5 * r.expires), | |
r.expires = i | |
} | |
try { | |
n = JSON.stringify(t), | |
/^[\{\[]/.test(n) && (t = n) | |
} catch (e) {} | |
return t = h.write ? h.write(t, e) : encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), | |
e = (e = (e = encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)).replace(/[\(\)]/g, escape), | |
document.cookie = [e, "=", t, r.expires ? "; expires=" + r.expires.toUTCString() : "", r.path ? "; path=" + r.path : "", r.domain ? "; domain=" + r.domain : "", r.secure ? "; secure" : ""].join("") | |
} | |
e || (n = {}); | |
for (var o = document.cookie ? document.cookie.split("; ") : [], a = /(%[0-9A-Z]{2})+/g, s = 0; s < o.length; s++) { | |
var l = o[s].split("=") | |
, u = l.slice(1).join("="); | |
'"' === u.charAt(0) && (u = u.slice(1, -1)); | |
try { | |
var c = l[0].replace(a, decodeURIComponent); | |
if (u = h.read ? h.read(u, c) : h(u, c) || u.replace(a, decodeURIComponent), | |
this.json) | |
try { | |
u = JSON.parse(u) | |
} catch (e) {} | |
if (e === c) { | |
n = u; | |
break | |
} | |
e || (n[c] = u) | |
} catch (e) {} | |
} | |
return n | |
} | |
} | |
return (d.set = d).get = function(e) { | |
return d.call(d, e) | |
} | |
, | |
d.getJSON = function() { | |
return d.apply({ | |
json: !0 | |
}, [].slice.call(arguments)) | |
} | |
, | |
d.defaults = {}, | |
d.remove = function(e, t) { | |
d(e, "", p(t, { | |
expires: -1 | |
})) | |
} | |
, | |
d.withConverter = e, | |
d | |
}(function() {}) | |
}) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e, t) { | |
return t = t || "litix.io", | |
(e = e || "").match(/^[a-z0-9]+$/) ? "https://" + e + "." + t : "https://img.litix.io/a.gif" | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var i = r(2) | |
, o = n(i) | |
, a = r(3) | |
, s = n(a) | |
, l = r(45) | |
, u = n(l) | |
, c = r(0) | |
, h = n(c) | |
, d = r(15) | |
, p = n(d) | |
, f = !!o.default.XMLHttpRequest && "withCredentials"in new o.default.XMLHttpRequest | |
, v = { | |
maxBeaconSize: 300, | |
maxQueueLength: 3600, | |
baseTimeBetweenBeacons: 5e3 | |
} | |
, y = function(e, t) { | |
this._beaconUrl = e || "https://img.litix.io", | |
this._eventQueue = [], | |
this._postInFlight = !1, | |
this._failureCount = 0, | |
this._sendTimeout = !1, | |
this._options = (0, | |
h.default)({}, v, t) | |
}; | |
y.prototype.queueEvent = function(e, t) { | |
var r = (0, | |
h.default)({}, t); | |
return f ? (this._eventQueue.length <= this._options.maxQueueLength || "eventrateexceeded" === e) && (this._eventQueue.push(r), | |
this._sendTimeout || this._startBeaconSending(), | |
this._eventQueue.length <= this._options.maxQueueLength) : (u.default.send(this._beaconUrl, r), | |
!0) | |
} | |
, | |
y.prototype.flushEvents = function() { | |
f && (this._eventQueue.length && this._sendBeaconQueue(), | |
this._startBeaconSending()) | |
} | |
, | |
y.prototype.destroy = function() { | |
var e = 0 < arguments.length && void 0 !== arguments[0] && arguments[0]; | |
this.destroyed = !0, | |
e ? this._clearBeaconQueue() : this.flushEvents(), | |
o.default.clearTimeout(this._sendTimeout) | |
} | |
, | |
y.prototype._clearBeaconQueue = function() { | |
var e = o.default.navigator | |
, t = this._eventQueue.length > this._options.maxBeaconSize ? this._eventQueue.length - this._options.maxBeaconSize : 0 | |
, r = this._eventQueue.slice(t); | |
if (0 < t && (0, | |
h.default)(r[r.length - 1], (0, | |
p.default)({ | |
mux_view_message: "event queue truncated" | |
})), | |
e.sendBeacon) | |
e.sendBeacon(this._beaconUrl, JSON.stringify({ | |
events: r | |
})); | |
else if (o.default.XMLHttpRequest) { | |
var n = new o.default.XMLHttpRequest; | |
n.open("POST", this._beaconUrl), | |
n.setRequestHeader("Content-Type", "application/json"), | |
n.send(JSON.stringify({ | |
events: r | |
})) | |
} else | |
u.default.send(this._beaconUrl, r[r.length - 1]) | |
} | |
, | |
y.prototype._sendBeaconQueue = function() { | |
var e = this; | |
if (o.default.XMLHttpRequest && !this._postInFlight) { | |
var t = new o.default.XMLHttpRequest | |
, r = this._eventQueue.slice(0, this._options.maxBeaconSize); | |
this._eventQueue = this._eventQueue.slice(this._options.maxBeaconSize), | |
this._postInFlight = !0, | |
t.onreadystatechange = function() { | |
4 === t.readyState && (200 !== t.status ? (e._eventQueue = r.concat(e._eventQueue), | |
e._failureCount += 1, | |
s.default.info("Error sending beacon: " + t.status), | |
s.default.info(t.responseText)) : e._failureCount = 0, | |
e._postInFlight = !1) | |
} | |
, | |
t.open("POST", this._beaconUrl), | |
t.setRequestHeader("Content-Type", "application/json"), | |
t.send(JSON.stringify({ | |
events: r | |
})) | |
} | |
} | |
, | |
y.prototype._getNextBeaconTime = function() { | |
if (!this._failureCount) | |
return this._options.baseTimeBetweenBeacons; | |
var e = Math.pow(2, this._failureCount - 1); | |
return (1 + (e *= Math.random())) * this._options.baseTimeBetweenBeacons | |
} | |
, | |
y.prototype._startBeaconSending = function() { | |
var e = this; | |
o.default.clearTimeout(this._sendTimeout), | |
this.destroyed || (this._sendTimeout = o.default.setTimeout(function() { | |
e._eventQueue.length && e._sendBeaconQueue(), | |
e._startBeaconSending() | |
}, this._getNextBeaconTime())) | |
} | |
, | |
t.default = y | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var i = r(12) | |
, a = n(i) | |
, o = r(2) | |
, s = n(o) | |
, l = { | |
send: function(e, t) { | |
function r() { | |
n.src = o + (i ? "&rc=" + i : "") | |
} | |
var n = new Image | |
, i = 0 | |
, o = e + "?" + a.default.stringify(t); | |
return n.addEventListener("error", function() { | |
3 < i || s.default.setTimeout(function() { | |
i++, | |
r() | |
}, 5e3 * i) | |
}), | |
r(), | |
n | |
} | |
}; | |
t.default = l | |
} | |
, function(e, d, p) { | |
(function(u, c) { | |
var h; | |
(function() { | |
"use strict"; | |
function t(e) { | |
return (e = String(e)).charAt(0).toUpperCase() + e.slice(1) | |
} | |
function R(e) { | |
return e = q(e), | |
/^(?:webOS|i(?:OS|P))/.test(e) ? e : t(e) | |
} | |
function N(e, t) { | |
for (var r in e) | |
s.call(e, r) && t(e[r], r, e) | |
} | |
function L(e) { | |
return null == e ? t(e) : G.call(e).slice(8, -1) | |
} | |
function F(e, t) { | |
var r = null != e ? typeof e[t] : "number"; | |
return !(/^(?:boolean|number|string|undefined)$/.test(r) || "object" == r && !e[t]) | |
} | |
function B(e) { | |
return String(e).replace(/([ -])(?!$)/g, "$1?") | |
} | |
function H(r, n) { | |
var i = null; | |
return function(e, t) { | |
var r = -1 | |
, n = e ? e.length : 0; | |
if ("number" == typeof n && -1 < n && n <= o) | |
for (; ++r < n; ) | |
t(e[r], r, e); | |
else | |
N(e, t) | |
}(r, function(e, t) { | |
i = n(i, e, t, r) | |
}), | |
i | |
} | |
function q(e) { | |
return String(e).replace(/^ +| +$/g, "") | |
} | |
var e = { | |
function: !0, | |
object: !0 | |
} | |
, V = e[typeof window] && window || this | |
, W = V | |
, r = e[typeof d] && d | |
, n = e[typeof u] && u && !u.nodeType && u | |
, i = r && n && "object" == typeof c && c; | |
!i || i.global !== i && i.window !== i && i.self !== i || (V = i); | |
var o = Math.pow(2, 53) - 1 | |
, U = /\bOpera/ | |
, z = this | |
, a = Object.prototype | |
, s = a.hasOwnProperty | |
, G = a.toString | |
, l = function e(s) { | |
function t(e) { | |
return H(e, function(e, t) { | |
var r = t.pattern || B(t); | |
return !e && (e = RegExp("\\b" + r + " *\\d+[.\\w_]*", "i").exec(s) || RegExp("\\b" + r + " *\\w+-[\\w]*", "i").exec(s) || RegExp("\\b" + r + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(s)) && ((e = String(t.label && !RegExp(r, "i").test(t.label) ? t.label : e).split("/"))[1] && !/[\d.]+/.test(e[0]) && (e[0] += " " + e[1]), | |
t = t.label || t, | |
e = R(e[0].replace(RegExp(r, "i"), t).replace(RegExp("; *(?:" + t + "[_-])?", "i"), " ").replace(RegExp("(" + t + ")[-_.]?(\\w)", "i"), "$1 $2"))), | |
e | |
}) | |
} | |
function r() { | |
return this.description || "" | |
} | |
var n = V | |
, i = s && "object" == typeof s && "String" != L(s); | |
i && (n = s, | |
s = null); | |
var o = n.navigator || {} | |
, a = o.userAgent || ""; | |
s || (s = a); | |
var l, u, c, h = i || z == W, d = i ? !!o.likeChrome : /\bChrome\b/.test(s) && !/internal|\n/i.test(G.toString()), p = i ? "Object" : "ScriptBridgingProxyObject", f = i ? "Object" : "Environment", v = i && n.java ? "JavaPackage" : L(n.java), y = i ? "Object" : "RuntimeObject", m = /\bJava/.test(v) && n.java, _ = m && L(n.environment) == f, g = m ? "a" : "α", b = m ? "b" : "β", T = n.document || {}, w = n.operamini || n.opera, k = U.test(k = i && w ? w["[[Class]]"] : L(w)) ? k : w = null, S = s, C = [], E = null, x = s == a, j = x && w && "function" == typeof w.version && w.version(), P = H([{ | |
label: "EdgeHTML", | |
pattern: "Edge" | |
}, "Trident", { | |
label: "WebKit", | |
pattern: "AppleWebKit" | |
}, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"], function(e, t) { | |
return e || RegExp("\\b" + (t.pattern || B(t)) + "\\b", "i").exec(s) && (t.label || t) | |
}), O = H(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { | |
label: "Microsoft Edge", | |
pattern: "Edge" | |
}, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { | |
label: "Samsung Internet", | |
pattern: "SamsungBrowser" | |
}, "SeaMonkey", { | |
label: "Silk", | |
pattern: "(?:Cloud9|Silk-Accelerated)" | |
}, "Sleipnir", "SlimBrowser", { | |
label: "SRWare Iron", | |
pattern: "Iron" | |
}, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { | |
label: "Opera Mini", | |
pattern: "OPiOS" | |
}, "Opera", { | |
label: "Opera", | |
pattern: "OPR" | |
}, "Chrome", { | |
label: "Chrome Mobile", | |
pattern: "(?:CriOS|CrMo)" | |
}, { | |
label: "Firefox", | |
pattern: "(?:Firefox|Minefield)" | |
}, { | |
label: "Firefox for iOS", | |
pattern: "FxiOS" | |
}, { | |
label: "IE", | |
pattern: "IEMobile" | |
}, { | |
label: "IE", | |
pattern: "MSIE" | |
}, "Safari"], function(e, t) { | |
return e || RegExp("\\b" + (t.pattern || B(t)) + "\\b", "i").exec(s) && (t.label || t) | |
}), A = t([{ | |
label: "BlackBerry", | |
pattern: "BB10" | |
}, "BlackBerry", { | |
label: "Galaxy S", | |
pattern: "GT-I9000" | |
}, { | |
label: "Galaxy S2", | |
pattern: "GT-I9100" | |
}, { | |
label: "Galaxy S3", | |
pattern: "GT-I9300" | |
}, { | |
label: "Galaxy S4", | |
pattern: "GT-I9500" | |
}, { | |
label: "Galaxy S5", | |
pattern: "SM-G900" | |
}, { | |
label: "Galaxy S6", | |
pattern: "SM-G920" | |
}, { | |
label: "Galaxy S6 Edge", | |
pattern: "SM-G925" | |
}, { | |
label: "Galaxy S7", | |
pattern: "SM-G930" | |
}, { | |
label: "Galaxy S7 Edge", | |
pattern: "SM-G935" | |
}, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { | |
label: "Kindle Fire", | |
pattern: "(?:Cloud9|Silk-Accelerated)" | |
}, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { | |
label: "Wii U", | |
pattern: "WiiU" | |
}, "Wii", "Xbox One", { | |
label: "Xbox 360", | |
pattern: "Xbox" | |
}, "Xoom"]), M = H({ | |
Apple: { | |
iPad: 1, | |
iPhone: 1, | |
iPod: 1 | |
}, | |
Archos: {}, | |
Amazon: { | |
Kindle: 1, | |
"Kindle Fire": 1 | |
}, | |
Asus: { | |
Transformer: 1 | |
}, | |
"Barnes & Noble": { | |
Nook: 1 | |
}, | |
BlackBerry: { | |
PlayBook: 1 | |
}, | |
Google: { | |
"Google TV": 1, | |
Nexus: 1 | |
}, | |
HP: { | |
TouchPad: 1 | |
}, | |
HTC: {}, | |
LG: {}, | |
Microsoft: { | |
Xbox: 1, | |
"Xbox One": 1 | |
}, | |
Motorola: { | |
Xoom: 1 | |
}, | |
Nintendo: { | |
"Wii U": 1, | |
Wii: 1 | |
}, | |
Nokia: { | |
Lumia: 1 | |
}, | |
Samsung: { | |
"Galaxy S": 1, | |
"Galaxy S2": 1, | |
"Galaxy S3": 1, | |
"Galaxy S4": 1 | |
}, | |
Sony: { | |
PlayStation: 1, | |
"PlayStation Vita": 1 | |
} | |
}, function(e, t, r) { | |
return e || (t[A] || t[/^[a-z]+(?: +[a-z]+\b)*/i.exec(A)] || RegExp("\\b" + B(r) + "(?:\\b|\\w*\\d)", "i").exec(s)) && r | |
}), D = H(["Windows Phone", "Android", "CentOS", { | |
label: "Chrome OS", | |
pattern: "CrOS" | |
}, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows "], function(e, t) { | |
var r, n, i, o, a = t.pattern || B(t); | |
return !e && (e = RegExp("\\b" + a + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(s)) && (r = e, | |
n = a, | |
i = t.label || t, | |
o = { | |
"10.0": "10", | |
6.4: "10 Technical Preview", | |
6.3: "8.1", | |
6.2: "8", | |
6.1: "Server 2008 R2 / 7", | |
"6.0": "Server 2008 / Vista", | |
5.2: "Server 2003 / XP 64-bit", | |
5.1: "XP", | |
5.01: "2000 SP1", | |
"5.0": "2000", | |
"4.0": "NT", | |
"4.90": "ME" | |
}, | |
n && i && /^Win/i.test(r) && !/^Windows Phone /i.test(r) && (o = o[/[\d.]+$/.exec(r)]) && (r = "Windows " + o), | |
r = String(r), | |
n && i && (r = r.replace(RegExp(n, "i"), i)), | |
e = r = R(r.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0])), | |
e | |
}); | |
if (P && (P = [P]), | |
M && !A && (A = t([M])), | |
(l = /\bGoogle TV\b/.exec(A)) && (A = l[0]), | |
/\bSimulator\b/i.test(s) && (A = (A ? A + " " : "") + "Simulator"), | |
"Opera Mini" == O && /\bOPiOS\b/.test(s) && C.push("running in Turbo/Uncompressed mode"), | |
"IE" == O && /\blike iPhone OS\b/.test(s) ? (l = e(s.replace(/like iPhone OS/, "")), | |
M = l.manufacturer, | |
A = l.product) : /^iP/.test(A) ? (O || (O = "Safari"), | |
D = "iOS" + ((l = / OS ([\d_]+)/i.exec(s)) ? " " + l[1].replace(/_/g, ".") : "")) : "Konqueror" != O || /buntu/i.test(D) ? M && "Google" != M && (/Chrome/.test(O) && !/\bMobile Safari\b/i.test(s) || /\bVita\b/.test(A)) || /\bAndroid\b/.test(D) && /^Chrome/.test(O) && /\bVersion\//i.test(s) ? (O = "Android Browser", | |
D = /\bAndroid\b/.test(D) ? D : "Android") : "Silk" == O ? (/\bMobi/i.test(s) || (D = "Android", | |
C.unshift("desktop mode")), | |
/Accelerated *= *true/i.test(s) && C.unshift("accelerated")) : "PaleMoon" == O && (l = /\bFirefox\/([\d.]+)\b/.exec(s)) ? C.push("identifying as Firefox " + l[1]) : "Firefox" == O && (l = /\b(Mobile|Tablet|TV)\b/i.exec(s)) ? (D || (D = "Firefox OS"), | |
A || (A = l[1])) : !O || (l = !/\bMinefield\b/i.test(s) && /\b(?:Firefox|Safari)\b/.exec(O)) ? (O && !A && /[\/,]|^[^(]+?\)/.test(s.slice(s.indexOf(l + "/") + 8)) && (O = null), | |
(l = A || M || D) && (A || M || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(D)) && (O = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(D) ? D : l) + " Browser")) : "Electron" == O && (l = (/\bChrome\/([\d.]+)\b/.exec(s) || 0)[1]) && C.push("Chromium " + l) : D = "Kubuntu", | |
j || (c = ["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", B(O), "(?:Firefox|Minefield|NetFront)"], | |
j = H(c, function(e, t) { | |
return e || (RegExp(t + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(s) || 0)[1] || null | |
})), | |
(l = ("iCab" == P && 3 < parseFloat(j) ? "WebKit" : /\bOpera\b/.test(O) && (/\bOPR\b/.test(s) ? "Blink" : "Presto")) || /\b(?:Midori|Nook|Safari)\b/i.test(s) && !/^(?:Trident|EdgeHTML)$/.test(P) && "WebKit" || !P && /\bMSIE\b/i.test(s) && ("Mac OS" == D ? "Tasman" : "Trident") || "WebKit" == P && /\bPlayStation\b(?! Vita\b)/i.test(O) && "NetFront") && (P = [l]), | |
"IE" == O && (l = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(s) || 0)[1]) ? (O += " Mobile", | |
D = "Windows Phone " + (/\+$/.test(l) ? l : l + ".x"), | |
C.unshift("desktop mode")) : /\bWPDesktop\b/i.test(s) ? (O = "IE Mobile", | |
D = "Windows Phone 8.x", | |
C.unshift("desktop mode"), | |
j || (j = (/\brv:([\d.]+)/.exec(s) || 0)[1])) : "IE" != O && "Trident" == P && (l = /\brv:([\d.]+)/.exec(s)) && (O && C.push("identifying as " + O + (j ? " " + j : "")), | |
O = "IE", | |
j = l[1]), | |
x) { | |
if (F(n, "global")) | |
if (m && (l = m.lang.System, | |
S = l.getProperty("os.arch"), | |
D = D || l.getProperty("os.name") + " " + l.getProperty("os.version")), | |
h && F(n, "system") && (l = [n.system])[0]) { | |
D || (D = l[0].os || null); | |
try { | |
l[1] = n.require("ringo/engine").version, | |
j = l[1].join("."), | |
O = "RingoJS" | |
} catch (s) { | |
l[0].global.system == n.system && (O = "Narwhal") | |
} | |
} else | |
"object" == typeof n.process && !n.process.browser && (l = n.process) ? "object" == typeof l.versions ? "string" == typeof l.versions.electron ? (C.push("Node " + l.versions.node), | |
O = "Electron", | |
j = l.versions.electron) : "string" == typeof l.versions.nw && (C.push("Chromium " + j, "Node " + l.versions.node), | |
O = "NW.js", | |
j = l.versions.nw) : (O = "Node.js", | |
S = l.arch, | |
D = l.platform, | |
j = (j = /[\d.]+/.exec(l.version)) ? j[0] : "unknown") : _ && (O = "Rhino"); | |
else | |
L(l = n.runtime) == p ? (O = "Adobe AIR", | |
D = l.flash.system.Capabilities.os) : L(l = n.phantom) == y ? (O = "PhantomJS", | |
j = (l = l.version || null) && l.major + "." + l.minor + "." + l.patch) : "number" == typeof T.documentMode && (l = /\bTrident\/(\d+)/i.exec(s)) ? (j = [j, T.documentMode], | |
(l = +l[1] + 4) != j[1] && (C.push("IE " + j[1] + " mode"), | |
P && (P[1] = ""), | |
j[1] = l), | |
j = "IE" == O ? String(j[1].toFixed(1)) : j[0]) : "number" == typeof T.documentMode && /^(?:Chrome|Firefox)\b/.test(O) && (C.push("masking as " + O + " " + j), | |
O = "IE", | |
j = "11.0", | |
P = ["Trident"], | |
D = "Windows"); | |
D = D && R(D) | |
} | |
if (j && (l = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(j) || /(?:alpha|beta)(?: ?\d)?/i.exec(s + ";" + (x && o.appMinorVersion)) || /\bMinefield\b/i.test(s) && "a") && (E = /b/i.test(l) ? "beta" : "alpha", | |
j = j.replace(RegExp(l + "\\+?$"), "") + ("beta" == E ? b : g) + (/\d+\+?/.exec(l) || "")), | |
"Fennec" == O || "Firefox" == O && /\b(?:Android|Firefox OS)\b/.test(D)) | |
O = "Firefox Mobile"; | |
else if ("Maxthon" == O && j) | |
j = j.replace(/\.[\d.]+/, ".x"); | |
else if (/\bXbox\b/i.test(A)) | |
"Xbox 360" == A && (D = null), | |
"Xbox 360" == A && /\bIEMobile\b/.test(s) && C.unshift("mobile mode"); | |
else if (!/^(?:Chrome|IE|Opera)$/.test(O) && (!O || A || /Browser|Mobi/.test(O)) || "Windows CE" != D && !/Mobi/i.test(s)) | |
if ("IE" == O && x) | |
try { | |
null === n.external && C.unshift("platform preview") | |
} catch (s) { | |
C.unshift("embedded") | |
} | |
else | |
(/\bBlackBerry\b/.test(A) || /\bBB10\b/.test(s)) && (l = (RegExp(A.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(s) || 0)[1] || j) ? (l = [l, /BB10/.test(s)], | |
D = (l[1] ? (A = null, | |
M = "BlackBerry") : "Device Software") + " " + l[0], | |
j = null) : this != N && "Wii" != A && (x && w || /Opera/.test(O) && /\b(?:MSIE|Firefox)\b/i.test(s) || "Firefox" == O && /\bOS X (?:\d+\.){2,}/.test(D) || "IE" == O && (D && !/^Win/.test(D) && 5.5 < j || /\bWindows XP\b/.test(D) && 8 < j || 8 == j && !/\bTrident\b/.test(s))) && !U.test(l = e.call(N, s.replace(U, "") + ";")) && l.name && (l = "ing as " + l.name + ((l = l.version) ? " " + l : ""), | |
U.test(O) ? (/\bIE\b/.test(l) && "Mac OS" == D && (D = null), | |
l = "identify" + l) : (l = "mask" + l, | |
O = k ? R(k.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", | |
/\bIE\b/.test(l) && (D = null), | |
x || (j = null)), | |
P = ["Presto"], | |
C.push(l)); | |
else | |
O += " Mobile"; | |
(l = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(s) || 0)[1]) && (l = [parseFloat(l.replace(/\.(\d)$/, ".0$1")), l], | |
"Safari" == O && "+" == l[1].slice(-1) ? (O = "WebKit Nightly", | |
E = "alpha", | |
j = l[1].slice(0, -1)) : j != l[1] && j != (l[2] = (/\bSafari\/([\d.]+\+?)/i.exec(s) || 0)[1]) || (j = null), | |
l[1] = (/\bChrome\/([\d.]+)/i.exec(s) || 0)[1], | |
537.36 == l[0] && 537.36 == l[2] && 28 <= parseFloat(l[1]) && "WebKit" == P && (P = ["Blink"]), | |
l = x && (d || l[1]) ? (P && (P[1] = "like Chrome"), | |
l[1] || ((l = l[0]) < 530 ? 1 : l < 532 ? 2 : l < 532.05 ? 3 : l < 533 ? 4 : l < 534.03 ? 5 : l < 534.07 ? 6 : l < 534.1 ? 7 : l < 534.13 ? 8 : l < 534.16 ? 9 : l < 534.24 ? 10 : l < 534.3 ? 11 : l < 535.01 ? 12 : l < 535.02 ? "13+" : l < 535.07 ? 15 : l < 535.11 ? 16 : l < 535.19 ? 17 : l < 536.05 ? 18 : l < 536.1 ? 19 : l < 537.01 ? 20 : l < 537.11 ? "21+" : l < 537.13 ? 23 : l < 537.18 ? 24 : l < 537.24 ? 25 : l < 537.36 ? 26 : "Blink" != P ? "27" : "28")) : (P && (P[1] = "like Safari"), | |
(l = l[0]) < 400 ? 1 : l < 500 ? 2 : l < 526 ? 3 : l < 533 ? 4 : l < 534 ? "4+" : l < 535 ? 5 : l < 537 ? 6 : l < 538 ? 7 : l < 601 ? 8 : "8"), | |
P && (P[1] += " " + (l += "number" == typeof l ? ".x" : /[.+]/.test(l) ? "" : "+")), | |
"Safari" == O && (!j || 45 < parseInt(j)) && (j = l)), | |
"Opera" == O && (l = /\bzbov|zvav$/.exec(D)) ? (O += " ", | |
C.unshift("desktop mode"), | |
"zvav" == l ? (O += "Mini", | |
j = null) : O += "Mobile", | |
D = D.replace(RegExp(" *" + l + "$"), "")) : "Safari" == O && /\bChrome\b/.exec(P && P[1]) && (C.unshift("desktop mode"), | |
O = "Chrome Mobile", | |
j = null, | |
D = /\bOS X\b/.test(D) ? (M = "Apple", | |
"iOS 4.3+") : null), | |
j && 0 == j.indexOf(l = /[\d.]+$/.exec(D)) && -1 < s.indexOf("/" + l + "-") && (D = q(D.replace(l, ""))), | |
P && !/\b(?:Avant|Nook)\b/.test(O) && (/Browser|Lunascape|Maxthon/.test(O) || "Safari" != O && /^iOS/.test(D) && /\bSafari\b/.test(P[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(O) && P[1]) && (l = P[P.length - 1]) && C.push(l), | |
C.length && (C = ["(" + C.join("; ") + ")"]), | |
M && A && A.indexOf(M) < 0 && C.push("on " + M), | |
A && C.push((/^on /.test(C[C.length - 1]) ? "" : "on ") + A), | |
D && (l = / ([\d.+]+)$/.exec(D), | |
u = l && "/" == D.charAt(D.length - l[0].length - 1), | |
D = { | |
architecture: 32, | |
family: l && !u ? D.replace(l[0], "") : D, | |
version: l ? l[1] : null, | |
toString: function() { | |
var e = this.version; | |
return this.family + (e && !u ? " " + e : "") + (64 == this.architecture ? " 64-bit" : "") | |
} | |
}), | |
(l = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(S)) && !/\bi686\b/i.test(S) ? (D && (D.architecture = 64, | |
D.family = D.family.replace(RegExp(" *" + l), "")), | |
O && (/\bWOW64\b/i.test(s) || x && /\w(?:86|32)$/.test(o.cpuClass || o.platform) && !/\bWin64; x64\b/i.test(s)) && C.unshift("32-bit")) : D && /^OS X/.test(D.family) && "Chrome" == O && 39 <= parseFloat(j) && (D.architecture = 64), | |
s || (s = null); | |
var I = {}; | |
return I.description = s, | |
I.layout = P && P[0], | |
I.manufacturer = M, | |
I.name = O, | |
I.prerelease = E, | |
I.product = A, | |
I.ua = s, | |
I.version = O && j, | |
I.os = D || { | |
architecture: null, | |
family: null, | |
version: null, | |
toString: function() { | |
return "null" | |
} | |
}, | |
I.parse = e, | |
I.toString = r, | |
I.version && C.unshift(j), | |
I.name && C.unshift(O), | |
D && O && (D != String(D).split(" ")[0] || D != O.split(" ")[0] && !A) && C.push(A ? "(" + D + ")" : "on " + D), | |
C.length && (I.description = C.join(" ")), | |
I | |
}(); | |
V.platform = l, | |
void 0 !== (h = function() { | |
return l | |
} | |
.call(d, p, d, u)) && (u.exports = h) | |
} | |
).call(this) | |
} | |
).call(d, p(11)(e), p(5)) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function() { | |
function e(e, t) { | |
var r = t.request_start | |
, n = t.request_response_start | |
, i = t.request_response_end | |
, o = t.request_bytes_loaded; | |
d++; | |
var a = n - r | |
, s = i - n; | |
if (0 < a && 0 < s && 0 < o) { | |
var l = o / s * 8e3; | |
p++, | |
u += a, | |
c += o, | |
h += s, | |
this.data.view_min_request_throughput = Math.min(this.data.view_min_request_throughput || 1 / 0, l), | |
this.data.view_average_request_throughput = c / h * 8e3, | |
this.data.view_max_request_latency = Math.max(this.data.view_max_request_latency || 0, a), | |
this.data.view_average_request_latency = u / p, | |
this.data.view_request_count = d | |
} | |
} | |
function t(e, t) { | |
d++, | |
n++, | |
this.data.view_request_count = d, | |
this.data.view_request_failed_count = n | |
} | |
function r(e, t) { | |
d++, | |
i++, | |
this.data.view_request_count = d, | |
this.data.view_request_canceled_count = i | |
} | |
var u = 0 | |
, c = 0 | |
, h = 0 | |
, d = 0 | |
, p = 0 | |
, n = 0 | |
, i = 0; | |
this.on("requestcompleted", e), | |
this.on("requestfailed", t), | |
this.on("requestcanceled", r) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var d = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
}; | |
t.default = function(a, e, r) { | |
var t = (0, | |
f.findMediaElement)(e) | |
, n = d(t, 3) | |
, s = n[0] | |
, i = n[1] | |
, o = n[2] | |
, l = a.log | |
, u = a.utils.getComputedStyle | |
, c = a.utils.secondsToMs | |
, h = { | |
automaticErrorTracking: !0 | |
}; | |
return s ? "video" !== o && "audio" !== o ? l.error("The element of `" + i + "` was not a media element.") : ((r = (0, | |
p.default)(h, r)).data = (0, | |
p.default)({ | |
player_software: "HTML5 Video Element", | |
player_software_version: "No Versions", | |
player_mux_plugin_name: "VideoElementMonitor", | |
player_mux_plugin_version: "2.7.0" | |
}, r.data), | |
r.getPlayheadTime = function() { | |
return c(s.currentTime) | |
} | |
, | |
r.getStateData = function() { | |
return { | |
player_is_paused: s.paused, | |
player_playhead_time: c(s.currentTime), | |
player_width: parseInt(u(s, "width")), | |
player_height: parseInt(u(s, "height")), | |
player_autoplay_on: s.autoplay, | |
player_preload_on: s.preload, | |
video_poster_url: s.poster, | |
video_source_url: s.currentSrc, | |
video_source_duration: c(s.duration), | |
video_source_height: s.videoHeight, | |
video_source_width: s.videoWidth | |
} | |
} | |
, | |
s.mux = s.mux || {}, | |
s.mux.emit = function(e, t) { | |
a.emit(i, e, t) | |
} | |
, | |
s.mux.destroy = function() { | |
Object.keys(s.mux.listeners).forEach(function(e) { | |
s.removeEventListener(e, s.mux.listeners[e], !1) | |
}), | |
delete s.mux.listeners, | |
a.emit(i, "destroy") | |
} | |
, | |
s.mux.swapElement = function(e) { | |
var t = (0, | |
f.findMediaElement)(e) | |
, r = d(t, 3) | |
, n = r[0] | |
, i = r[1] | |
, o = r[2]; | |
return n ? "video" !== o && "audio" !== o ? a.log.error("The element of `" + i + "` was not a media element.") : (n.muxId = s.muxId, | |
delete s.muxId, | |
n.mux = n.mux || {}, | |
n.mux.listeners = (0, | |
p.default)({}, s.mux.listeners), | |
delete s.mux.listeners, | |
Object.keys(n.mux.listeners).forEach(function(e) { | |
s.removeEventListener(e, n.mux.listeners[e], !1), | |
n.addEventListener(e, n.mux.listeners[e], !1) | |
}), | |
n.mux.swapElement = s.mux.swapElement, | |
n.mux.destroy = s.mux.destroy, | |
delete s.mux, | |
void (s = n)) : a.log.error("No element was found with the `" + i + "` query selector.") | |
} | |
, | |
s.mux.addHLSJS = function(e) { | |
a.addHLSJS(i, e) | |
} | |
, | |
s.mux.addDashJS = function(e) { | |
a.addDashJS(i, e) | |
} | |
, | |
s.mux.removeHLSJS = function() { | |
a.removeHLSJS(i) | |
} | |
, | |
s.mux.removeDashJS = function() { | |
a.removeDashJS(i) | |
} | |
, | |
a.init(i, r), | |
a.emit(i, "playerready"), | |
s.paused || (a.emit(i, "play"), | |
2 < s.readyState && a.emit(i, "playing")), | |
s.mux.listeners = {}, | |
void v.forEach(function(t) { | |
("error" !== t || r.automaticErrorTracking) && (s.mux.listeners[t] = function() { | |
var e = {}; | |
"error" === t && (e.player_error_code = s.error && s.error.code, | |
e.player_error_message = s.error && y[s.error.code]), | |
a.emit(i, t, e) | |
} | |
, | |
s.addEventListener(t, s.mux.listeners[t], !1)) | |
})) : l.error("No element was found with the `" + i + "` query selector.") | |
} | |
; | |
var n, i = r(0), p = (n = i) && n.__esModule ? n : { | |
default: n | |
}, f = r(8), v = ["loadstart", "pause", "play", "playing", "seeking", "seeked", "timeupdate", "ratechange", "stalled", "waiting", "error", "ended"], y = { | |
1: "MEDIA_ERR_ABORTED", | |
2: "MEDIA_ERR_NETWORK", | |
3: "MEDIA_ERR_DECODE", | |
4: "MEDIA_ERR_SRC_NOT_SUPPORTED" | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var i = r(50) | |
, o = n(i) | |
, a = r(1) | |
, s = n(a) | |
, l = r(51) | |
, u = n(l) | |
, c = r(52) | |
, h = n(c) | |
, d = r(0) | |
, p = n(d) | |
, f = r(7) | |
, v = n(f) | |
, y = r(4) | |
, m = {}; | |
m.safeCall = o.default, | |
m.safeIncrement = s.default, | |
m.getComputedStyle = u.default, | |
m.secondsToMs = h.default, | |
m.assign = p.default, | |
m.headersStringToObject = v.default, | |
m.extractHostnameAndDomain = y.extractHostnameAndDomain, | |
t.default = m | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e, t, r, n) { | |
var i = n; | |
if (e && "function" == typeof e[t]) | |
try { | |
i = e[t].apply(e, r) | |
} catch (e) { | |
o.default.info("safeCall error", e) | |
} | |
return i | |
} | |
; | |
var n, i = r(3), o = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e, t) { | |
if (o.default.defaultView && o.default.defaultView.getComputedStyle) | |
return o.default.defaultView.getComputedStyle(e, null).getPropertyValue(t) | |
} | |
; | |
var n, i = r(10), o = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(e) { | |
return Math.floor(1e3 * e) | |
} | |
} | |
]) | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(o, a) { | |
var r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : [] | |
, e = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : [] | |
, s = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : function() { | |
return {} | |
} | |
, l = !1; | |
o.on("adstart", function() { | |
l = !0 | |
}), | |
o.on("adend", function() { | |
l = !1 | |
}), | |
o.on("adserror", function() { | |
l = !1 | |
}); | |
var t = function() { | |
var i = u(a.currentTime()) | |
, e = function e() { | |
var t = Date.now() | |
, r = u(a.currentTime()); | |
if (l) { | |
if (i < r) { | |
var n = s(); | |
n.viewer_time = t - Math.max(0, r - i), | |
a.off("timeupdate", e), | |
o.mux.emit("adplaying", n) | |
} | |
} else | |
a.off("timeupdate", e) | |
}; | |
a.on("timeupdate", e); | |
var t = function t() { | |
a.off("timeupdate", e), | |
r.forEach(function(e) { | |
a.off(e, t) | |
}) | |
}; | |
r.forEach(function(e) { | |
a.on(e, t) | |
}) | |
}; | |
e.forEach(function(e) { | |
a.on(e, t) | |
}) | |
} | |
; | |
var n, i = r(0), o = (n = i) && n.__esModule ? n : { | |
default: n | |
}, u = o.default.utils.secondsToMs | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function n(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
var i = r(3) | |
, s = n(i) | |
, o = r(0) | |
, l = n(o) | |
, a = r(4) | |
, u = n(a) | |
, c = r(6) | |
, h = n(c) | |
, d = r(7) | |
, p = n(d) | |
, f = r(8) | |
, v = n(f) | |
, y = r(9) | |
, m = n(y) | |
, _ = r(10) | |
, g = n(_) | |
, b = l.default.log | |
, T = l.default.utils.assign | |
, w = l.default.utils.safeCall | |
, k = l.default.utils.getComputedStyle | |
, S = l.default.utils.secondsToMs | |
, C = ["loadstart", "pause", "play", "playing", "seeking", "seeked", "timeupdate", "ratechange", "stalled", "waiting", "error", "ended"]; | |
(s.default.registerPlugin || s.default.plugin || function() { | |
l.default.log.error("No valid method to register videojs plugin available.") | |
} | |
)("mux", function(e) { | |
if (s.default.IS_IE8) | |
return !1; | |
var n = this | |
, r = n.id(); | |
(e = T({ | |
automaticErrorTracking: !0 | |
}, e)).data = T({ | |
player_software_name: "Video.js", | |
player_software_version: s.default.VERSION || "< 4.11", | |
player_mux_plugin_name: "videojs-mux", | |
player_mux_plugin_version: "2.5.0" | |
}, e.data), | |
e.getPlayheadTime = function() { | |
return S(n.currentTime()) | |
} | |
, | |
e.getStateData = function() { | |
var e = w(n, "videoHeight") | |
, t = w(n, "videoWidth"); | |
if (void 0 === t || void 0 === e) { | |
var r = n.el().firstChild; | |
r && "VIDEO" === r.nodeName.toUpperCase() && (e = r.videoHeight, | |
t = r.videoWidth) | |
} | |
return { | |
player_is_paused: w(n, "paused"), | |
player_is_fullscreen: w(n, "isFullscreen"), | |
player_autoplay_on: !!w(n, "autoplay"), | |
player_preload_on: w(n, "preload"), | |
player_width: k(n.el(), "width"), | |
player_height: k(n.el(), "height"), | |
player_language_code: w(n, "language"), | |
video_poster_url: w(n, "poster"), | |
video_source_url: w(n, "currentSrc"), | |
video_source_mime_type: w(n, "currentType"), | |
video_source_duration: S(w(n, "duration") || 0), | |
video_source_height: e, | |
video_source_width: t | |
} | |
} | |
, | |
n.mux = function() { | |
b.error("[videojs-mux] The plugin was initialized more than once.") | |
} | |
, | |
n.mux.emit = function(e, t) { | |
l.default.emit(r, e, t) | |
} | |
, | |
n.mux.log = b, | |
n.mux.utils = l.default.utils, | |
l.default.init(r, e); | |
var t = !1 | |
, i = function() { | |
t || n.mux.emit("playerready"), | |
t = !0 | |
}; | |
n.ready(function() { | |
n.addClass("vjs-mux"), | |
u.default.setTimeout(i, 0) | |
}); | |
var o = !1; | |
n.one("play", i), | |
C.forEach(function(r) { | |
("error" !== r || e.automaticErrorTracking) && n.on(r, function() { | |
if (!o) { | |
var e = {}; | |
if ("error" === r) { | |
var t = w(n, "error"); | |
e.player_error_code = t && t.code, | |
e.player_error_message = t && t.message | |
} | |
n.mux.emit(r, e) | |
} | |
}) | |
}); | |
var a = !1; | |
n.on("play", function() { | |
a = !0 | |
}), | |
n.on("pause", function() { | |
a = !1 | |
}), | |
n.on("adstart", function() { | |
o = !0, | |
a && n.mux.emit("pause"), | |
n.mux.emit("adbreakstart") | |
}), | |
n.on("adend", function() { | |
n.mux.emit("adbreakend"), | |
o = !1, | |
w(n, "paused") || (n.mux.emit("play"), | |
a = !0, | |
n.onceux && n.mux.emit("playing")) | |
}), | |
n.ima && (0, | |
h.default)(n), | |
n.onceux && (0, | |
m.default)(n), | |
n.ima3 && "function" == typeof n.ima3.ready && (0, | |
p.default)(n), | |
n.FreeWheelPlugin && n.FreeWheelPlugin.VERSION && (0, | |
v.default)(n), | |
n.on("dispose", function() { | |
n.mux.emit("destroy") | |
}) | |
}), | |
(0, | |
g.default)(s.default) | |
} | |
, function(e, t) { | |
e.exports = W1 | |
} | |
, function(r, e, t) { | |
(function(e) { | |
var t; | |
t = "undefined" != typeof window ? window : void 0 !== e ? e : "undefined" != typeof self ? self : {}, | |
r.exports = t | |
} | |
).call(e, t(5)) | |
} | |
, function(Jua, Kua) { | |
var Lua; | |
Lua = function() { | |
return this | |
}(); | |
try { | |
Lua = Lua || Function("return this")() || eval("this") | |
} catch (Jua) { | |
"object" == typeof window && (Lua = window) | |
} | |
Jua.exports = Lua | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(a) { | |
var r = function(e) { | |
var t = "function" == typeof (e = e || {}).getAdData ? e.getAdData() : {} | |
, r = "function" == typeof e.getAd ? e.getAd() : {} | |
, n = "function" == typeof r.getMediaUrl ? r.getMediaUrl() : t.mediaUrl | |
, i = a.ima.settings || {} | |
, o = {}; | |
return n && (o.ad_asset_url = n), | |
i.adTagUrl && (o.ad_tag_url = i.adTagUrl), | |
o | |
} | |
, t = void 0 | |
, n = void 0 | |
, i = void 0 | |
, o = void 0 | |
, s = void 0 | |
, l = void 0; | |
try { | |
var e = window.google.ima.AdEvent.Type; | |
t = e.LOADED, | |
n = e.STARTED, | |
i = e.COMPLETE, | |
o = e.PAUSED, | |
s = e.RESUMED, | |
l = e.SKIPPED | |
} catch (a) { | |
t = "loaded", | |
n = "start", | |
i = "complete", | |
o = "pause", | |
s = "resume", | |
l = "skip" | |
} | |
var u = 0; | |
a.mux.triggerAdRequest = function() { | |
u++, | |
a.mux.emit("adrequest", r()) | |
} | |
, | |
a.on("adsready", function() { | |
var e = a.ima.addEventListener || function() {} | |
; | |
e(t, function(e) { | |
var t = r(e); | |
0 < u && (u--, | |
a.mux.emit("adresponse", t)), | |
a.mux.emit("adplay", t) | |
}), | |
e(n, function(e) { | |
var t = r(e); | |
a.mux.emit("adplaying", t) | |
}), | |
e(s, function(e) { | |
var t = r(e); | |
a.mux.emit("adplay", t), | |
a.mux.emit("adplaying", t) | |
}), | |
e(o, function(e) { | |
var t = r(e); | |
a.mux.emit("adpause", t) | |
}), | |
e(i, function(e) { | |
var t = r(e); | |
a.mux.emit("adended", t) | |
}), | |
e(l, function(e) { | |
var t = r(e); | |
a.mux.emit("adended", t) | |
}), | |
a.on("adserror", function() { | |
0 < u && (u--, | |
a.mux.emit("adresponse")), | |
a.mux.emit("aderror") | |
}) | |
}) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
function i(e) { | |
if ("string" != typeof e) | |
return !1; | |
var t = e.split(".").map(function(e) { | |
return parseInt(e) | |
}) | |
, r = t[0] | |
, n = t[1]; | |
return 2 < r || 2 === r && 3 <= n | |
} | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.brightcoveImaAdsEventsSupported = i, | |
t.default = function(n) { | |
var r = function() { | |
var e = n.ima3.currentAd | |
, t = n.ima3.settings | |
, r = {}; | |
return e && (r.ad_asset_url = e.mediaUrl), | |
t && (r.ad_tag_url = t.serverUrl), | |
r | |
}; | |
if (i(n.ima3.version)) { | |
var e = 0 | |
, t = function() { | |
0 < e && (e--, | |
n.mux.emit("adresponse", r())) | |
}; | |
n.on("ads-request", function() { | |
e++, | |
n.mux.emit("adrequest", r()) | |
}), | |
n.on("ads-load", function() { | |
t(), | |
n.mux.emit("adplay", r()) | |
}), | |
n.on("adserror", function() { | |
t(), | |
n.mux.emit("aderror") | |
}), | |
n.on("ads-play", function() { | |
n.mux.emit("adplay", r()) | |
}), | |
n.on("ads-pause", function() { | |
n.mux.emit("adpause", r()) | |
}), | |
n.on("ads-ad-ended", function() { | |
n.mux.emit("adended", r()) | |
}) | |
} | |
n.ima3.ready(function() { | |
if (n.ima3.adPlayer) { | |
i(n.ima3.version) || (n.ima3.adPlayer.on("play", function() { | |
n.mux.emit("adplay") | |
}), | |
n.ima3.adPlayer.on("pause", function() { | |
n.mux.emit("adpause") | |
}), | |
n.ima3.adPlayer.on("ended", function() { | |
n.mux.emit("adended") | |
})); | |
var e = ["pause", "ended", "adserror"] | |
, t = ["play"]; | |
(0, | |
a.default)(n, n.ima3.adPlayer, e, t, r) | |
} else | |
n.mux.log("Legacy IMA3 plugin found, ad events may not track correctly."), | |
n.on("ads-ad-started", function() { | |
n.mux.emit("adplaying", r()) | |
}), | |
n.on("ads-play", function() { | |
n.mux.emit("adplaying", r()) | |
}) | |
}) | |
} | |
; | |
var n, o = r(1), a = (n = o) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(n) { | |
var e = function(e) { | |
var t = n.FreeWheelPlugin | |
, r = {}; | |
switch (e) { | |
case "adplay": | |
case "adplaying": | |
case "adpause": | |
r.ad_asset_url = n.currentSrc() | |
} | |
return t && (r.ad_tag_url = "html5" === t.tech.toLowerCase() ? t.settings.Html5.serverUrl : t.settings.Flash.serverUrl), | |
r | |
}; | |
n.on("ads-request", function() { | |
n.mux.emit("adrequest", e("adrequest")) | |
}), | |
n.on("ads-load", function() { | |
n.mux.emit("adresponse", e("adresponse")) | |
}), | |
n.on("adserror", function() { | |
n.mux.emit("aderror") | |
}), | |
n.on("ads-ad-started", function() { | |
n.mux.emit("adplay", e("adplay")), | |
n.mux.emit("adplaying", e("adplaying")) | |
}), | |
n.on("ads-play", function() { | |
n.mux.emit("adplay", e("adplay")), | |
n.mux.emit("adplaying", e("adplaying")) | |
}), | |
n.on("ads-pause", function() { | |
n.mux.emit("adpause", e("adpause")) | |
}), | |
n.on("ads-ad-ended", function() { | |
n.mux.emit("adended", e("adended")) | |
}), | |
n.on("adend", function() { | |
n.mux.emit("play") | |
}) | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(t) { | |
var e = ["onceux-linearad-pause", "onceux-linearad-skipped", "onceux-linearad-complete", "adserror"] | |
, r = ["adstart", "onceux-linearad-resume"]; | |
(0, | |
o.default)(t, t, e, r), | |
t.on("adstart", function() { | |
t.mux.emit("adplay") | |
}), | |
t.on("onceux-linearad-start", function(e) { | |
e.linearAd && 0 < e.linearAd.index && (t.mux.emit("adplay"), | |
t.mux.emit("adplaying")) | |
}), | |
t.on("onceux-linearad-resume", function() { | |
t.mux.emit("adplay") | |
}), | |
t.on("onceux-linearad-pause", function() { | |
t.mux.emit("adpause") | |
}), | |
t.on("onceux-linearad-complete", function() { | |
t.mux.emit("adended") | |
}), | |
t.on("onceux-linearad-skipped", function() { | |
t.mux.emit("adended") | |
}) | |
} | |
; | |
var n, i = r(1), o = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(o) { | |
if (!s && "function" == typeof o.getTech) { | |
for (var e = o.getTech("Html5") || {}, r = e.sourceHandlers, t = 0; t < r.length; t++) | |
!function(e) { | |
var t = r[e] | |
, i = t.handleSource; | |
t.handleSource = function(e, t) { | |
var r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {} | |
, n = i(e, t, r); | |
if (n && "function" == typeof n.xhr) | |
try { | |
(0, | |
a.default)(o(n.player_.el_.parentNode.id), n.xhr) | |
} catch (e) {} | |
return n | |
} | |
}(t); | |
s = !0 | |
} | |
} | |
; | |
var n, i = r(11), a = (n = i) && n.__esModule ? n : { | |
default: n | |
}, s = !1 | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}), | |
t.default = function(s, e) { | |
var r, n = function(a) { | |
return function(e) { | |
var t, r, n, i, o = Date.now(); | |
try { | |
a(e) | |
} catch (e) {} | |
try { | |
e.onreadystatechange = (r = o, | |
n = (t = e).onreadystatechange || function() {} | |
, | |
i = (0, | |
l.default)(s, t, r), | |
function() { | |
try { | |
i() | |
} catch (e) {} | |
try { | |
n() | |
} catch (e) {} | |
} | |
) | |
} catch (e) {} | |
} | |
}; | |
e.beforeRequest = (r = e.beforeRequest || function(e) { | |
return e | |
} | |
, | |
function(e) { | |
var t = r(e); | |
return t.beforeSend = n(t.beforeSend || function() {} | |
), | |
t | |
} | |
) | |
} | |
; | |
var n, i = r(12), l = (n = i) && n.__esModule ? n : { | |
default: n | |
} | |
} | |
, function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var y = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
}; | |
t.default = function(c, h, d) { | |
var p = c.mux.utils.extractHostnameAndDomain | |
, f = c.mux.utils.headersStringToObject | |
, v = 0; | |
return function() { | |
var e, t = h.readyState; | |
if (2 <= t) { | |
if (v = v || Date.now(), | |
4 !== t) | |
return; | |
if (200 <= h.status && h.status < 300) { | |
var r = Date.now() | |
, n = "arraybuffer" === h.responseType ? h.response.byteLength : h.responseText.length | |
, i = p(h.responseURL) | |
, o = y(i, 1) | |
, a = o[0] | |
, s = f(h.getAllResponseHeaders ? h.getAllResponseHeaders() : "") | |
, l = (e = s["content-type"]) ? e.match(/^audio\/mpegurl/i) ? "manifest" : e.match(/^audio.*/i) ? "audio" : e.match(/^video.*/) ? "video" : e.match(/^application\/x-mpegurl/i) ? "manifest" : e.match(/^application\/vnd.apple.mpegurl/i) ? "manifest" : e.match(/^application\/dash+xml/i) ? "manifest" : "unknown" : "unknown" | |
, u = { | |
request_start: d, | |
request_response_start: v, | |
request_response_end: r, | |
request_bytes_loaded: n, | |
request_hostname: a, | |
request_response_headers: s, | |
request_type: l | |
}; | |
c.mux.emit("requestcompleted", u) | |
} else | |
c.mux.emit("requestfailed") | |
} | |
} | |
} | |
} | |
])) | |
}, | |
"./node_modules/videojs-sneakpeek/dist/videojs-sneakpeek.min.js": function(e, t, r) { | |
"use strict"; | |
Object.defineProperty(t, "__esModule", { | |
value: !0 | |
}); | |
var n = Object.assign || function(e) { | |
for (var t = 1; t < arguments.length; t++) { | |
var r = arguments[t]; | |
for (var n in r) | |
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]) | |
} | |
return e | |
} | |
, S = function(e, t) { | |
if (Array.isArray(e)) | |
return e; | |
if (Symbol.iterator in Object(e)) | |
return function(e, t) { | |
var r = [] | |
, n = !0 | |
, i = !1 | |
, o = void 0; | |
try { | |
for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (r.push(a.value), | |
!t || r.length !== t); n = !0) | |
; | |
} catch (e) { | |
i = !0, | |
o = e | |
} finally { | |
try { | |
!n && s.return && s.return() | |
} finally { | |
if (i) | |
throw o | |
} | |
} | |
return r | |
}(e, t); | |
throw new TypeError("Invalid attempt to destructure non-iterable instance") | |
}; | |
t.enablePlugin = function(e, t) { | |
(i.default.registerPlugin || i.default.plugin)(e, t) | |
} | |
, | |
t.default = function(e) { | |
a.basePath = e.basePath || a.basePath; | |
var T = n({}, a, e) | |
, w = this | |
, o = [] | |
, k = void 0; | |
function t() { | |
if (!k) { | |
for (var e = 0; e < o.length; e++) | |
if ("metadata" === o[e].kind && "sneakpeek" === o[e].label) { | |
(k = o[e]).mode = "hidden"; | |
break | |
} | |
if (k) { | |
if (-1 !== navigator.userAgent.toLowerCase().indexOf("android")) { | |
var t = w.controlBar.progressControl | |
, r = function() { | |
t.removeClass("fake-active") | |
}; | |
t.on("touchstart", function() { | |
t.addClass("fake-active") | |
}), | |
t.on("touchend", r), | |
t.on("touchcancel", r) | |
} | |
var m = document.createElement("div"); | |
m.className = "vjs-sneakpeek-holder"; | |
var _ = document.createElement("img"); | |
m.appendChild(_), | |
_.className = "vjs-sneakpeek"; | |
var g = w.duration(); | |
w.on("durationchange", function() { | |
g = w.duration() | |
}), | |
w.on("loadedmetadata", function() { | |
g = w.duration() | |
}); | |
var b = w.controlBar.progressControl; | |
b.el().appendChild(m), | |
b.on("mousemove", n), | |
b.on("touchmove", n), | |
b.on("mouseout", i), | |
b.on("touchcancel", i), | |
b.on("touchend", i), | |
w.on("userinactive", i) | |
} | |
} | |
function n(e) { | |
var t = function() { | |
if (C.default.pageXOffset) | |
return { | |
x: C.default.pageXOffset, | |
y: C.default.pageYOffset | |
}; | |
return { | |
x: document.documentElement.scrollLeft, | |
y: document.documentElement.scrollTop | |
} | |
}().x | |
, r = E(b.el()).getBoundingClientRect() | |
, n = e.pageX; | |
e.changedTouches && (n = e.changedTouches[0].pageX); | |
var i = (r.width || r.right) + t | |
, o = n || e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; | |
o -= E(b.el()).getBoundingClientRect().left + t; | |
for (var a = Math.floor(o / b.width() * g), s = k && k.cues.length, l = 0, u = void 0; l < s; ) { | |
var c = k.cues[l]; | |
if (c.startTime <= a && c.endTime >= a) { | |
u = x(c.text); | |
break | |
} | |
l++ | |
} | |
if (void 0 !== u) { | |
if (u.src && _.src !== u.src) { | |
var h = ""; | |
"/" === u.src[0] && (h = (h = w.currentSrc()).substring(0, h.lastIndexOf("/"))), | |
_.src = h + u.src + (d = T.urlParams, | |
"" === (p = Object.entries(d).map(function(e) { | |
var t = S(e, 2) | |
, r = t[0] | |
, n = t[1]; | |
return r + "=" + n | |
}).join("&")) ? "" : "?" + p) | |
} | |
var d, p; | |
u.w = u.w || T.width, | |
u.h = u.h || T.height, | |
m.style.width === u.w && m.style.height === u.h || (m.style.width = u.w + "px", | |
m.style.height = u.h + "px"), | |
_.style.left = -u.x + "px", | |
_.style.top = -u.y + "px"; | |
var f = [u.y, u.w + u.x, u.y + u.h, u.x]; | |
_.style.clip = "rect(" + f.join("px,") + "px)"; | |
var v = u.w | |
, y = v / 2; | |
i < o + y ? o = i - v : o < y ? o = 0 : o -= y, | |
m.style.left = o + "px" | |
} | |
} | |
function i() { | |
m.style.left = "-1000px" | |
} | |
} | |
w.ready(function() { | |
o = w.remoteTextTracks(), | |
t(), | |
k || o.addEventListener("addtrack", t) | |
}) | |
} | |
; | |
var i = o(r("./node_modules/video.js/dist/video.cjs.js")) | |
, C = o(r("./node_modules/global/window.js")); | |
function o(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
var a = { | |
width: 0, | |
height: 0, | |
basePath: "", | |
urlParams: {} | |
}; | |
function E(e) { | |
return "HTML" !== e.nodeName && "static" === (r = e, | |
t = "position", | |
C.default.getComputedStyle ? C.default.getComputedStyle(r, n)[t] : r.currentStyle[t]) ? E(e.offsetParent) : e; | |
var t, r, n | |
} | |
function x(e) { | |
var t = e.indexOf("#"); | |
if (-1 === t) | |
return { | |
src: e, | |
x: 0, | |
y: 0, | |
w: 0, | |
h: 0 | |
}; | |
var r = e.substring(0, t) | |
, n = e.substring(t + 1); | |
if ("xywh=" !== n.substring(0, 5)) | |
return { | |
src: a.basePath + r, | |
x: 0, | |
y: 0, | |
w: 0, | |
h: 0 | |
}; | |
var i = n.substring(5).split(","); | |
return { | |
src: a.basePath + r, | |
x: +i[0], | |
y: +i[1], | |
w: +i[2], | |
h: +i[3] | |
} | |
} | |
}, | |
"./node_modules/videojs-swf/package.json": function(e) { | |
e.exports = { | |
a: "5.4.2" | |
} | |
}, | |
"./node_modules/videojs-vtt.js/lib/browser-index.js": function(e, t, r) { | |
var n = r("./node_modules/global/window.js") | |
, i = e.exports = { | |
WebVTT: r("./node_modules/videojs-vtt.js/lib/vtt.js"), | |
VTTCue: r("./node_modules/videojs-vtt.js/lib/vttcue.js"), | |
VTTRegion: r("./node_modules/videojs-vtt.js/lib/vttregion.js") | |
}; | |
n.vttjs = i, | |
n.WebVTT = i.WebVTT; | |
var o = i.VTTCue | |
, a = i.VTTRegion | |
, s = n.VTTCue | |
, l = n.VTTRegion; | |
i.shim = function() { | |
n.VTTCue = o, | |
n.VTTRegion = a | |
} | |
, | |
i.restore = function() { | |
n.VTTCue = s, | |
n.VTTRegion = l | |
} | |
, | |
n.VTTCue || i.shim() | |
}, | |
"./node_modules/videojs-vtt.js/lib/vtt.js": function(e, t) { | |
var r = Object.create || function() { | |
function t() {} | |
return function(e) { | |
if (1 !== arguments.length) | |
throw new Error("Object.create shim only accepts one parameter."); | |
return t.prototype = e, | |
new t | |
} | |
}(); | |
function u(e, t) { | |
this.name = "ParsingError", | |
this.code = e.code, | |
this.message = t || e.message | |
} | |
function v(e) { | |
function t(e, t, r, n) { | |
return 3600 * (0 | e) + 60 * (0 | t) + (0 | r) + (0 | n) / 1e3 | |
} | |
var r = e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/); | |
return r ? r[3] ? t(r[1], r[2], r[3].replace(":", ""), r[4]) : 59 < r[1] ? t(r[1], r[2], 0, r[4]) : t(0, r[1], r[2], r[4]) : null | |
} | |
function c() { | |
this.values = r(null) | |
} | |
function h(e, t, r, n) { | |
var i = n ? e.split(n) : [e]; | |
for (var o in i) | |
if ("string" == typeof i[o]) { | |
var a = i[o].split(r); | |
if (2 === a.length) | |
t(a[0], a[1]) | |
} | |
} | |
function l(t, e, o) { | |
var r, n, a, i = t; | |
function s() { | |
var e = v(t); | |
if (null === e) | |
throw new u(u.Errors.BadTimeStamp,"Malformed timestamp: " + i); | |
return t = t.replace(/^[^\sa-zA-Z-]+/, ""), | |
e | |
} | |
function l() { | |
t = t.replace(/^\s+/, "") | |
} | |
if (l(), | |
e.startTime = s(), | |
l(), | |
"--\x3e" !== t.substr(0, 3)) | |
throw new u(u.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): " + i); | |
t = t.substr(3), | |
l(), | |
e.endTime = s(), | |
l(), | |
r = t, | |
n = e, | |
a = new c, | |
h(r, function(e, t) { | |
switch (e) { | |
case "region": | |
for (var r = o.length - 1; 0 <= r; r--) | |
if (o[r].id === t) { | |
a.set(e, o[r].region); | |
break | |
} | |
break; | |
case "vertical": | |
a.alt(e, t, ["rl", "lr"]); | |
break; | |
case "line": | |
var n = t.split(",") | |
, i = n[0]; | |
a.integer(e, i), | |
a.percent(e, i) && a.set("snapToLines", !1), | |
a.alt(e, i, ["auto"]), | |
2 === n.length && a.alt("lineAlign", n[1], ["start", "middle", "end"]); | |
break; | |
case "position": | |
n = t.split(","), | |
a.percent(e, n[0]), | |
2 === n.length && a.alt("positionAlign", n[1], ["start", "middle", "end"]); | |
break; | |
case "size": | |
a.percent(e, t); | |
break; | |
case "align": | |
a.alt(e, t, ["start", "middle", "end", "left", "right"]) | |
} | |
}, /:/, /\s/), | |
n.region = a.get("region", null), | |
n.vertical = a.get("vertical", ""), | |
n.line = a.get("line", "auto"), | |
n.lineAlign = a.get("lineAlign", "start"), | |
n.snapToLines = a.get("snapToLines", !0), | |
n.size = a.get("size", 100), | |
n.align = a.get("align", "middle"), | |
n.position = a.get("position", { | |
start: 0, | |
left: 0, | |
middle: 50, | |
end: 100, | |
right: 100 | |
}, n.align), | |
n.positionAlign = a.get("positionAlign", { | |
start: "start", | |
left: "start", | |
middle: "middle", | |
end: "end", | |
right: "end" | |
}, n.align) | |
} | |
((u.prototype = r(Error.prototype)).constructor = u).Errors = { | |
BadSignature: { | |
code: 0, | |
message: "Malformed WebVTT signature." | |
}, | |
BadTimeStamp: { | |
code: 1, | |
message: "Malformed time stamp." | |
} | |
}, | |
c.prototype = { | |
set: function(e, t) { | |
this.get(e) || "" === t || (this.values[e] = t) | |
}, | |
get: function(e, t, r) { | |
return r ? this.has(e) ? this.values[e] : t[r] : this.has(e) ? this.values[e] : t | |
}, | |
has: function(e) { | |
return e in this.values | |
}, | |
alt: function(e, t, r) { | |
for (var n = 0; n < r.length; ++n) | |
if (t === r[n]) { | |
this.set(e, t); | |
break | |
} | |
}, | |
integer: function(e, t) { | |
/^-?\d+$/.test(t) && this.set(e, parseInt(t, 10)) | |
}, | |
percent: function(e, t) { | |
return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && (this.set(e, t), | |
!0) | |
} | |
}; | |
var y = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
"‎": "", | |
"‏": "", | |
" ": " " | |
} | |
, m = { | |
c: "span", | |
i: "i", | |
b: "b", | |
u: "u", | |
ruby: "ruby", | |
rt: "rt", | |
v: "span", | |
lang: "span" | |
} | |
, _ = { | |
v: "title", | |
lang: "lang" | |
} | |
, g = { | |
rt: "ruby" | |
}; | |
function d(o, r) { | |
function e() { | |
if (!r) | |
return null; | |
var e, t = r.match(/^([^<]*)(<[^>]*>?)?/); | |
return e = t[1] ? t[1] : t[2], | |
r = r.substr(e.length), | |
e | |
} | |
function t(e) { | |
return y[e] | |
} | |
function n(e) { | |
for (; f = e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/); ) | |
e = e.replace(f[0], t); | |
return e | |
} | |
function i(e, t) { | |
var r = m[e]; | |
if (!r) | |
return null; | |
var n = o.document.createElement(r); | |
n.localName = r; | |
var i = _[e]; | |
return i && t && (n[i] = t.trim()), | |
n | |
} | |
for (var a, s, l, u = o.document.createElement("div"), c = u, h = []; null !== (a = e()); ) | |
if ("<" !== a[0]) | |
c.appendChild(o.document.createTextNode(n(a))); | |
else { | |
if ("/" === a[1]) { | |
h.length && h[h.length - 1] === a.substr(2).replace(">", "") && (h.pop(), | |
c = c.parentNode); | |
continue | |
} | |
var d, p = v(a.substr(1, a.length - 2)); | |
if (p) { | |
d = o.document.createProcessingInstruction("timestamp", p), | |
c.appendChild(d); | |
continue | |
} | |
var f = a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/); | |
if (!f) | |
continue; | |
if (!(d = i(f[1], f[3]))) | |
continue; | |
if (s = c, | |
g[(l = d).localName] && g[l.localName] !== s.localName) | |
continue; | |
f[2] && (d.className = f[2].substr(1).replace(".", " ")), | |
h.push(f[1]), | |
c.appendChild(d), | |
c = d | |
} | |
return u | |
} | |
var n = [[1470, 1470], [1472, 1472], [1475, 1475], [1478, 1478], [1488, 1514], [1520, 1524], [1544, 1544], [1547, 1547], [1549, 1549], [1563, 1563], [1566, 1610], [1645, 1647], [1649, 1749], [1765, 1766], [1774, 1775], [1786, 1805], [1807, 1808], [1810, 1839], [1869, 1957], [1969, 1969], [1984, 2026], [2036, 2037], [2042, 2042], [2048, 2069], [2074, 2074], [2084, 2084], [2088, 2088], [2096, 2110], [2112, 2136], [2142, 2142], [2208, 2208], [2210, 2220], [8207, 8207], [64285, 64285], [64287, 64296], [64298, 64310], [64312, 64316], [64318, 64318], [64320, 64321], [64323, 64324], [64326, 64449], [64467, 64829], [64848, 64911], [64914, 64967], [65008, 65020], [65136, 65140], [65142, 65276], [67584, 67589], [67592, 67592], [67594, 67637], [67639, 67640], [67644, 67644], [67647, 67669], [67671, 67679], [67840, 67867], [67872, 67897], [67903, 67903], [67968, 68023], [68030, 68031], [68096, 68096], [68112, 68115], [68117, 68119], [68121, 68147], [68160, 68167], [68176, 68184], [68192, 68223], [68352, 68405], [68416, 68437], [68440, 68466], [68472, 68479], [68608, 68680], [126464, 126467], [126469, 126495], [126497, 126498], [126500, 126500], [126503, 126503], [126505, 126514], [126516, 126519], [126521, 126521], [126523, 126523], [126530, 126530], [126535, 126535], [126537, 126537], [126539, 126539], [126541, 126543], [126545, 126546], [126548, 126548], [126551, 126551], [126553, 126553], [126555, 126555], [126557, 126557], [126559, 126559], [126561, 126562], [126564, 126564], [126567, 126570], [126572, 126578], [126580, 126583], [126585, 126588], [126590, 126590], [126592, 126601], [126603, 126619], [126625, 126627], [126629, 126633], [126635, 126651], [1114109, 1114109]]; | |
function p(e) { | |
for (var t = 0; t < n.length; t++) { | |
var r = n[t]; | |
if (e >= r[0] && e <= r[1]) | |
return !0 | |
} | |
return !1 | |
} | |
function f() {} | |
function b(e, t, r) { | |
var n = /MSIE\s8\.0/.test(navigator.userAgent) | |
, i = "rgba(255, 255, 255, 1)" | |
, o = "rgba(0, 0, 0, 0.8)"; | |
n && (i = "rgb(255, 255, 255)", | |
o = "rgb(0, 0, 0)"), | |
f.call(this), | |
this.cue = t, | |
this.cueDiv = d(e, t.text); | |
var a = { | |
color: i, | |
backgroundColor: o, | |
position: "relative", | |
left: 0, | |
right: 0, | |
top: 0, | |
bottom: 0, | |
display: "inline" | |
}; | |
n || (a.writingMode = "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl", | |
a.unicodeBidi = "plaintext"), | |
this.applyStyles(a, this.cueDiv), | |
this.div = e.document.createElement("div"), | |
a = { | |
textAlign: "middle" === t.align ? "center" : t.align, | |
font: r.font, | |
whiteSpace: "pre-line", | |
position: "absolute" | |
}, | |
n || (a.direction = function(e) { | |
var t = [] | |
, r = ""; | |
if (!e || !e.childNodes) | |
return "ltr"; | |
function i(e, t) { | |
for (var r = t.childNodes.length - 1; 0 <= r; r--) | |
e.push(t.childNodes[r]) | |
} | |
function o(e) { | |
if (!e || !e.length) | |
return null; | |
var t = e.pop() | |
, r = t.textContent || t.innerText; | |
if (r) { | |
var n = r.match(/^.*(\n|\r)/); | |
return n ? n[e.length = 0] : r | |
} | |
return "ruby" === t.tagName ? o(e) : t.childNodes ? (i(e, t), | |
o(e)) : void 0 | |
} | |
for (i(t, e); r = o(t); ) | |
for (var n = 0; n < r.length; n++) | |
if (p(r.charCodeAt(n))) | |
return "rtl"; | |
return "ltr" | |
}(this.cueDiv), | |
a.writingMode = "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl".stylesunicodeBidi = "plaintext"), | |
this.applyStyles(a), | |
this.div.appendChild(this.cueDiv); | |
var s = 0; | |
switch (t.positionAlign) { | |
case "start": | |
s = t.position; | |
break; | |
case "middle": | |
s = t.position - t.size / 2; | |
break; | |
case "end": | |
s = t.position - t.size | |
} | |
"" === t.vertical ? this.applyStyles({ | |
left: this.formatStyle(s, "%"), | |
width: this.formatStyle(t.size, "%") | |
}) : this.applyStyles({ | |
top: this.formatStyle(s, "%"), | |
height: this.formatStyle(t.size, "%") | |
}), | |
this.move = function(e) { | |
this.applyStyles({ | |
top: this.formatStyle(e.top, "px"), | |
bottom: this.formatStyle(e.bottom, "px"), | |
left: this.formatStyle(e.left, "px"), | |
right: this.formatStyle(e.right, "px"), | |
height: this.formatStyle(e.height, "px"), | |
width: this.formatStyle(e.width, "px") | |
}) | |
} | |
} | |
function T(e) { | |
var t, r, n, i, o = /MSIE\s8\.0/.test(navigator.userAgent); | |
if (e.div) { | |
r = e.div.offsetHeight, | |
n = e.div.offsetWidth, | |
i = e.div.offsetTop; | |
var a = (a = e.div.childNodes) && (a = a[0]) && a.getClientRects && a.getClientRects(); | |
e = e.div.getBoundingClientRect(), | |
t = a ? Math.max(a[0] && a[0].height || 0, e.height / a.length) : 0 | |
} | |
this.left = e.left, | |
this.right = e.right, | |
this.top = e.top || i, | |
this.height = e.height || r, | |
this.bottom = e.bottom || i + (e.height || r), | |
this.width = e.width || n, | |
this.lineHeight = void 0 !== t ? t : e.lineHeight, | |
o && !this.lineHeight && (this.lineHeight = 13) | |
} | |
function w(e, t, s, l) { | |
var r = new T(t) | |
, n = t.cue | |
, i = function(e) { | |
if ("number" == typeof e.line && (e.snapToLines || 0 <= e.line && e.line <= 100)) | |
return e.line; | |
if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement) | |
return -1; | |
for (var t = e.track, r = t.textTrackList, n = 0, i = 0; i < r.length && r[i] !== t; i++) | |
"showing" === r[i].mode && n++; | |
return -1 * ++n | |
}(n) | |
, o = []; | |
if (n.snapToLines) { | |
var a; | |
switch (n.vertical) { | |
case "": | |
o = ["+y", "-y"], | |
a = "height"; | |
break; | |
case "rl": | |
o = ["+x", "-x"], | |
a = "width"; | |
break; | |
case "lr": | |
o = ["-x", "+x"], | |
a = "width" | |
} | |
var u = r.lineHeight | |
, c = u * Math.round(i) | |
, h = s[a] + u | |
, d = o[0]; | |
Math.abs(c) > h && (c = c < 0 ? -1 : 1, | |
c *= Math.ceil(h / u) * u), | |
i < 0 && (c += "" === n.vertical ? s.height : s.width, | |
o = o.reverse()), | |
r.move(d, c) | |
} else { | |
var p = r.lineHeight / s.height * 100; | |
switch (n.lineAlign) { | |
case "middle": | |
i -= p / 2; | |
break; | |
case "end": | |
i -= p | |
} | |
switch (n.vertical) { | |
case "": | |
t.applyStyles({ | |
top: t.formatStyle(i, "%") | |
}); | |
break; | |
case "rl": | |
t.applyStyles({ | |
left: t.formatStyle(i, "%") | |
}); | |
break; | |
case "lr": | |
t.applyStyles({ | |
right: t.formatStyle(i, "%") | |
}) | |
} | |
o = ["+y", "-x", "+x", "-y"], | |
r = new T(t) | |
} | |
var f = function(e, t) { | |
for (var r, n = new T(e), i = 1, o = 0; o < t.length; o++) { | |
for (; e.overlapsOppositeAxis(s, t[o]) || e.within(s) && e.overlapsAny(l); ) | |
e.move(t[o]); | |
if (e.within(s)) | |
return e; | |
var a = e.intersectPercentage(s); | |
a < i && (r = new T(e), | |
i = a), | |
e = new T(n) | |
} | |
return r || n | |
}(r, o); | |
t.move(f.toCSSCompatValues(s)) | |
} | |
function i() {} | |
f.prototype.applyStyles = function(e, t) { | |
for (var r in t = t || this.div, | |
e) | |
e.hasOwnProperty(r) && (t.style[r] = e[r]) | |
} | |
, | |
f.prototype.formatStyle = function(e, t) { | |
return 0 === e ? 0 : e + t | |
} | |
, | |
(b.prototype = r(f.prototype)).constructor = b, | |
T.prototype.move = function(e, t) { | |
switch (t = void 0 !== t ? t : this.lineHeight, | |
e) { | |
case "+x": | |
this.left += t, | |
this.right += t; | |
break; | |
case "-x": | |
this.left -= t, | |
this.right -= t; | |
break; | |
case "+y": | |
this.top += t, | |
this.bottom += t; | |
break; | |
case "-y": | |
this.top -= t, | |
this.bottom -= t | |
} | |
} | |
, | |
T.prototype.overlaps = function(e) { | |
return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top | |
} | |
, | |
T.prototype.overlapsAny = function(e) { | |
for (var t = 0; t < e.length; t++) | |
if (this.overlaps(e[t])) | |
return !0; | |
return !1 | |
} | |
, | |
T.prototype.within = function(e) { | |
return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right | |
} | |
, | |
T.prototype.overlapsOppositeAxis = function(e, t) { | |
switch (t) { | |
case "+x": | |
return this.left < e.left; | |
case "-x": | |
return this.right > e.right; | |
case "+y": | |
return this.top < e.top; | |
case "-y": | |
return this.bottom > e.bottom | |
} | |
} | |
, | |
T.prototype.intersectPercentage = function(e) { | |
return Math.max(0, Math.min(this.right, e.right) - Math.max(this.left, e.left)) * Math.max(0, Math.min(this.bottom, e.bottom) - Math.max(this.top, e.top)) / (this.height * this.width) | |
} | |
, | |
T.prototype.toCSSCompatValues = function(e) { | |
return { | |
top: this.top - e.top, | |
bottom: e.bottom - this.bottom, | |
left: this.left - e.left, | |
right: e.right - this.right, | |
height: this.height, | |
width: this.width | |
} | |
} | |
, | |
T.getSimpleBoxPosition = function(e) { | |
var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0 | |
, r = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0 | |
, n = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0; | |
return { | |
left: (e = e.div ? e.div.getBoundingClientRect() : e.tagName ? e.getBoundingClientRect() : e).left, | |
right: e.right, | |
top: e.top || n, | |
height: e.height || t, | |
bottom: e.bottom || n + (e.height || t), | |
width: e.width || r | |
} | |
} | |
, | |
i.StringDecoder = function() { | |
return { | |
decode: function(e) { | |
if (!e) | |
return ""; | |
if ("string" != typeof e) | |
throw new Error("Error - expected string data."); | |
return decodeURIComponent(encodeURIComponent(e)) | |
} | |
} | |
} | |
, | |
i.convertCueToDOMTree = function(e, t) { | |
return e && t ? d(e, t) : null | |
} | |
; | |
i.processCues = function(n, i, e) { | |
if (!n || !i || !e) | |
return null; | |
for (; e.firstChild; ) | |
e.removeChild(e.firstChild); | |
var o = n.document.createElement("div"); | |
if (o.style.position = "absolute", | |
o.style.left = "0", | |
o.style.right = "0", | |
o.style.top = "0", | |
o.style.bottom = "0", | |
o.style.margin = "1.5%", | |
e.appendChild(o), | |
function(e) { | |
for (var t = 0; t < e.length; t++) | |
if (e[t].hasBeenReset || !e[t].displayState) | |
return !0; | |
return !1 | |
}(i)) { | |
var a = [] | |
, s = T.getSimpleBoxPosition(o) | |
, l = { | |
font: Math.round(.05 * s.height * 100) / 100 + "px sans-serif" | |
}; | |
!function() { | |
for (var e, t, r = 0; r < i.length; r++) | |
t = i[r], | |
e = new b(n,t,l), | |
o.appendChild(e.div), | |
w(0, e, s, a), | |
t.displayState = e.div, | |
a.push(T.getSimpleBoxPosition(e)) | |
}() | |
} else | |
for (var t = 0; t < i.length; t++) | |
o.appendChild(i[t].displayState) | |
} | |
, | |
(i.Parser = function(e, t, r) { | |
r || (r = t, | |
t = {}), | |
t || (t = {}), | |
this.window = e, | |
this.vttjs = t, | |
this.state = "INITIAL", | |
this.buffer = "", | |
this.decoder = r || new TextDecoder("utf8"), | |
this.regionList = [] | |
} | |
).prototype = { | |
reportOrThrowError: function(e) { | |
if (!(e instanceof u)) | |
throw e; | |
this.onparsingerror && this.onparsingerror(e) | |
}, | |
parse: function(e) { | |
var o = this; | |
function t() { | |
for (var e = o.buffer, t = 0; t < e.length && "\r" !== e[t] && "\n" !== e[t]; ) | |
++t; | |
var r = e.substr(0, t); | |
return "\r" === e[t] && ++t, | |
"\n" === e[t] && ++t, | |
o.buffer = e.substr(t), | |
r | |
} | |
function r(e) { | |
e.match(/X-TIMESTAMP-MAP/) ? h(e, function(e, t) { | |
switch (e) { | |
case "X-TIMESTAMP-MAP": | |
r = t, | |
n = new c, | |
h(r, function(e, t) { | |
switch (e) { | |
case "MPEGT": | |
n.integer(e + "S", t); | |
break; | |
case "LOCA": | |
n.set(e + "L", v(t)) | |
} | |
}, /[^\d]:/, /,/), | |
o.ontimestampmap && o.ontimestampmap({ | |
MPEGTS: n.get("MPEGTS"), | |
LOCAL: n.get("LOCAL") | |
}) | |
} | |
var r, n | |
}, /=/) : h(e, function(e, t) { | |
switch (e) { | |
case "Region": | |
!function(e) { | |
var i = new c; | |
if (h(e, function(e, t) { | |
switch (e) { | |
case "id": | |
i.set(e, t); | |
break; | |
case "width": | |
i.percent(e, t); | |
break; | |
case "lines": | |
i.integer(e, t); | |
break; | |
case "regionanchor": | |
case "viewportanchor": | |
var r = t.split(","); | |
if (2 !== r.length) | |
break; | |
var n = new c; | |
if (n.percent("x", r[0]), | |
n.percent("y", r[1]), | |
!n.has("x") || !n.has("y")) | |
break; | |
i.set(e + "X", n.get("x")), | |
i.set(e + "Y", n.get("y")); | |
break; | |
case "scroll": | |
i.alt(e, t, ["up"]) | |
} | |
}, /=/, /\s/), | |
i.has("id")) { | |
var t = new (o.vttjs.VTTRegion || o.window.VTTRegion); | |
t.width = i.get("width", 100), | |
t.lines = i.get("lines", 3), | |
t.regionAnchorX = i.get("regionanchorX", 0), | |
t.regionAnchorY = i.get("regionanchorY", 100), | |
t.viewportAnchorX = i.get("viewportanchorX", 0), | |
t.viewportAnchorY = i.get("viewportanchorY", 100), | |
t.scroll = i.get("scroll", ""), | |
o.onregion && o.onregion(t), | |
o.regionList.push({ | |
id: i.get("id"), | |
region: t | |
}) | |
} | |
}(t) | |
} | |
}, /:/) | |
} | |
e && (o.buffer += o.decoder.decode(e, { | |
stream: !0 | |
})); | |
try { | |
var n; | |
if ("INITIAL" === o.state) { | |
if (!/\r\n|\n/.test(o.buffer)) | |
return this; | |
var i = (n = t()).match(/^WEBVTT([ \t].*)?$/); | |
if (!i || !i[0]) | |
throw new u(u.Errors.BadSignature); | |
o.state = "HEADER" | |
} | |
for (var a = !1; o.buffer; ) { | |
if (!/\r\n|\n/.test(o.buffer)) | |
return this; | |
switch (a ? a = !1 : n = t(), | |
o.state) { | |
case "HEADER": | |
/:/.test(n) ? r(n) : n || (o.state = "ID"); | |
continue; | |
case "NOTE": | |
n || (o.state = "ID"); | |
continue; | |
case "ID": | |
if (/^NOTE($|[ \t])/.test(n)) { | |
o.state = "NOTE"; | |
break | |
} | |
if (!n) | |
continue; | |
if (o.cue = new (o.vttjs.VTTCue || o.window.VTTCue)(0,0,""), | |
o.state = "CUE", | |
-1 === n.indexOf("--\x3e")) { | |
o.cue.id = n; | |
continue | |
} | |
case "CUE": | |
try { | |
l(n, o.cue, o.regionList) | |
} catch (e) { | |
o.reportOrThrowError(e), | |
o.cue = null, | |
o.state = "BADCUE"; | |
continue | |
} | |
o.state = "CUETEXT"; | |
continue; | |
case "CUETEXT": | |
var s = -1 !== n.indexOf("--\x3e"); | |
if (!n || s && (a = !0)) { | |
o.oncue && o.oncue(o.cue), | |
o.cue = null, | |
o.state = "ID"; | |
continue | |
} | |
o.cue.text && (o.cue.text += "\n"), | |
o.cue.text += n; | |
continue; | |
case "BADCUE": | |
n || (o.state = "ID"); | |
continue | |
} | |
} | |
} catch (e) { | |
o.reportOrThrowError(e), | |
"CUETEXT" === o.state && o.cue && o.oncue && o.oncue(o.cue), | |
o.cue = null, | |
o.state = "INITIAL" === o.state ? "BADWEBVTT" : "BADCUE" | |
} | |
return this | |
}, | |
flush: function() { | |
var t = this; | |
try { | |
if (t.buffer += t.decoder.decode(), | |
(t.cue || "HEADER" === t.state) && (t.buffer += "\n\n", | |
t.parse()), | |
"INITIAL" === t.state) | |
throw new u(u.Errors.BadSignature) | |
} catch (e) { | |
t.reportOrThrowError(e) | |
} | |
return t.onflush && t.onflush(), | |
this | |
} | |
}, | |
e.exports = i | |
}, | |
"./node_modules/videojs-vtt.js/lib/vttcue.js": function(e, t) { | |
var b = { | |
"": !0, | |
lr: !0, | |
rl: !0 | |
} | |
, r = { | |
start: !0, | |
middle: !0, | |
end: !0, | |
left: !0, | |
right: !0 | |
}; | |
function T(e) { | |
return "string" == typeof e && (!!r[e.toLowerCase()] && e.toLowerCase()) | |
} | |
function w(e) { | |
for (var t = 1; t < arguments.length; t++) { | |
var r = arguments[t]; | |
for (var n in r) | |
e[n] = r[n] | |
} | |
return e | |
} | |
function n(e, t, r) { | |
var n = this | |
, i = /MSIE\s8\.0/.test(navigator.userAgent) | |
, o = {}; | |
i ? n = document.createElement("custom") : o.enumerable = !0, | |
n.hasBeenReset = !1; | |
var a = "" | |
, s = !1 | |
, l = e | |
, u = t | |
, c = r | |
, h = null | |
, d = "" | |
, p = !0 | |
, f = "auto" | |
, v = "start" | |
, y = 50 | |
, m = "middle" | |
, _ = 50 | |
, g = "middle"; | |
if (Object.defineProperty(n, "id", w({}, o, { | |
get: function() { | |
return a | |
}, | |
set: function(e) { | |
a = "" + e | |
} | |
})), | |
Object.defineProperty(n, "pauseOnExit", w({}, o, { | |
get: function() { | |
return s | |
}, | |
set: function(e) { | |
s = !!e | |
} | |
})), | |
Object.defineProperty(n, "startTime", w({}, o, { | |
get: function() { | |
return l | |
}, | |
set: function(e) { | |
if ("number" != typeof e) | |
throw new TypeError("Start time must be set to a number."); | |
l = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "endTime", w({}, o, { | |
get: function() { | |
return u | |
}, | |
set: function(e) { | |
if ("number" != typeof e) | |
throw new TypeError("End time must be set to a number."); | |
u = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "text", w({}, o, { | |
get: function() { | |
return c | |
}, | |
set: function(e) { | |
c = "" + e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "region", w({}, o, { | |
get: function() { | |
return h | |
}, | |
set: function(e) { | |
h = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "vertical", w({}, o, { | |
get: function() { | |
return d | |
}, | |
set: function(e) { | |
var t, r = "string" == typeof (t = e) && !!b[t.toLowerCase()] && t.toLowerCase(); | |
if (!1 === r) | |
throw new SyntaxError("An invalid or illegal string was specified."); | |
d = r, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "snapToLines", w({}, o, { | |
get: function() { | |
return p | |
}, | |
set: function(e) { | |
p = !!e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "line", w({}, o, { | |
get: function() { | |
return f | |
}, | |
set: function(e) { | |
if ("number" != typeof e && "auto" !== e) | |
throw new SyntaxError("An invalid number or illegal string was specified."); | |
f = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "lineAlign", w({}, o, { | |
get: function() { | |
return v | |
}, | |
set: function(e) { | |
var t = T(e); | |
if (!t) | |
throw new SyntaxError("An invalid or illegal string was specified."); | |
v = t, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "position", w({}, o, { | |
get: function() { | |
return y | |
}, | |
set: function(e) { | |
if (e < 0 || 100 < e) | |
throw new Error("Position must be between 0 and 100."); | |
y = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "positionAlign", w({}, o, { | |
get: function() { | |
return m | |
}, | |
set: function(e) { | |
var t = T(e); | |
if (!t) | |
throw new SyntaxError("An invalid or illegal string was specified."); | |
m = t, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "size", w({}, o, { | |
get: function() { | |
return _ | |
}, | |
set: function(e) { | |
if (e < 0 || 100 < e) | |
throw new Error("Size must be between 0 and 100."); | |
_ = e, | |
this.hasBeenReset = !0 | |
} | |
})), | |
Object.defineProperty(n, "align", w({}, o, { | |
get: function() { | |
return g | |
}, | |
set: function(e) { | |
var t = T(e); | |
if (!t) | |
throw new SyntaxError("An invalid or illegal string was specified."); | |
g = t, | |
this.hasBeenReset = !0 | |
} | |
})), | |
n.displayState = void 0, | |
i) | |
return n | |
} | |
n.prototype.getCueAsHTML = function() { | |
return WebVTT.convertCueToDOMTree(window, this.text) | |
} | |
, | |
e.exports = n | |
}, | |
"./node_modules/videojs-vtt.js/lib/vttregion.js": function(e, t) { | |
var l = { | |
"": !0, | |
up: !0 | |
}; | |
function u(e) { | |
return "number" == typeof e && 0 <= e && e <= 100 | |
} | |
e.exports = function() { | |
var t = 100 | |
, r = 3 | |
, n = 0 | |
, i = 100 | |
, o = 0 | |
, a = 100 | |
, s = ""; | |
Object.defineProperties(this, { | |
width: { | |
enumerable: !0, | |
get: function() { | |
return t | |
}, | |
set: function(e) { | |
if (!u(e)) | |
throw new Error("Width must be between 0 and 100."); | |
t = e | |
} | |
}, | |
lines: { | |
enumerable: !0, | |
get: function() { | |
return r | |
}, | |
set: function(e) { | |
if ("number" != typeof e) | |
throw new TypeError("Lines must be set to a number."); | |
r = e | |
} | |
}, | |
regionAnchorY: { | |
enumerable: !0, | |
get: function() { | |
return i | |
}, | |
set: function(e) { | |
if (!u(e)) | |
throw new Error("RegionAnchorX must be between 0 and 100."); | |
i = e | |
} | |
}, | |
regionAnchorX: { | |
enumerable: !0, | |
get: function() { | |
return n | |
}, | |
set: function(e) { | |
if (!u(e)) | |
throw new Error("RegionAnchorY must be between 0 and 100."); | |
n = e | |
} | |
}, | |
viewportAnchorY: { | |
enumerable: !0, | |
get: function() { | |
return a | |
}, | |
set: function(e) { | |
if (!u(e)) | |
throw new Error("ViewportAnchorY must be between 0 and 100."); | |
a = e | |
} | |
}, | |
viewportAnchorX: { | |
enumerable: !0, | |
get: function() { | |
return o | |
}, | |
set: function(e) { | |
if (!u(e)) | |
throw new Error("ViewportAnchorX must be between 0 and 100."); | |
o = e | |
} | |
}, | |
scroll: { | |
enumerable: !0, | |
get: function() { | |
return s | |
}, | |
set: function(e) { | |
var t, r = "string" == typeof (t = e) && !!l[t.toLowerCase()] && t.toLowerCase(); | |
if (!1 === r) | |
throw new SyntaxError("An invalid or illegal string was specified."); | |
s = r | |
} | |
} | |
}) | |
} | |
} | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment