Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Udemy player bundle
(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)