*/
, $t = Object.prototype.toString;
var Jt = function(e) {
var r = {};
return e && e.trim().split("\n").forEach(function(e) {
var t = e.indexOf(":")
, n = e.slice(0, t).trim().toLowerCase()
, i = e.slice(t + 1).trim();
"undefined" == typeof r[n] ? r[n] = i : Array.isArray(r[n]) ? r[n].push(i) : r[n] = [r[n], i]
}),
r
}
, Zt = nn
, en = nn;
function tn(e, t, n) {
var i = e;
return Yt(t) ? (n = t,
"string" == typeof e && (i = {
uri: e
})) : i = r({}, t, {
uri: e
}),
i.callback = n,
i
}
function nn(e, t, n) {
return rn(t = tn(e, t, n))
}
function rn(i) {
if ("undefined" == typeof i.callback)
throw new Error("callback argument missing");
var r = !1
, s = function(e, t, n) {
r || (r = !0,
i.callback(e, t, n))
};
function t(e) {
return clearTimeout(o),
e instanceof Error || (e = new Error("" + (e || "Unknown XMLHttpRequest Error"))),
e.statusCode = 0,
s(e, v)
}
function e() {
if (!a) {
var e;
clearTimeout(o),
e = i.useXDR && void 0 === l.status ? 200 : 1223 === l.status ? 204 : l.status;
var t = v
, n = null;
return 0 !== e ? (t = {
body: function() {
var e = void 0;
if (e = l.response ? l.response : l.responseText || function(e) {
try {
if ("document" === e.responseType)
return e.responseXML;
var t = e.responseXML && "parsererror" === e.responseXML.documentElement.nodeName;
if ("" === e.responseType && !t)
return e.responseXML
} catch (e) {}
return null
}(l),
f)
try {
e = JSON.parse(e)
} catch (e) {}
return e
}(),
statusCode: e,
method: c,
headers: {},
url: u,
rawRequest: l
},
l.getAllResponseHeaders && (t.headers = Jt(l.getAllResponseHeaders()))) : n = new Error("Internal XMLHttpRequest Error"),
s(n, t, t.body)
}
}
var n, a, o, l = i.xhr || null, u = (l = l || (i.cors || i.useXDR ? new nn.XDomainRequest : new nn.XMLHttpRequest)).url = i.uri || i.url, c = l.method = i.method || "GET", h = i.body || i.data, d = l.headers = i.headers || {}, p = !!i.sync, f = !1, v = {
body: void 0,
headers: {},
statusCode: 0,
method: c,
url: u,
rawRequest: l
};
if ("json"in i && !1 !== i.json && (f = !0,
d.accept || d.Accept || (d.Accept = "application/json"),
"GET" !== c && "HEAD" !== c && (d["content-type"] || d["Content-Type"] || (d["Content-Type"] = "application/json"),
h = JSON.stringify(!0 === i.json ? h : i.json))),
l.onreadystatechange = function() {
4 === l.readyState && setTimeout(e, 0)
}
,
l.onload = e,
l.onerror = t,
l.onprogress = function() {}
,
l.onabort = function() {
a = !0
}
,
l.ontimeout = t,
l.open(c, u, !p, i.username, i.password),
p || (l.withCredentials = !!i.withCredentials),
!p && 0 < i.timeout && (o = setTimeout(function() {
if (!a) {
a = !0,
l.abort("timeout");
var e = new Error("XMLHttpRequest timeout");
e.code = "ETIMEDOUT",
t(e)
}
}, i.timeout)),
l.setRequestHeader)
for (n in d)
d.hasOwnProperty(n) && l.setRequestHeader(n, d[n]);
else if (i.headers && !function(e) {
for (var t in e)
if (e.hasOwnProperty(t))
return !1;
return !0
}(i.headers))
throw new Error("Headers cannot be set on an XDomainRequest object");
return "responseType"in i && (l.responseType = i.responseType),
"beforeSend"in i && "function" == typeof i.beforeSend && i.beforeSend(l),
l.send(h || null),
l
}
nn.XMLHttpRequest = p.XMLHttpRequest || function() {}
,
nn.XDomainRequest = "withCredentials"in new nn.XMLHttpRequest ? nn.XMLHttpRequest : p.XDomainRequest,
function(e, t) {
for (var n = 0; n < e.length; n++)
t(e[n])
}(["get", "put", "post", "patch", "head", "delete"], function(i) {
nn["delete" === i ? "del" : i] = function(e, t, n) {
return (t = tn(e, t, n)).method = i.toUpperCase(),
rn(t)
}
}),
Zt.default = en;
function sn(e) {
var t = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"]
, n = f.createElement("a");
n.href = e;
var i, r = "" === n.host && "file:" !== n.protocol;
r && ((i = f.createElement("div")).innerHTML = '',
n = i.firstChild,
i.setAttribute("style", "display:none; position:absolute;"),
f.body.appendChild(i));
for (var s = {}, a = 0; a < t.length; a++)
s[t[a]] = n[t[a]];
return "http:" === s.protocol && (s.host = s.host.replace(/:80$/, "")),
"https:" === s.protocol && (s.host = s.host.replace(/:443$/, "")),
s.protocol || (s.protocol = p.location.protocol),
r && f.body.removeChild(i),
s
}
function an(e) {
if (!e.match(/^https?:\/\//)) {
var t = f.createElement("div");
t.innerHTML = 'x',
e = t.firstChild.href
}
return e
}
function on(e) {
if ("string" == typeof e) {
var t = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);
if (t)
return t.pop().toLowerCase()
}
return ""
}
function ln(e, t) {
void 0 === t && (t = p.location);
var n = sn(e);
return (":" === n.protocol ? t.protocol : n.protocol) + n.host !== t.protocol + t.host
}
var un = Object.freeze({
__proto__: null,
parseUrl: sn,
getAbsoluteURL: an,
getFileExtension: on,
isCrossOrigin: ln
})
, cn = function(r) {
function e(e, t) {
var n;
(n = r.call(this, e, t) || this).hide(),
n.isPlaying_ = !1,
n.on(e, "pause", n.onPause),
n.on(e, "play", n.hideAd),
n.on(e, "ended", n.onEnded);
var i = n.getChild("pauseAdContent").getChild("PauseAdCloseButton");
return n.on(i, "click", n.hideAd),
n
}
We(e, r);
var t = e.prototype;
return t.imgLoaded = function() {}
,
t.playerResize = function() {}
,
t.createEl = function() {
var e = this.buildCSSClass();
return r.prototype.createEl.call(this, "div", {
className: e + "pause-ad-overlay"
})
}
,
t.dispose = function() {
this.contentTextEl_ = null,
this.contentEl_ = null,
this.textNode_ = null,
r.prototype.dispose.call(this)
}
,
t.showAd = function(e) {
var t = JSON.parse(e)
, n = this.getChild("PauseAdContent");
t[0] && (n.setAdData(t[0]),
this.adWidth = t[0].width,
this.adHeight = t[0].height,
this.show())
}
,
t.hideAd = function(e) {
this.isPlaying_ = !0,
this.hide(),
e.stopPropagation()
}
,
t.onPause = function() {
this.isPlaying_ = !1;
setTimeout(this.getAdData, 300, this)
}
,
t.onEnded = function() {
this.isPlaying_ = !0
}
,
t.getAdData = function(i) {
if (!i.isPlaying_ && i.player_.ads && !1 === i.player_.ads.isInAdMode() && !1 !== i.player_.options().pauseAd && void 0 !== i.player_.options().pauseAdUrl && "" !== i.player_.options().pauseAdUrl) {
var e = {
uri: i.player_.options().pauseAdUrl
}
, t = ln(i.player_.options().pauseAdUrl);
t && (e.cors = t),
Zt(e, Te(i, function(e, t, n) {
if (e)
return !1;
null != n && !1 === i.isPlaying_ && i.showAd(n)
}))
}
}
,
t.handleClick = function() {
void 0 !== p && p.open(this.adLink, "_blank")
}
,
t.updateContent = function(e) {}
,
e
}(He);
cn.prototype.options_ = {
children: ["pauseAdContent"]
},
He.registerComponent("pauseAdOverLay", cn);
var hn = function(r) {
function e(e, t, n) {
var i;
return (i = r.call(this, e, t) || this).on("click", i.handleClick),
i
}
We(e, r);
var t = e.prototype;
return t.setAdData = function(e) {
this.adLink = e.clickUrl,
this.eventExposure = e.eventExposure,
this.eventExposure1 = e.eventExposure1,
this.imgUrl = e.url;
var t = this.el().getElementsByTagName("img")[0];
t.src = this.imgUrl,
t.style.width = "540px",
t.style.height = "70px",
this.el().style.width = "540px",
this.el().style.height = "70px"
}
,
t.createEl = function() {
var e = this.buildCSSClass();
return r.prototype.createEl.call(this, "div", {
className: e + "banner-ad-content",
innerHTML: '
'
})
}
,
t.dispose = function() {
this.contentTextEl_ = null,
this.contentEl_ = null,
this.textNode_ = null,
r.prototype.dispose.call(this)
}
,
t.showAd = function() {
this.show()
}
,
t.hideAd = function() {
this.hide()
}
,
t.handleClick = function(e) {
void 0 !== p && void 0 !== this.adLink && p.open(this.adLink, "_blank")
}
,
t.updateContent = function(e) {}
,
e
}(He);
hn.prototype.options_ = {
children: ["BannerAdCloseButton"]
},
He.registerComponent("BannerAdContent", hn);
var dn = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "banner-ad-close " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {}
,
t.playerResize = function() {}
,
e
}(Qt);
He.registerComponent("BannerAdCloseButton", dn);
var pn = function(r) {
function e(e, t) {
var n;
(n = r.call(this, e, t) || this).player_.mainContentDuration_ = void 0,
n.timer = void 0,
n.bannerAd1Showed = !1,
n.bannerAd2Showed = !1,
n.hide(),
n.on(e, "timeupdate", n.timeUpdata);
var i = n.getChild("bannerAdContent").getChild("BannerAdCloseButton");
return n.on(i, "click", n.hideAd),
n
}
We(e, r);
var t = e.prototype;
return t.imgLoaded = function() {}
,
t.playerResize = function() {}
,
t.createEl = function() {
var e = this.buildCSSClass();
return r.prototype.createEl.call(this, "div", {
className: e + "banner-ad-overlay"
})
}
,
t.dispose = function() {
this.contentTextEl_ = null,
this.contentEl_ = null,
this.textNode_ = null,
r.prototype.dispose.call(this)
}
,
t.showAd = function(e) {
var t = JSON.parse(e)
, n = this.getChild("BannerAdContent");
t[0] && (n.setAdData(t[0]),
this.show(),
this.timer && clearTimeout(this.timer),
this.timer = setTimeout(this.timeHide, 1e4, this))
}
,
t.timeHide = function(e) {
e.hide()
}
,
t.hideAd = function(e) {
clearTimeout(this.timer),
this.hide(),
e.stopPropagation()
}
,
t.timeUpdata = function() {
!this.bannerAd2Showed && 300 < this.player_.mainContentDuration_ && 180 <= this.player_.currentTime() ? (this.bannerAd2Showed = !0,
this.getAdData()) : !this.bannerAd1Showed && 300 < this.player_.mainContentDuration_ && 60 <= this.player_.currentTime() && this.player_.currentTime() < 180 ? (this.bannerAd1Showed = !0,
this.getAdData()) : !this.bannerAd1Showed && 60 <= this.player_.mainContentDuration_ && this.player_.mainContentDuration_ <= 300 && 60 <= this.player_.currentTime() && (this.bannerAd1Showed = !0,
this.getAdData())
}
,
t.getAdData = function() {
var i = this;
if (i.player_.ads && !1 === i.player_.ads.isInAdMode() && !1 !== i.player_.options().bannerAd && void 0 !== i.player_.options().bannerAdUrl && "" !== i.player_.options().bannerAdUrl) {
var e = {
uri: i.player_.options().bannerAdUrl
}
, t = ln(i.player_.options().bannerAdUrl);
t && (e.cors = t),
Zt(e, Te(i, function(e, t, n) {
if (e)
return !1;
null != n && i.showAd(n)
}))
}
}
,
t.handleClick = function() {
void 0 !== p && p.open(this.adLink, "_blank")
}
,
t.updateContent = function(e) {}
,
e
}(He);
pn.prototype.options_ = {
children: ["bannerAdContent"]
},
He.registerComponent("bannerAdOverLay", pn);
var fn = function(i) {
function e(e) {
var t;
void 0 === e && (e = []),
(t = i.call(this) || this).tracks_ = [],
Object.defineProperty(Ve(t), "length", {
get: function() {
return this.tracks_.length
}
});
for (var n = 0; n < e.length; n++)
t.addTrack(e[n]);
return t
}
We(e, i);
var t = e.prototype;
return t.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",
target: this
}))
}
,
t.removeTrack = function(e) {
for (var t, n = 0, i = this.length; n < i; n++)
if (this[n] === e) {
(t = this[n]).off && t.off(),
this.tracks_.splice(n, 1);
break
}
t && this.trigger({
track: t,
type: "removetrack",
target: this
})
}
,
t.getTrackById = function(e) {
for (var t = null, n = 0, i = this.length; n < i; n++) {
var r = this[n];
if (r.id === e) {
t = r;
break
}
}
return t
}
,
e
}(ke);
for (var vn in fn.prototype.allowedEvents_ = {
change: "change",
addtrack: "addtrack",
removetrack: "removetrack"
},
fn.prototype.allowedEvents_)
fn.prototype["on" + vn] = null;
function gn(e, t) {
for (var n = 0; n < e.length; n++)
Object.keys(e[n]).length && t.id !== e[n].id && (e[n].enabled = !1)
}
function yn(e, t) {
for (var n = 0; n < e.length; n++)
Object.keys(e[n]).length && t.id !== e[n].id && (e[n].selected = !1)
}
function mn(e, t) {
var n = new p.WebVTT.Parser(p,p.vttjs,p.WebVTT.StringDecoder())
, i = [];
n.oncue = function(e) {
t.addCue(e)
}
,
n.onparsingerror = function(e) {
i.push(e)
}
,
n.onflush = function() {
t.trigger({
type: "loadeddata",
target: t
})
}
,
n.parse(e),
0 < i.length && (p.console && p.console.groupCollapsed && p.console.groupCollapsed("Text Track parsing errors for " + t.src),
i.forEach(function(e) {
return m.error(e)
}),
p.console && p.console.groupEnd && p.console.groupEnd()),
n.flush()
}
function _n(e, i) {
var t = {
uri: e
}
, n = ln(e);
n && (t.cors = n),
Zt(t, Te(this, function(e, t, n) {
if (e)
return m.error(e, t);
i.loaded_ = !0,
"function" != typeof p.WebVTT ? i.tech_ && i.tech_.any(["vttjsloaded", "vttjserror"], function(e) {
if ("vttjserror" !== e.type)
return mn(n, i);
m.error("vttjs failed to load, stopping trying to process " + i.src)
}) : mn(n, i)
}))
}
var bn = function(i) {
function e(e) {
var t;
void 0 === e && (e = []);
for (var n = e.length - 1; 0 <= n; n--)
if (e[n].enabled) {
gn(e, e[n]);
break
}
return (t = i.call(this, e) || this).changing_ = !1,
t
}
We(e, i);
var t = e.prototype;
return t.addTrack = function(e) {
var t = this;
e.enabled && gn(this, e),
i.prototype.addTrack.call(this, e),
e.addEventListener && (e.enabledChange_ = function() {
t.changing_ || (t.changing_ = !0,
gn(t, e),
t.changing_ = !1,
t.trigger("change"))
}
,
e.addEventListener("enabledchange", e.enabledChange_))
}
,
t.removeTrack = function(e) {
i.prototype.removeTrack.call(this, e),
e.removeEventListener && e.enabledChange_ && (e.removeEventListener("enabledchange", e.enabledChange_),
e.enabledChange_ = null)
}
,
e
}(fn)
, Tn = function(i) {
function e(e) {
var t;
void 0 === e && (e = []);
for (var n = e.length - 1; 0 <= n; n--)
if (e[n].selected) {
yn(e, e[n]);
break
}
return (t = i.call(this, e) || this).changing_ = !1,
Object.defineProperty(Ve(t), "selectedIndex", {
get: function() {
for (var e = 0; e < this.length; e++)
if (this[e].selected)
return e;
return -1
},
set: function() {}
}),
t
}
We(e, i);
var t = e.prototype;
return t.addTrack = function(e) {
var t = this;
e.selected && yn(this, e),
i.prototype.addTrack.call(this, e),
e.addEventListener && (e.selectedChange_ = function() {
t.changing_ || (t.changing_ = !0,
yn(t, e),
t.changing_ = !1,
t.trigger("change"))
}
,
e.addEventListener("selectedchange", e.selectedChange_))
}
,
t.removeTrack = function(e) {
i.prototype.removeTrack.call(this, e),
e.removeEventListener && e.selectedChange_ && (e.removeEventListener("selectedchange", e.selectedChange_),
e.selectedChange_ = null)
}
,
e
}(fn)
, Cn = function(n) {
function e() {
return n.apply(this, arguments) || this
}
We(e, n);
var t = e.prototype;
return t.addTrack = function(e) {
var t = this;
n.prototype.addTrack.call(this, e),
this.queueChange_ || (this.queueChange_ = function() {
return t.queueTrigger("change")
}
),
this.triggerSelectedlanguagechange || (this.triggerSelectedlanguagechange_ = function() {
return t.trigger("selectedlanguagechange")
}
),
e.addEventListener("modechange", this.queueChange_);
-1 === ["metadata", "chapters"].indexOf(e.kind) && e.addEventListener("modechange", this.triggerSelectedlanguagechange_)
}
,
t.removeTrack = function(e) {
n.prototype.removeTrack.call(this, e),
e.removeEventListener && (this.queueChange_ && e.removeEventListener("modechange", this.queueChange_),
this.selectedlanguagechange_ && e.removeEventListener("modechange", this.triggerSelectedlanguagechange_))
}
,
e
}(fn)
, kn = function() {
function e(e) {
void 0 === e && (e = []),
this.trackElements_ = [],
Object.defineProperty(this, "length", {
get: function() {
return this.trackElements_.length
}
});
for (var t = 0, n = e.length; t < n; t++)
this.addTrackElement_(e[t])
}
var t = e.prototype;
return t.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)
}
,
t.getTrackElementByTrack_ = function(e) {
for (var t, n = 0, i = this.trackElements_.length; n < i; n++)
if (e === this.trackElements_[n].track) {
t = this.trackElements_[n];
break
}
return t
}
,
t.removeTrackElement_ = function(e) {
for (var t = 0, n = this.trackElements_.length; t < n; t++)
if (e === this.trackElements_[t]) {
this.trackElements_[t].track && "function" == typeof this.trackElements_[t].track.off && this.trackElements_[t].track.off(),
"function" == typeof this.trackElements_[t].off && this.trackElements_[t].off(),
this.trackElements_.splice(t, 1);
break
}
}
,
e
}()
, En = function() {
function t(e) {
t.prototype.setCues_.call(this, e),
Object.defineProperty(this, "length", {
get: function() {
return this.length_
}
})
}
var e = t.prototype;
return e.setCues_ = function(e) {
var t = this.length || 0
, n = 0
, i = e.length;
this.cues_ = e,
this.length_ = e.length;
function r(e) {
"" + e in this || Object.defineProperty(this, "" + e, {
get: function() {
return this.cues_[e]
}
})
}
if (t < i)
for (n = t; n < i; n++)
r.call(this, n)
}
,
e.getCueById = function(e) {
for (var t = null, n = 0, i = this.length; n < i; n++) {
var r = this[n];
if (r.id === e) {
t = r;
break
}
}
return t
}
,
t
}()
, Sn = {
alternative: "alternative",
captions: "captions",
main: "main",
sign: "sign",
subtitles: "subtitles",
commentary: "commentary"
}
, wn = {
alternative: "alternative",
descriptions: "descriptions",
main: "main",
"main-desc": "main-desc",
translation: "translation",
commentary: "commentary"
}
, xn = {
subtitles: "subtitles",
captions: "captions",
descriptions: "descriptions",
chapters: "chapters",
metadata: "metadata"
}
, An = {
disabled: "disabled",
hidden: "hidden",
showing: "showing"
}
, Pn = function(s) {
function e(e) {
var t;
void 0 === e && (e = {}),
t = s.call(this) || this;
function n(e) {
Object.defineProperty(Ve(t), e, {
get: function() {
return i[e]
},
set: function() {}
})
}
var i = {
id: e.id || "vjs_track_" + le(),
kind: e.kind || "",
label: e.label || "",
language: e.language || ""
};
for (var r in i)
n(r);
return t
}
return We(e, s),
e
}(ke)
, Ln = function(u) {
function e(e) {
var t;
if (void 0 === e && (e = {}),
!e.tech)
throw new Error("A tech was not provided.");
var n = Fe(e, {
kind: xn[e.kind] || "subtitles",
language: e.language || e.srclang || ""
})
, i = An[n.mode] || "disabled"
, r = n.default;
"metadata" !== n.kind && "chapters" !== n.kind || (i = "hidden"),
(t = u.call(this, n) || this).tech_ = n.tech,
t.cues_ = [],
t.activeCues_ = [],
t.preload_ = !1 !== t.tech_.preloadTextTracks;
var s = new En(t.cues_)
, a = new En(t.activeCues_)
, o = !1
, l = Te(Ve(t), function() {
this.activeCues = this.activeCues,
o && (this.trigger("cuechange"),
o = !1)
});
return "disabled" !== i && t.tech_.ready(function() {
t.tech_.on("timeupdate", l)
}, !0),
Object.defineProperties(Ve(t), {
default: {
get: function() {
return r
},
set: function() {}
},
mode: {
get: function() {
return i
},
set: function(e) {
var t = this;
An[e] && (i = e,
this.preload_ || "disabled" === i || 0 !== this.cues.length || _n(this.src, this),
"disabled" !== i ? this.tech_.ready(function() {
t.tech_.on("timeupdate", l)
}, !0) : this.tech_.off("timeupdate", l),
this.trigger("modechange"))
}
},
cues: {
get: function() {
return this.loaded_ ? s : null
},
set: function() {}
},
activeCues: {
get: function() {
if (!this.loaded_)
return null;
if (0 === this.cues.length)
return a;
for (var e = this.tech_.currentTime(), t = [], n = 0, i = this.cues.length; n < i; n++) {
var r = this.cues[n];
r.startTime <= e && r.endTime >= e ? t.push(r) : r.startTime === r.endTime && r.startTime <= e && r.startTime + .5 >= e && t.push(r)
}
if (o = !1,
t.length !== this.activeCues_.length)
o = !0;
else
for (var s = 0; s < t.length; s++)
-1 === this.activeCues_.indexOf(t[s]) && (o = !0);
return this.activeCues_ = t,
a.setCues_(this.activeCues_),
a
},
set: function() {}
}
}),
n.src ? (t.src = n.src,
t.preload_ || (t.loaded_ = !0),
(t.preload_ || r || "subtitles" !== n.kind && "captions" !== n.kind) && _n(t.src, Ve(t))) : t.loaded_ = !0,
t
}
We(e, u);
var t = e.prototype;
return t.addCue = function(e) {
var t = e;
if (p.vttjs && !(e instanceof p.vttjs.VTTCue)) {
for (var n in t = new p.vttjs.VTTCue(e.startTime,e.endTime,e.text),
e)
n in t || (t[n] = e[n]);
t.id = e.id,
t.originalCue_ = e
}
for (var i = this.tech_.textTracks(), r = 0; r < i.length; r++)
i[r] !== this && i[r].removeCue(t);
this.cues_.push(t),
this.cues.setCues_(this.cues_)
}
,
t.removeCue = function(e) {
for (var t = this.cues_.length; t--; ) {
var n = this.cues_[t];
if (n === e || n.originalCue_ && n.originalCue_ === e) {
this.cues_.splice(t, 1),
this.cues.setCues_(this.cues_);
break
}
}
}
,
e
}(Pn);
Ln.prototype.allowedEvents_ = {
cuechange: "cuechange"
};
var In = function(r) {
function e(e) {
var t;
void 0 === e && (e = {});
var n = Fe(e, {
kind: wn[e.kind] || ""
});
t = r.call(this, n) || this;
var i = !1;
return Object.defineProperty(Ve(t), "enabled", {
get: function() {
return i
},
set: function(e) {
"boolean" == typeof e && e !== i && (i = e,
this.trigger("enabledchange"))
}
}),
n.enabled && (t.enabled = n.enabled),
t.loaded_ = !0,
t
}
return We(e, r),
e
}(Pn)
, Mn = function(r) {
function e(e) {
var t;
void 0 === e && (e = {});
var n = Fe(e, {
kind: Sn[e.kind] || ""
});
t = r.call(this, n) || this;
var i = !1;
return Object.defineProperty(Ve(t), "selected", {
get: function() {
return i
},
set: function(e) {
"boolean" == typeof e && e !== i && (i = e,
this.trigger("selectedchange"))
}
}),
n.selected && (t.selected = n.selected),
t
}
return We(e, r),
e
}(Pn)
, jn = function(r) {
function e(e) {
var t, n;
void 0 === e && (e = {}),
t = r.call(this) || this;
var i = new Ln(e);
return t.kind = i.kind,
t.src = i.src,
t.srclang = i.language,
t.label = i.label,
t.default = i.default,
Object.defineProperties(Ve(t), {
readyState: {
get: function() {
return n
}
},
track: {
get: function() {
return i
}
}
}),
n = 0,
i.addEventListener("loadeddata", function() {
n = 2,
t.trigger({
type: "load",
target: Ve(t)
})
}),
t
}
return We(e, r),
e
}(ke);
jn.prototype.allowedEvents_ = {
load: "load"
},
jn.NONE = 0,
jn.LOADING = 1,
jn.LOADED = 2,
jn.ERROR = 3;
var On = {
audio: {
ListClass: bn,
TrackClass: In,
capitalName: "Audio"
},
video: {
ListClass: Tn,
TrackClass: Mn,
capitalName: "Video"
},
text: {
ListClass: Cn,
TrackClass: Ln,
capitalName: "Text"
}
};
Object.keys(On).forEach(function(e) {
On[e].getterName = e + "Tracks",
On[e].privateName = e + "Tracks_"
});
var Nn = {
remoteText: {
ListClass: Cn,
TrackClass: Ln,
capitalName: "RemoteText",
getterName: "remoteTextTracks",
privateName: "remoteTextTracks_"
},
remoteTextEl: {
ListClass: kn,
TrackClass: jn,
capitalName: "RemoteTextTrackEls",
getterName: "remoteTextTrackEls",
privateName: "remoteTextTrackEls_"
}
}
, Dn = r({}, On, Nn);
Nn.names = Object.keys(Nn),
On.names = Object.keys(On),
Dn.names = [].concat(Nn.names).concat(On.names);
var Bn = Object.create || function(e) {
if (1 !== arguments.length)
throw new Error("Object.create shim only accepts one parameter.");
return Rn.prototype = e,
new Rn
}
;
function Rn() {}
function Fn(e, t) {
this.name = "ParsingError",
this.code = e.code,
this.message = t || e.message
}
function Hn(e) {
function t(e, t, n, i) {
return 3600 * (0 | e) + 60 * (0 | t) + (0 | n) + (0 | i) / 1e3
}
var n = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
return n ? n[3] ? t(n[1], n[2], n[3].replace(":", ""), n[4]) : 59 < n[1] ? t(n[1], n[2], 0, n[4]) : t(0, n[1], n[2], n[4]) : null
}
function Vn() {
this.values = Bn(null)
}
function Qn(e, t, n, i) {
var r = i ? e.split(i) : [e];
for (var s in r)
if ("string" == typeof r[s]) {
var a = r[s].split(n);
if (2 === a.length)
t(a[0], a[1])
}
}
function Un(t, e, a) {
var n = t;
function i() {
var e = Hn(t);
if (null === e)
throw new Fn(Fn.Errors.BadTimeStamp,"Malformed timestamp: " + n);
return t = t.replace(/^[^\sa-zA-Z-]+/, ""),
e
}
function r() {
t = t.replace(/^\s+/, "")
}
if (r(),
e.startTime = i(),
r(),
"--\x3e" !== t.substr(0, 3))
throw new Fn(Fn.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): " + n);
t = t.substr(3),
r(),
e.endTime = i(),
r(),
function(e, t) {
var s = new Vn;
Qn(e, function(e, t) {
switch (e) {
case "region":
for (var n = a.length - 1; 0 <= n; n--)
if (a[n].id === t) {
s.set(e, a[n].region);
break
}
break;
case "vertical":
s.alt(e, t, ["rl", "lr"]);
break;
case "line":
var i = t.split(",")
, r = i[0];
s.integer(e, r),
s.percent(e, r) && s.set("snapToLines", !1),
s.alt(e, r, ["auto"]),
2 === i.length && s.alt("lineAlign", i[1], ["start", "center", "end"]);
break;
case "position":
i = t.split(","),
s.percent(e, i[0]),
2 === i.length && s.alt("positionAlign", i[1], ["start", "center", "end"]);
break;
case "size":
s.percent(e, t);
break;
case "align":
s.alt(e, t, ["start", "center", "end", "left", "right"])
}
}, /:/, /\s/),
t.region = s.get("region", null),
t.vertical = s.get("vertical", "");
try {
t.line = s.get("line", "auto")
} catch (e) {}
t.lineAlign = s.get("lineAlign", "start"),
t.snapToLines = s.get("snapToLines", !0),
t.size = s.get("size", 100);
try {
t.align = s.get("align", "center")
} catch (e) {
t.align = s.get("align", "middle")
}
try {
t.position = s.get("position", "auto")
} catch (e) {
t.position = s.get("position", {
start: 0,
left: 0,
center: 50,
middle: 50,
end: 100,
right: 100
}, t.align)
}
t.positionAlign = s.get("positionAlign", {
start: "start",
left: "start",
center: "center",
middle: "center",
end: "end",
right: "end"
}, t.align)
}(t, e)
}
((Fn.prototype = Bn(Error.prototype)).constructor = Fn).Errors = {
BadSignature: {
code: 0,
message: "Malformed WebVTT signature."
},
BadTimeStamp: {
code: 1,
message: "Malformed time stamp."
}
},
Vn.prototype = {
set: function(e, t) {
this.get(e) || "" === t || (this.values[e] = t)
},
get: function(e, t, n) {
return n ? this.has(e) ? this.values[e] : t[n] : this.has(e) ? this.values[e] : t
},
has: function(e) {
return e in this.values
},
alt: function(e, t, n) {
for (var i = 0; i < n.length; ++i)
if (t === n[i]) {
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 qn = f.createElement("textarea")
, zn = {
c: "span",
i: "i",
b: "b",
u: "u",
ruby: "ruby",
rt: "rt",
v: "span",
lang: "span"
}
, Wn = {
white: "rgba(255,255,255,1)",
lime: "rgba(0,255,0,1)",
cyan: "rgba(0,255,255,1)",
red: "rgba(255,0,0,1)",
yellow: "rgba(255,255,0,1)",
magenta: "rgba(255,0,255,1)",
blue: "rgba(0,0,255,1)",
black: "rgba(0,0,0,1)"
}
, Kn = {
v: "title",
lang: "lang"
}
, Xn = {
rt: "ruby"
};
function Gn(s, n) {
function e() {
if (!n)
return null;
var e, t = n.match(/^([^<]*)(<[^>]*>?)?/);
return e = t[1] ? t[1] : t[2],
n = n.substr(e.length),
e
}
function t(e, t) {
var n = zn[e];
if (!n)
return null;
var i = s.document.createElement(n)
, r = Kn[e];
return r && t && (i[r] = t.trim()),
i
}
for (var i, r, a, o, l = s.document.createElement("div"), u = l, c = []; null !== (i = e()); )
if ("<" !== i[0])
u.appendChild(s.document.createTextNode((r = i,
qn.innerHTML = r,
r = qn.textContent,
qn.textContent = "",
r)));
else {
if ("/" === i[1]) {
c.length && c[c.length - 1] === i.substr(2).replace(">", "") && (c.pop(),
u = u.parentNode);
continue
}
var h, d = Hn(i.substr(1, i.length - 2));
if (d) {
h = s.document.createProcessingInstruction("timestamp", d),
u.appendChild(h);
continue
}
var p = i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
if (!p)
continue;
if (!(h = t(p[1], p[3])))
continue;
if (a = u,
Xn[(o = h).localName] && Xn[o.localName] !== a.localName)
continue;
if (p[2]) {
var f = p[2].split(".");
f.forEach(function(e) {
var t = /^bg_/.test(e)
, n = t ? e.slice(3) : e;
if (Wn.hasOwnProperty(n)) {
var i = t ? "background-color" : "color"
, r = Wn[n];
h.style[i] = r
}
}),
h.className = f.join(" ")
}
c.push(p[1]),
u.appendChild(h),
u = h
}
return l
}
var Yn = [[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 $n(e) {
for (var t = 0; t < Yn.length; t++) {
var n = Yn[t];
if (e >= n[0] && e <= n[1])
return !0
}
return !1
}
function Jn() {}
function Zn(e, t, n) {
Jn.call(this),
this.cue = t,
this.cueDiv = Gn(e, t.text);
var i = {
color: "rgba(255, 255, 255, 1)",
backgroundColor: "rgba(0, 0, 0, 0.8)",
position: "relative",
left: 0,
right: 0,
top: 0,
bottom: 0,
display: "inline",
writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
unicodeBidi: "plaintext"
};
this.applyStyles(i, this.cueDiv),
this.div = e.document.createElement("div"),
i = {
direction: function(e) {
var t = []
, n = "";
if (!e || !e.childNodes)
return "ltr";
function r(e, t) {
for (var n = t.childNodes.length - 1; 0 <= n; n--)
e.push(t.childNodes[n])
}
function s(e) {
if (!e || !e.length)
return null;
var t = e.pop()
, n = t.textContent || t.innerText;
if (n) {
var i = n.match(/^.*(\n|\r)/);
return i ? i[e.length = 0] : n
}
return "ruby" === t.tagName ? s(e) : t.childNodes ? (r(e, t),
s(e)) : void 0
}
for (r(t, e); n = s(t); )
for (var i = 0; i < n.length; i++)
if ($n(n.charCodeAt(i)))
return "rtl";
return "ltr"
}(this.cueDiv),
writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
unicodeBidi: "plaintext",
textAlign: "middle" === t.align ? "center" : t.align,
font: n.font,
whiteSpace: "pre-line",
position: "absolute"
},
this.applyStyles(i),
this.div.appendChild(this.cueDiv);
var r = 0;
switch (t.positionAlign) {
case "start":
r = t.position;
break;
case "center":
r = t.position - t.size / 2;
break;
case "end":
r = t.position - t.size
}
"" === t.vertical ? this.applyStyles({
left: this.formatStyle(r, "%"),
width: this.formatStyle(t.size, "%")
}) : this.applyStyles({
top: this.formatStyle(r, "%"),
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 ei(e) {
var t, n, i, r;
if (e.div) {
n = e.div.offsetHeight,
i = e.div.offsetWidth,
r = e.div.offsetTop;
var s = (s = e.div.childNodes) && (s = s[0]) && s.getClientRects && s.getClientRects();
e = e.div.getBoundingClientRect(),
t = s ? Math.max(s[0] && s[0].height || 0, e.height / s.length) : 0
}
this.left = e.left,
this.right = e.right,
this.top = e.top || r,
this.height = e.height || n,
this.bottom = e.bottom || r + (e.height || n),
this.width = e.width || i,
this.lineHeight = void 0 !== t ? t : e.lineHeight
}
function ti(e, t, o, l) {
var n = new ei(t)
, i = t.cue
, r = 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, n = t.textTrackList, i = 0, r = 0; r < n.length && n[r] !== t; r++)
"showing" === n[r].mode && i++;
return -1 * ++i
}(i)
, s = [];
if (i.snapToLines) {
var a;
switch (i.vertical) {
case "":
s = ["+y", "-y"],
a = "height";
break;
case "rl":
s = ["+x", "-x"],
a = "width";
break;
case "lr":
s = ["-x", "+x"],
a = "width"
}
var u = n.lineHeight
, c = u * Math.round(r)
, h = o[a] + u
, d = s[0];
Math.abs(c) > h && (c = c < 0 ? -1 : 1,
c *= Math.ceil(h / u) * u),
r < 0 && (c += "" === i.vertical ? o.height : o.width,
s = s.reverse()),
n.move(d, c)
} else {
var p = n.lineHeight / o.height * 100;
switch (i.lineAlign) {
case "center":
r -= p / 2;
break;
case "end":
r -= p
}
switch (i.vertical) {
case "":
t.applyStyles({
top: t.formatStyle(r, "%")
});
break;
case "rl":
t.applyStyles({
left: t.formatStyle(r, "%")
});
break;
case "lr":
t.applyStyles({
right: t.formatStyle(r, "%")
})
}
s = ["+y", "-x", "+x", "-y"],
n = new ei(t)
}
var f = function(e, t) {
for (var n, i = new ei(e), r = 1, s = 0; s < t.length; s++) {
for (; e.overlapsOppositeAxis(o, t[s]) || e.within(o) && e.overlapsAny(l); )
e.move(t[s]);
if (e.within(o))
return e;
var a = e.intersectPercentage(o);
a < r && (n = new ei(e),
r = a),
e = new ei(i)
}
return n || i
}(n, s);
t.move(f.toCSSCompatValues(o))
}
function ni() {}
Jn.prototype.applyStyles = function(e, t) {
for (var n in t = t || this.div,
e)
e.hasOwnProperty(n) && (t.style[n] = e[n])
}
,
Jn.prototype.formatStyle = function(e, t) {
return 0 === e ? 0 : e + t
}
,
(Zn.prototype = Bn(Jn.prototype)).constructor = Zn,
ei.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
}
}
,
ei.prototype.overlaps = function(e) {
return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top
}
,
ei.prototype.overlapsAny = function(e) {
for (var t = 0; t < e.length; t++)
if (this.overlaps(e[t]))
return !0;
return !1
}
,
ei.prototype.within = function(e) {
return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right
}
,
ei.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
}
}
,
ei.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)
}
,
ei.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
}
}
,
ei.getSimpleBoxPosition = function(e) {
var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0
, n = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0
, i = 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 || i,
height: e.height || t,
bottom: e.bottom || i + (e.height || t),
width: e.width || n
}
}
,
ni.StringDecoder = function() {
return {
decode: function(e) {
if (!e)
return "";
if ("string" != typeof e)
throw new Error("Error - expected string data.");
return decodeURIComponent(encodeURIComponent(e))
}
}
}
,
ni.convertCueToDOMTree = function(e, t) {
return e && t ? Gn(e, t) : null
}
;
ni.processCues = function(i, r, e) {
if (!i || !r || !e)
return null;
for (; e.firstChild; )
e.removeChild(e.firstChild);
var s = i.document.createElement("div");
if (s.style.position = "absolute",
s.style.left = "0",
s.style.right = "0",
s.style.top = "0",
s.style.bottom = "0",
s.style.margin = "1.5%",
e.appendChild(s),
function(e) {
for (var t = 0; t < e.length; t++)
if (e[t].hasBeenReset || !e[t].displayState)
return !0;
return !1
}(r)) {
var a = []
, o = ei.getSimpleBoxPosition(s)
, l = {
font: Math.round(.05 * o.height * 100) / 100 + "px sans-serif"
};
!function() {
for (var e, t, n = 0; n < r.length; n++)
t = r[n],
e = new Zn(i,t,l),
s.appendChild(e.div),
ti(0, e, o, a),
t.displayState = e.div,
a.push(ei.getSimpleBoxPosition(e))
}()
} else
for (var t = 0; t < r.length; t++)
s.appendChild(r[t].displayState)
}
,
(ni.Parser = function(e, t, n) {
n || (n = t,
t = {}),
t = t || {},
this.window = e,
this.vttjs = t,
this.state = "INITIAL",
this.buffer = "",
this.decoder = n || new TextDecoder("utf8"),
this.regionList = []
}
).prototype = {
reportOrThrowError: function(e) {
if (!(e instanceof Fn))
throw e;
this.onparsingerror && this.onparsingerror(e)
},
parse: function(e) {
var i = this;
function t() {
for (var e = i.buffer, t = 0; t < e.length && "\r" !== e[t] && "\n" !== e[t]; )
++t;
var n = e.substr(0, t);
return "\r" === e[t] && ++t,
"\n" === e[t] && ++t,
i.buffer = e.substr(t),
n
}
function n(e) {
e.match(/X-TIMESTAMP-MAP/) ? Qn(e, function(e, t) {
switch (e) {
case "X-TIMESTAMP-MAP":
!function(e) {
var n = new Vn;
Qn(e, function(e, t) {
switch (e) {
case "MPEGT":
n.integer(e + "S", t);
break;
case "LOCA":
n.set(e + "L", Hn(t))
}
}, /[^\d]:/, /,/),
i.ontimestampmap && i.ontimestampmap({
MPEGTS: n.get("MPEGTS"),
LOCAL: n.get("LOCAL")
})
}(t)
}
}, /=/) : Qn(e, function(e, t) {
switch (e) {
case "Region":
!function(e) {
var r = new Vn;
if (Qn(e, function(e, t) {
switch (e) {
case "id":
r.set(e, t);
break;
case "width":
r.percent(e, t);
break;
case "lines":
r.integer(e, t);
break;
case "regionanchor":
case "viewportanchor":
var n = t.split(",");
if (2 !== n.length)
break;
var i = new Vn;
if (i.percent("x", n[0]),
i.percent("y", n[1]),
!i.has("x") || !i.has("y"))
break;
r.set(e + "X", i.get("x")),
r.set(e + "Y", i.get("y"));
break;
case "scroll":
r.alt(e, t, ["up"])
}
}, /=/, /\s/),
r.has("id")) {
var t = new (i.vttjs.VTTRegion || i.window.VTTRegion);
t.width = r.get("width", 100),
t.lines = r.get("lines", 3),
t.regionAnchorX = r.get("regionanchorX", 0),
t.regionAnchorY = r.get("regionanchorY", 100),
t.viewportAnchorX = r.get("viewportanchorX", 0),
t.viewportAnchorY = r.get("viewportanchorY", 100),
t.scroll = r.get("scroll", ""),
i.onregion && i.onregion(t),
i.regionList.push({
id: r.get("id"),
region: t
})
}
}(t)
}
}, /:/)
}
e && (i.buffer += i.decoder.decode(e, {
stream: !0
}));
try {
var r;
if ("INITIAL" === i.state) {
if (!/\r\n|\n/.test(i.buffer))
return this;
var s = (r = t()).match(/^WEBVTT([ \t].*)?$/);
if (!s || !s[0])
throw new Fn(Fn.Errors.BadSignature);
i.state = "HEADER"
}
for (var a = !1; i.buffer; ) {
if (!/\r\n|\n/.test(i.buffer))
return this;
switch (a ? a = !1 : r = t(),
i.state) {
case "HEADER":
/:/.test(r) ? n(r) : r || (i.state = "ID");
continue;
case "NOTE":
r || (i.state = "ID");
continue;
case "ID":
if (/^NOTE($|[ \t])/.test(r)) {
i.state = "NOTE";
break
}
if (!r)
continue;
i.cue = new (i.vttjs.VTTCue || i.window.VTTCue)(0,0,"");
try {
i.cue.align = "center"
} catch (e) {
i.cue.align = "middle"
}
if (i.state = "CUE",
-1 === r.indexOf("--\x3e")) {
i.cue.id = r;
continue
}
case "CUE":
try {
Un(r, i.cue, i.regionList)
} catch (e) {
i.reportOrThrowError(e),
i.cue = null,
i.state = "BADCUE";
continue
}
i.state = "CUETEXT";
continue;
case "CUETEXT":
var o = -1 !== r.indexOf("--\x3e");
if (!r || o && (a = !0)) {
i.oncue && i.oncue(i.cue),
i.cue = null,
i.state = "ID";
continue
}
i.cue.text && (i.cue.text += "\n"),
i.cue.text += r.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
continue;
case "BADCUE":
r || (i.state = "ID");
continue
}
}
} catch (e) {
i.reportOrThrowError(e),
"CUETEXT" === i.state && i.cue && i.oncue && i.oncue(i.cue),
i.cue = null,
i.state = "INITIAL" === i.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 Fn(Fn.Errors.BadSignature)
} catch (e) {
t.reportOrThrowError(e)
}
return t.onflush && t.onflush(),
this
}
};
var ii = ni
, ri = {
"": 1,
lr: 1,
rl: 1
}
, si = {
start: 1,
center: 1,
end: 1,
left: 1,
right: 1,
auto: 1,
"line-left": 1,
"line-right": 1
};
function ai(e) {
return "string" == typeof e && (!!si[e.toLowerCase()] && e.toLowerCase())
}
function oi(e, t, n) {
this.hasBeenReset = !1;
var i = ""
, r = !1
, s = e
, a = t
, o = n
, l = null
, u = ""
, c = !0
, h = "auto"
, d = "start"
, p = "auto"
, f = "auto"
, v = 100
, g = "center";
Object.defineProperties(this, {
id: {
enumerable: !0,
get: function() {
return i
},
set: function(e) {
i = "" + e
}
},
pauseOnExit: {
enumerable: !0,
get: function() {
return r
},
set: function(e) {
r = !!e
}
},
startTime: {
enumerable: !0,
get: function() {
return s
},
set: function(e) {
if ("number" != typeof e)
throw new TypeError("Start time must be set to a number.");
s = e,
this.hasBeenReset = !0
}
},
endTime: {
enumerable: !0,
get: function() {
return a
},
set: function(e) {
if ("number" != typeof e)
throw new TypeError("End time must be set to a number.");
a = e,
this.hasBeenReset = !0
}
},
text: {
enumerable: !0,
get: function() {
return o
},
set: function(e) {
o = "" + e,
this.hasBeenReset = !0
}
},
region: {
enumerable: !0,
get: function() {
return l
},
set: function(e) {
l = e,
this.hasBeenReset = !0
}
},
vertical: {
enumerable: !0,
get: function() {
return u
},
set: function(e) {
var t = function(e) {
return "string" == typeof e && (!!ri[e.toLowerCase()] && e.toLowerCase())
}(e);
if (!1 === t)
throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
u = t,
this.hasBeenReset = !0
}
},
snapToLines: {
enumerable: !0,
get: function() {
return c
},
set: function(e) {
c = !!e,
this.hasBeenReset = !0
}
},
line: {
enumerable: !0,
get: function() {
return h
},
set: function(e) {
if ("number" != typeof e && "auto" !== e)
throw new SyntaxError("Line: an invalid number or illegal string was specified.");
h = e,
this.hasBeenReset = !0
}
},
lineAlign: {
enumerable: !0,
get: function() {
return d
},
set: function(e) {
var t = ai(e);
t && (d = t,
this.hasBeenReset = !0)
}
},
position: {
enumerable: !0,
get: function() {
return p
},
set: function(e) {
if (e < 0 || 100 < e)
throw new Error("Position must be between 0 and 100.");
p = e,
this.hasBeenReset = !0
}
},
positionAlign: {
enumerable: !0,
get: function() {
return f
},
set: function(e) {
var t = ai(e);
t && (f = t,
this.hasBeenReset = !0)
}
},
size: {
enumerable: !0,
get: function() {
return v
},
set: function(e) {
if (e < 0 || 100 < e)
throw new Error("Size must be between 0 and 100.");
v = e,
this.hasBeenReset = !0
}
},
align: {
enumerable: !0,
get: function() {
return g
},
set: function(e) {
var t = ai(e);
if (!t)
throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
g = t,
this.hasBeenReset = !0
}
}
}),
this.displayState = void 0
}
oi.prototype.getCueAsHTML = function() {
return WebVTT.convertCueToDOMTree(window, this.text)
}
;
var li = oi
, ui = {
"": !0,
up: !0
};
function ci(e) {
return "number" == typeof e && 0 <= e && e <= 100
}
function hi() {
var t = 100
, n = 3
, i = 0
, r = 100
, s = 0
, a = 100
, o = "";
Object.defineProperties(this, {
width: {
enumerable: !0,
get: function() {
return t
},
set: function(e) {
if (!ci(e))
throw new Error("Width must be between 0 and 100.");
t = e
}
},
lines: {
enumerable: !0,
get: function() {
return n
},
set: function(e) {
if ("number" != typeof e)
throw new TypeError("Lines must be set to a number.");
n = e
}
},
regionAnchorY: {
enumerable: !0,
get: function() {
return r
},
set: function(e) {
if (!ci(e))
throw new Error("RegionAnchorX must be between 0 and 100.");
r = e
}
},
regionAnchorX: {
enumerable: !0,
get: function() {
return i
},
set: function(e) {
if (!ci(e))
throw new Error("RegionAnchorY must be between 0 and 100.");
i = e
}
},
viewportAnchorY: {
enumerable: !0,
get: function() {
return a
},
set: function(e) {
if (!ci(e))
throw new Error("ViewportAnchorY must be between 0 and 100.");
a = e
}
},
viewportAnchorX: {
enumerable: !0,
get: function() {
return s
},
set: function(e) {
if (!ci(e))
throw new Error("ViewportAnchorX must be between 0 and 100.");
s = e
}
},
scroll: {
enumerable: !0,
get: function() {
return o
},
set: function(e) {
var t = function(e) {
return "string" == typeof e && (!!ui[e.toLowerCase()] && e.toLowerCase())
}(e);
!1 === t || (o = t)
}
}
})
}
var di = n(function(e) {
var t = e.exports = {
WebVTT: ii,
VTTCue: li,
VTTRegion: hi
};
p.vttjs = t,
p.WebVTT = t.WebVTT;
var n = t.VTTCue
, i = t.VTTRegion
, r = p.VTTCue
, s = p.VTTRegion;
t.shim = function() {
p.VTTCue = n,
p.VTTRegion = i
}
,
t.restore = function() {
p.VTTCue = r,
p.VTTRegion = s
}
,
p.VTTCue || t.shim()
});
di.WebVTT,
di.VTTCue,
di.VTTRegion;
var pi = function(t) {
function n(n, e) {
var i;
return void 0 === n && (n = {}),
void 0 === e && (e = function() {}
),
n.reportTouchActivity = !1,
(i = t.call(this, null, n, e) || this).hasStarted_ = !1,
i.on("playing", function() {
this.hasStarted_ = !0
}),
i.on("loadstart", function() {
this.hasStarted_ = !1
}),
Dn.names.forEach(function(e) {
var t = Dn[e];
n && n[t.getterName] && (i[t.privateName] = n[t.getterName])
}),
i.featuresProgressEvents || i.manualProgressOn(),
i.featuresTimeupdateEvents || i.manualTimeUpdatesOn(),
["Text", "Audio", "Video"].forEach(function(e) {
!1 === n["native" + e + "Tracks"] && (i["featuresNative" + e + "Tracks"] = !1)
}),
!1 === n.nativeCaptions || !1 === n.nativeTextTracks ? i.featuresNativeTextTracks = !1 : !0 !== n.nativeCaptions && !0 !== n.nativeTextTracks || (i.featuresNativeTextTracks = !0),
i.featuresNativeTextTracks || i.emulateTextTracks(),
i.preloadTextTracks = !1 !== n.preloadTextTracks,
i.autoRemoteTextTracks_ = new Dn.text.ListClass,
i.initTrackListeners(),
n.nativeControlsForTouch || i.emitTapEvents(),
i.constructor && (i.name_ = i.constructor.name || "Unknown Tech"),
i
}
We(n, t);
var e = n.prototype;
return e.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"
})
}
,
e.manualProgressOn = function() {
this.on("durationchange", this.onDurationChange),
this.manualProgress = !0,
this.one("ready", this.trackProgress)
}
,
e.manualProgressOff = function() {
this.manualProgress = !1,
this.stopTrackingProgress(),
this.off("durationchange", this.onDurationChange)
}
,
e.trackProgress = function(e) {
this.stopTrackingProgress(),
this.progressInterval = this.setInterval(Te(this, function() {
var e = this.bufferedPercent();
this.bufferedPercent_ !== e && this.trigger("progress"),
1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress()
}), 500)
}
,
e.onDurationChange = function(e) {
this.duration_ = this.duration()
}
,
e.buffered = function() {
return gt(0, 0)
}
,
e.bufferedPercent = function() {
return yt(this.buffered(), this.duration_)
}
,
e.stopTrackingProgress = function() {
this.clearInterval(this.progressInterval)
}
,
e.manualTimeUpdatesOn = function() {
this.manualTimeUpdates = !0,
this.on("play", this.trackCurrentTime),
this.on("pause", this.stopTrackingCurrentTime)
}
,
e.manualTimeUpdatesOff = function() {
this.manualTimeUpdates = !1,
this.stopTrackingCurrentTime(),
this.off("play", this.trackCurrentTime),
this.off("pause", this.stopTrackingCurrentTime)
}
,
e.trackCurrentTime = function() {
this.currentTimeInterval && this.stopTrackingCurrentTime(),
this.currentTimeInterval = this.setInterval(function() {
this.trigger({
type: "timeupdate",
target: this,
manuallyTriggered: !0
})
}, 250)
}
,
e.stopTrackingCurrentTime = function() {
this.clearInterval(this.currentTimeInterval),
this.trigger({
type: "timeupdate",
target: this,
manuallyTriggered: !0
})
}
,
e.dispose = function() {
this.clearTracks(On.names),
this.manualProgress && this.manualProgressOff(),
this.manualTimeUpdates && this.manualTimeUpdatesOff(),
t.prototype.dispose.call(this)
}
,
e.clearTracks = function(e) {
var r = this;
(e = [].concat(e)).forEach(function(e) {
for (var t = r[e + "Tracks"]() || [], n = t.length; n--; ) {
var i = t[n];
"text" === e && r.removeRemoteTextTrack(i),
t.removeTrack(i)
}
})
}
,
e.cleanupAutoTextTracks = function() {
for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--; ) {
var n = e[t];
this.removeRemoteTextTrack(n)
}
}
,
e.reset = function() {}
,
e.error = function(e) {
return void 0 !== e && (this.error_ = new Et(e),
this.trigger("error")),
this.error_
}
,
e.played = function() {
return this.hasStarted_ ? gt(0, 0) : gt()
}
,
e.setCurrentTime = function() {
this.manualTimeUpdates && this.trigger({
type: "timeupdate",
target: this,
manuallyTriggered: !0
})
}
,
e.initTrackListeners = function() {
var r = this;
On.names.forEach(function(e) {
function t() {
r.trigger(e + "trackchange")
}
var n = On[e]
, i = r[n.getterName]();
i.addEventListener("removetrack", t),
i.addEventListener("addtrack", t),
r.on("dispose", function() {
i.removeEventListener("removetrack", t),
i.removeEventListener("addtrack", t)
})
})
}
,
e.addWebVttScript_ = function() {
var e = this;
if (!p.WebVTT)
if (f.body.contains(this.el())) {
if (!this.options_["vtt.js"] && c(di) && 0 < Object.keys(di).length)
return void this.trigger("vttjsloaded");
var t = f.createElement("script");
t.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/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_)
}
,
e.emulateTextTracks = function() {
function t(e) {
return i.addTrack(e.track)
}
function n(e) {
return i.removeTrack(e.track)
}
var e = this
, i = this.textTracks()
, r = this.remoteTextTracks();
r.on("addtrack", t),
r.on("removetrack", n),
this.addWebVttScript_();
function s() {
return e.trigger("texttrackchange")
}
function a() {
s();
for (var e = 0; e < i.length; e++) {
var t = i[e];
t.removeEventListener("cuechange", s),
"showing" === t.mode && t.addEventListener("cuechange", s)
}
}
a(),
i.addEventListener("change", a),
i.addEventListener("addtrack", a),
i.addEventListener("removetrack", a),
this.on("dispose", function() {
r.off("addtrack", t),
r.off("removetrack", n),
i.removeEventListener("change", a),
i.removeEventListener("addtrack", a),
i.removeEventListener("removetrack", a);
for (var e = 0; e < i.length; e++) {
i[e].removeEventListener("cuechange", s)
}
})
}
,
e.addTextTrack = function(e, t, n) {
if (!e)
throw new Error("TextTrack kind is required but was not provided");
return function(e, t, n, i, r) {
void 0 === r && (r = {});
var s = e.textTracks();
r.kind = t,
n && (r.label = n),
i && (r.language = i),
r.tech = e;
var a = new Dn.text.TrackClass(r);
return s.addTrack(a),
a
}(this, e, t, n)
}
,
e.createRemoteTextTrack = function(e) {
var t = Fe(e, {
tech: this
});
return new Nn.remoteTextEl.TrackClass(t)
}
,
e.addRemoteTextTrack = function(e, t) {
var n = this;
void 0 === e && (e = {});
var i = this.createRemoteTextTrack(e);
return !0 !== t && !1 !== t && (m.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),
t = !0),
this.remoteTextTrackEls().addTrackElement_(i),
this.remoteTextTracks().addTrack(i.track),
!0 !== t && this.ready(function() {
return n.autoRemoteTextTracks_.addTrack(i.track)
}),
i
}
,
e.removeRemoteTextTrack = function(e) {
var t = this.remoteTextTrackEls().getTrackElementByTrack_(e);
this.remoteTextTrackEls().removeTrackElement_(t),
this.remoteTextTracks().removeTrack(e),
this.autoRemoteTextTracks_.removeTrack(e)
}
,
e.getVideoPlaybackQuality = function() {
return {}
}
,
e.requestPictureInPicture = function() {
var e = this.options_.Promise || p.Promise;
if (e)
return e.reject()
}
,
e.setPoster = function() {}
,
e.playsinline = function() {}
,
e.setPlaysinline = function() {}
,
e.overrideNativeAudioTracks = function() {}
,
e.overrideNativeVideoTracks = function() {}
,
e.canPlayType = function() {
return ""
}
,
n.canPlayType = function() {
return ""
}
,
n.canPlaySource = function(e, t) {
return n.canPlayType(e.type)
}
,
n.isTech = function(e) {
return e.prototype instanceof n || e instanceof n || e === n
}
,
n.registerTech = function(e, t) {
if (n.techs_ || (n.techs_ = {}),
!n.isTech(t))
throw new Error("Tech " + e + " must be a Tech");
if (!n.canPlayType)
throw new Error("Techs must have a static canPlayType method on them");
if (!n.canPlaySource)
throw new Error("Techs must have a static canPlaySource method on them");
return e = Re(e),
n.techs_[e] = t,
n.techs_[Be(e)] = t,
"Tech" !== e && n.defaultTechOrder_.push(e),
t
}
,
n.getTech = function(e) {
if (e)
return n.techs_ && n.techs_[e] ? n.techs_[e] : (e = Re(e),
p && p.videojs && p.videojs[e] ? (m.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)
}
,
n
}(He);
Dn.names.forEach(function(e) {
var t = Dn[e];
pi.prototype[t.getterName] = function() {
return this[t.privateName] = this[t.privateName] || new t.ListClass,
this[t.privateName]
}
}),
pi.prototype.featuresVolumeControl = !0,
pi.prototype.featuresMuteControl = !0,
pi.prototype.featuresFullscreenResize = !1,
pi.prototype.featuresPlaybackRate = !1,
pi.prototype.featuresPlaybackQuality = !0,
pi.prototype.featuresProgressEvents = !1,
pi.prototype.featuresSourceset = !1,
pi.prototype.featuresTimeupdateEvents = !1,
pi.prototype.featuresNativeTextTracks = !1,
pi.withSourceHandlers = function(r) {
r.registerSourceHandler = function(e, t) {
var n = r.sourceHandlers;
n = n || (r.sourceHandlers = []),
void 0 === t && (t = n.length),
n.splice(t, 0, e)
}
,
r.canPlayType = function(e) {
for (var t, n = r.sourceHandlers || [], i = 0; i < n.length; i++)
if (t = n[i].canPlayType(e))
return t;
return ""
}
,
r.selectSourceHandler = function(e, t) {
for (var n = r.sourceHandlers || [], i = 0; i < n.length; i++)
if (n[i].canHandleSource(e, t))
return n[i];
return null
}
,
r.canPlaySource = function(e, t) {
var n = r.selectSourceHandler(e, t);
return n ? n.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)
}
)
}, r.prototype),
r.prototype.setSource = function(e) {
var t = r.selectSourceHandler(e, this.options_);
t || (r.nativeSourceHandler ? t = r.nativeSourceHandler : m.error("No source handler found for the current source.")),
this.disposeSourceHandler(),
this.off("dispose", this.disposeSourceHandler),
t !== r.nativeSourceHandler && (this.currentSource_ = e),
this.sourceHandler_ = t.handleSource(e, this, this.options_),
this.one("dispose", this.disposeSourceHandler)
}
,
r.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)
}
}
,
He.registerComponent("Tech", pi),
pi.registerTech("Tech", pi),
pi.defaultTechOrder_ = [];
var fi = {}
, vi = {}
, gi = {};
function yi(e, t, n) {
e.setTimeout(function() {
return function n(i, e, r, s, a, o) {
void 0 === i && (i = {});
void 0 === e && (e = []);
void 0 === a && (a = []);
void 0 === o && (o = !1);
var t = e
, l = t[0]
, u = t.slice(1);
if ("string" == typeof l)
n(i, fi[l], r, s, a, o);
else if (l) {
var c = ki(s, l);
if (!c.setSource)
return a.push(c),
n(i, u, r, s, a, o);
c.setSource(b({}, i), function(e, t) {
if (e)
return n(i, u, r, s, a, o);
a.push(c),
n(t, i.type === t.type ? u : fi[t.type], r, s, a, o)
})
} else
u.length ? n(i, u, r, s, a, o) : o ? r(i, a) : n(i, fi["*"], r, s, a, !0)
}(t, fi[t.type], n, e)
}, 1)
}
function mi(e, t, n, i) {
void 0 === i && (i = null);
var r = "call" + Re(n)
, s = e.reduce(Ci(r), i)
, a = s === gi
, o = a ? null : t[n](s);
return function(e, t, n, i) {
for (var r = e.length - 1; 0 <= r; r--) {
var s = e[r];
s[t] && s[t](i, n)
}
}(e, n, o, a),
o
}
var _i = {
buffered: 1,
currentTime: 1,
duration: 1,
muted: 1,
played: 1,
paused: 1,
seekable: 1,
volume: 1
}
, bi = {
setCurrentTime: 1,
setMuted: 1,
setVolume: 1
}
, Ti = {
play: 1,
pause: 1
};
function Ci(n) {
return function(e, t) {
return e === gi ? gi : t[n] ? t[n](e) : e
}
}
function ki(e, t) {
var n = vi[e.id()]
, i = null;
if (null == n)
return i = t(e),
vi[e.id()] = [[t, i]],
i;
for (var r = 0; r < n.length; r++) {
var s = n[r]
, a = s[0]
, o = s[1];
a === t && (i = o)
}
return null === i && (i = t(e),
n.push([t, i])),
i
}
function Ei(e) {
void 0 === e && (e = "");
var t = on(e);
return Si[t.toLowerCase()] || ""
}
var Si = {
opus: "video/ogg",
ogv: "video/ogg",
mp4: "video/mp4",
mov: "video/mp4",
m4v: "video/mp4",
mkv: "video/x-matroska",
m4a: "audio/mp4",
mp3: "audio/mpeg",
aac: "audio/aac",
oga: "audio/ogg",
m3u8: "application/x-mpegURL",
jpg: "image/jpeg",
jpeg: "image/jpeg",
gif: "image/gif",
png: "image/png",
svg: "image/svg+xml",
webp: "image/webp"
};
function wi(e) {
if (!e.type) {
var t = Ei(e.src);
t && (e.type = t)
}
return e
}
var xi = Object.assign ? Object.assign : function(n, e, t, i) {
for (var r = 1; r < arguments.length; r++)
ji(Object(arguments[r]), function(e, t) {
n[t] = e
});
return n
}
, Ai = function() {
{
if (Object.create)
return function(e, t, n, i) {
var r = Mi(arguments, 1);
return xi.apply(this, [Object.create(e)].concat(r))
}
;
var s = function() {};
return function(e, t, n, i) {
var r = Mi(arguments, 1);
return s.prototype = e,
xi.apply(this, [new s].concat(r))
}
}
}()
, Pi = String.prototype.trim ? function(e) {
return String.prototype.trim.call(e)
}
: function(e) {
return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
}
, Li = "undefined" != typeof window ? window : t
, Ii = {
assign: xi,
create: Ai,
trim: Pi,
bind: function(e, t) {
return function() {
return t.apply(e, Array.prototype.slice.call(arguments, 0))
}
},
slice: Mi,
each: ji,
map: function(e, n) {
var i = Ni(e) ? [] : {};
return Oi(e, function(e, t) {
return i[t] = n(e, t),
!1
}),
i
},
pluck: Oi,
isList: Ni,
isFunction: function(e) {
return e && "[object Function]" === {}.toString.call(e)
},
isObject: function(e) {
return e && "[object Object]" === {}.toString.call(e)
},
Global: Li
};
function Mi(e, t) {
return Array.prototype.slice.call(e, t || 0)
}
function ji(e, n) {
Oi(e, function(e, t) {
return n(e, t),
!1
})
}
function Oi(e, t) {
if (Ni(e)) {
for (var n = 0; n < e.length; n++)
if (t(e[n], n))
return e[n]
} else
for (var i in e)
if (e.hasOwnProperty(i) && t(e[i], i))
return e[i]
}
function Ni(e) {
return null != e && "function" != typeof e && "number" == typeof e.length
}
var Di = Ii.slice
, Bi = Ii.pluck
, Ri = Ii.each
, Fi = Ii.bind
, Hi = Ii.create
, Vi = Ii.isList
, Qi = Ii.isFunction
, Ui = Ii.isObject
, qi = {
createStore: Wi
}
, zi = {
version: "2.0.12",
enabled: !1,
get: function(e, t) {
var n = this.storage.read(this._namespacePrefix + e);
return this._deserialize(n, t)
},
set: function(e, t) {
return void 0 === t ? this.remove(e) : (this.storage.write(this._namespacePrefix + e, this._serialize(t)),
t)
},
remove: function(e) {
this.storage.remove(this._namespacePrefix + e)
},
each: function(n) {
var i = this;
this.storage.each(function(e, t) {
n.call(i, i._deserialize(e), (t || "").replace(i._namespaceRegexp, ""))
})
},
clearAll: function() {
this.storage.clearAll()
},
hasNamespace: function(e) {
return this._namespacePrefix == "__storejs_" + e + "_"
},
createStore: function() {
return Wi.apply(this, arguments)
},
addPlugin: function(e) {
this._addPlugin(e)
},
namespace: function(e) {
return Wi(this.storage, this.plugins, e)
}
};
function Wi(e, t, n) {
n = n || "",
e && !Vi(e) && (e = [e]),
t && !Vi(t) && (t = [t]);
var i = n ? "__storejs_" + n + "_" : ""
, r = n ? new RegExp("^" + i) : null;
if (!/^[a-zA-Z0-9_\-]*$/.test(n))
throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");
var s = Hi({
_namespacePrefix: i,
_namespaceRegexp: r,
_testStorage: function(e) {
try {
var t = "__storejs__test__";
e.write(t, t);
var n = e.read(t) === t;
return e.remove(t),
n
} catch (e) {
return !1
}
},
_assignPluginFnProp: function(i, e) {
var r = this[e];
this[e] = function() {
var n = Di(arguments, 0)
, e = this;
var t = [function() {
if (r)
return Ri(arguments, function(e, t) {
n[t] = e
}),
r.apply(e, n)
}
].concat(n);
return i.apply(e, t)
}
},
_serialize: function(e) {
return JSON.stringify(e)
},
_deserialize: function(t, e) {
if (!t)
return e;
var n = "";
try {
n = JSON.parse(t)
} catch (e) {
n = t
}
return void 0 !== n ? n : e
},
_addStorage: function(e) {
this.enabled || this._testStorage(e) && (this.storage = e,
this.enabled = !0)
},
_addPlugin: function(n) {
var i = this;
if (Vi(n))
Ri(n, function(e) {
i._addPlugin(e)
});
else if (!Bi(this.plugins, function(e) {
return n === e
})) {
if (this.plugins.push(n),
!Qi(n))
throw new Error("Plugins must be function values that return objects");
var e = n.call(this);
if (!Ui(e))
throw new Error("Plugins must return an object of function properties");
Ri(e, function(e, t) {
if (!Qi(e))
throw new Error("Bad plugin property: " + t + " from plugin " + n.name + ". Plugins should only return functions.");
i._assignPluginFnProp(e, t)
})
}
},
addStorage: function(e) {
!function() {
var e = "undefined" == typeof console ? null : console;
e && (e.warn ? e.warn : e.log).apply(e, arguments)
}("store.addStorage(storage) is deprecated. Use createStore([storages])"),
this._addStorage(e)
}
}, zi, {
plugins: []
});
return s.raw = {},
Ri(s, function(e, t) {
Qi(e) && (s.raw[t] = Fi(s, e))
}),
Ri(e, function(e) {
s._addStorage(e)
}),
Ri(t, function(e) {
s._addPlugin(e)
}),
s
}
var Ki = Ii.Global
, Xi = {
name: "localStorage",
read: Yi,
write: function(e, t) {
return Gi().setItem(e, t)
},
each: function(e) {
for (var t = Gi().length - 1; 0 <= t; t--) {
var n = Gi().key(t);
e(Yi(n), n)
}
},
remove: function(e) {
return Gi().removeItem(e)
},
clearAll: function() {
return Gi().clear()
}
};
function Gi() {
return Ki.localStorage
}
function Yi(e) {
return Gi().getItem(e)
}
var $i = Ii.Global
, Ji = {
name: "sessionStorage",
read: er,
write: function(e, t) {
return Zi().setItem(e, t)
},
each: function(e) {
for (var t = Zi().length - 1; 0 <= t; t--) {
var n = Zi().key(t);
e(er(n), n)
}
},
remove: function(e) {
return Zi().removeItem(e)
},
clearAll: function() {
return Zi().clear()
}
};
function Zi() {
return $i.sessionStorage
}
function er(e) {
return Zi().getItem(e)
}
var tr = Ii.trim
, nr = {
name: "cookieStorage",
read: function(e) {
if (!e || !ar(e))
return null;
var t = "(?:^|.*;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";
return unescape(ir.cookie.replace(new RegExp(t), "$1"))
},
write: function(e, t) {
if (!e)
return;
ir.cookie = escape(e) + "=" + escape(t) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"
},
each: rr,
remove: sr,
clearAll: function() {
rr(function(e, t) {
sr(t)
})
}
}
, ir = Ii.Global.document;
function rr(e) {
for (var t = ir.cookie.split(/; ?/g), n = t.length - 1; 0 <= n; n--)
if (tr(t[n])) {
var i = t[n].split("=")
, r = unescape(i[0]);
e(unescape(i[1]), r)
}
}
function sr(e) {
e && ar(e) && (ir.cookie = escape(e) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")
}
function ar(e) {
return new RegExp("(?:^|;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(ir.cookie)
}
var or = {
name: "memoryStorage",
read: function(e) {
return lr[e]
},
write: function(e, t) {
lr[e] = t
},
each: function(e) {
for (var t in lr)
lr.hasOwnProperty(t) && e(lr[t], t)
},
remove: function(e) {
delete lr[e]
},
clearAll: function(e) {
lr = {}
}
}
, lr = {};
var ur = [Xi, Ji, nr, or]
, cr = qi.createStore(ur, [])
, hr = "vjs-text-track-settings"
, dr = ["#000", "Black"]
, pr = ["#00F", "Blue"]
, fr = ["#0FF", "Cyan"]
, vr = ["#0F0", "Green"]
, gr = ["#F0F", "Magenta"]
, yr = ["#F00", "Red"]
, mr = ["#FFF", "White"]
, _r = ["#FF0", "Yellow"]
, br = ["1", "Opaque"]
, Tr = ["0.5", "Semi-Transparent"]
, Cr = ["0", "Transparent"]
, kr = {
backgroundColor: {
selector: ".vjs-bg-color > select",
id: "captions-background-color-%s",
label: "Color",
options: [dr, mr, yr, vr, pr, _r, gr, fr]
},
backgroundOpacity: {
selector: ".vjs-bg-opacity > select",
id: "captions-background-opacity-%s",
label: "Transparency",
options: [br, Tr, Cr]
},
color: {
selector: ".vjs-fg-color > select",
id: "captions-foreground-color-%s",
label: "Color",
options: [mr, dr, yr, vr, pr, _r, gr, fr]
},
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: [br, Tr]
},
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: [Cr, Tr, br]
}
};
function Er(e, t) {
if (t && (e = t(e)),
e && "none" !== e)
return e
}
kr.windowColor.options = kr.backgroundColor.options;
var Sr = function(i) {
function e(e, t) {
var n;
return t.temporary = !1,
t.pauseOnOpen = !1,
(n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
n.fill(),
n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
n.endDialog = w("p", {
className: "vjs-control-text",
textContent: n.localize("End of dialog window.")
}),
n.el().appendChild(n.endDialog),
n.setDefaults(),
void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
n.on(n.$(".vjs-done-button"), "click", function() {
n.saveSettings(),
n.close()
}),
n.on(n.$(".vjs-default-button"), "click", function() {
n.setDefaults(),
n.updateDisplay()
}),
a(kr, function(e) {
n.on(n.$(e.selector), "change", n.updateDisplay)
}),
n.options_.persistTextTrackSettings && n.restoreSettings(),
n
}
We(e, i);
var t = e.prototype;
return t.dispose = function() {
this.endDialog = null,
i.prototype.dispose.call(this)
}
,
t.createElSelect_ = function(e, t, n) {
var i = this;
void 0 === t && (t = ""),
void 0 === n && (n = "label");
var r = kr[e]
, s = r.id.replace("%s", this.id_)
, a = [t, s].join(" ").trim();
return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "" + n + ">", '").join("")
}
,
t.createElFgColor_ = function() {
var e = "captions-text-legend-" + this.id_;
return ['"].join("")
}
,
t.createElBgColor_ = function() {
var e = "captions-background-" + this.id_;
return ['"].join("")
}
,
t.createElWinColor_ = function() {
var e = "captions-window-" + this.id_;
return ['"].join("")
}
,
t.createElColors_ = function() {
return w("div", {
className: "vjs-track-settings-colors",
innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
})
}
,
t.createElFont_ = function() {
return w("div", {
className: "vjs-track-settings-font",
innerHTML: ['", '", '"].join("")
})
}
,
t.createElControls_ = function() {
var e = this.localize("restore all settings to the default values");
return w("div", {
className: "vjs-track-settings-controls",
innerHTML: ['", '"].join("")
})
}
,
t.content = function() {
return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
}
,
t.label = function() {
return this.localize("Caption Settings Dialog")
}
,
t.description = function() {
return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
}
,
t.buildCSSClass = function() {
return i.prototype.buildCSSClass.call(this) + "vjs-debug"
}
,
t.getValues = function() {
var r = this;
return o(kr, function(e, t, n) {
var i = function(e, t) {
return Er(e.options[e.options.selectedIndex].value, t)
}(r.$(t.selector), t.parser);
return void 0 !== i && (e[n] = i),
e
}, {})
}
,
t.setValues = function(n) {
var i = this;
a(kr, function(e, t) {
!function(e, t, n) {
if (t)
for (var i = 0; i < e.options.length; i++)
if (Er(e.options[i].value, n) === t) {
e.selectedIndex = i;
break
}
}(i.$(e.selector), n[t], e.parser)
})
}
,
t.setDefaults = function() {
var n = this;
a(kr, function(e) {
var t = e.hasOwnProperty("default") ? e.default : 0;
n.$(e.selector).selectedIndex = t
})
}
,
t.restoreSettings = function() {
var e;
try {
e = JSON.parse(p.localStorage.getItem(hr))
} catch (e) {
m.warn(e)
}
e && this.setValues(e)
}
,
t.saveSettings = function() {
if (this.options_.persistTextTrackSettings) {
var e = this.getValues();
try {
Object.keys(e).length ? p.localStorage.setItem(hr, JSON.stringify(e)) : p.localStorage.removeItem(hr)
} catch (e) {
m.warn(e)
}
}
}
,
t.updateDisplay = function() {
var e = this.player_.getChild("textTrackDisplay");
e && e.updateDisplay()
}
,
t.conditionalBlur_ = function() {
this.previouslyActiveEl_ = null;
var e = this.player_.controlBar
, t = e && e.subsCapsButton
, n = e && e.captionsButton;
t ? t.focus() : n && n.focus()
}
,
e
}(Ot);
He.registerComponent("DebugDialog", Sr);
var wr = function(p) {
function e(e, t, n, i, r, s) {
var a;
void 0 === n && (n = ""),
(a = p.call(this, e, t) || this).parseContent(n),
a.barrageId = i;
var o = 9
, l = 35
, u = ["#ffffff", "#ff5353", "#42ebff", "#fad400", "#ff7f01", "#7ff75b"]
, c = "#ffffff"
, h = 10
, d = 40;
return void 0 !== a.options().playerOptions.config && (o = a.options().playerOptions.config.barrage.marginTop,
l = a.options().playerOptions.config.barrage.lineHeight,
u = a.options().playerOptions.config.barrage.color,
c = a.options().playerOptions.config.barrage.colorSelf,
h = a.options().playerOptions.config.barrage.paddingSelf,
d = a.options().playerOptions.config.barrage.borderRadius),
a.el().style.top = r * l + o + "px",
a.el().style.color = u[Math.floor(Math.random() * u.length)],
!0 === s && (a.el().style.color = c,
a.el().style.paddingLeft = h + "px",
a.el().style.paddingRight = h + "px",
a.el().style["border-radius"] = d + "px",
a.addClass("selfBarrageBorder")),
a.el().oncontextmenu = function(e) {
return !1
}
,
a.on(["tap", "click"], a.handleClick),
a
}
We(e, p);
var t = e.prototype;
return t.handleClick = function() {
this.player_.log("[barrage-display] click!" + this.barrageId)
}
,
t.parseContent = function(e) {
if (-1 !== e.indexOf("[/") && -1 !== e.indexOf("]")) {
for (var t, n = Mr.getEmoList().length, i = !1, r = 0; r < n; r++) {
var s = e.indexOf(Mr.getEmoList()[r].text);
if (-1 !== s) {
if (i = !0,
0 !== s) {
var a = e.substring(0, s);
if (this.strContainEmo(a))
continue;
this.addContent(a),
this.addEmo(Mr.getEmoList()[r].name)
} else
this.addEmo(Mr.getEmoList()[r].name);
t = e.substr(s + Mr.getEmoList()[r].text.length);
break
}
}
i ? this.parseContent(t) : this.addContent(e)
} else
this.addContent(e)
}
,
t.strContainEmo = function(e) {
for (var t = !1, n = Mr.getEmoList().length, i = 0; i < n; i++)
if (-1 !== e.indexOf(Mr.getEmoList()[i].text)) {
t = !0;
break
}
return t
}
,
t.createEl = function() {
var e = p.prototype.createEl.call(this, "div", {
className: "barrage-display"
})
, t = 17
, n = 35;
return void 0 !== this.options().playerOptions.config && (t = this.options().playerOptions.config.barrage.fontSize,
n = this.options().playerOptions.config.barrage.lineHeight),
e.style["font-size"] = t + "px",
e.style.height = n + "px",
e.style["line-height"] = n + "px",
e.style.left = this.player_.currentWidth() + "px",
e
}
,
t.addEmo = function(e) {
this.emoEl_ = w("img", {
className: "barrage-emo",
src: Mr.emoPicUrlPre() + "/" + e
}),
this.el().appendChild(this.emoEl_)
}
,
t.addContent = function(e) {
this.contentEl_ = w("span", {
className: "barrage-content",
innerHTML: "" + e
}),
this.el().appendChild(w("span", {
className: "barrage-content",
innerHTML: "" + e
}))
}
,
t.dispose = function() {
this.contentEl_ = null,
this.textNode_ = null,
p.prototype.dispose.call(this)
}
,
e
}(He);
wr.prototype.labelText_ = "",
wr.prototype.controlText_ = "",
He.registerComponent("BarrageDisplay", wr);
function xr(e, i) {
var t = {
uri: e
}
, n = ln(e);
n && (t.cors = n),
Zt(t, Te(this, function(e, t, n) {
if (e)
return m.error(e, t);
!function(e, t) {
t.emoJSON(JSON.parse(e)),
t.onEmoConfigLoaded()
}(n, i)
}))
}
function Ar(e, i) {
var t = {
uri: e
}
, n = ln(e);
n && (t.cors = n),
Zt(t, Te(this, function(e, t, n) {
if (e)
return m.error(e, t);
i.commentLoaded(n)
}))
}
var Pr, Lr = [], Ir = !1, Mr = function(a) {
function e(e, t, n) {
var i;
(i = a.call(this, e, t, n) || this).isVod = i.player_.options_.barrageVod,
i.isVod ? i.BARRAGE_TIME_INTERVAL = 300 : (i.BARRAGE_TIME_INTERVAL = 60,
i.liveBarrageLoadCounter = -1,
void 0 !== i.player_.options_.barrageItemId && (i.liveBarrageLoadTimer = i.setInterval(i.liveBarrageLoadTimerHandler, 1e3))),
i.SHOW_TIME = 1e4,
i.FOLLOW_RATE = !0,
i.narrageIdCounter = 1,
i.commentData = [],
i.barrageDisplay = [];
var r = Te(Ve(i), i.updateDisplay);
e.on("timeupdate", Te(Ve(i), i.timeUpdateHandler)),
e.on("seeking", Te(Ve(i), i.seeking)),
e.on("loadstart", Te(Ve(i), i.toggleDisplay)),
e.on("texttrackchange", r),
i.on(e, "play", i.play),
i.on(e, "pause", i.pause),
e.ready(Te(Ve(i), function() {
e.tech_ && e.tech_.featuresNativeTextTracks ? this.hide() : (e.on("fullscreenchange", r),
e.on("playerresize", r),
p.addEventListener("orientationchange", r),
e.on("dispose", function() {
return p.removeEventListener("orientationchange", r)
}))
})),
!0 !== i.player_.options_.hasBarrage || Ir || xr(i.player_.httpPre_ + i.player_.options_.barrageConfigUrl, Ve(i)),
i.currentTimeInSecond_ = -1,
i.loadCommentTimeInSecond_ = -1,
i.lastTime = -1,
i.totalTime = 0,
i.counter = 0,
i.paused = !0;
var s = Ve(i);
return p.requestAnimationFrame(function() {
s.updateAnimation()
}),
i
}
We(e, a);
var t = e.prototype;
return t.updateAnimation = function() {
this.counter++;
var e = (new Date).getTime()
, t = e - this.lastTime;
-1 === this.lastTime && (t = 5),
this.totalTime += t,
this.lastTime = e;
for (var n, i = this.barrageDisplay.length - 1; 0 <= i; i--) {
n = this.barrageDisplay[i].el();
var r = this.player().playbackRate();
this.isVod ? this.paused || (!0 === this.FOLLOW_RATE ? this.barrageDisplay[i].showTime += t * r : this.barrageDisplay[i].showTime += t) : this.barrageDisplay[i].showTime += t,
0 < n.offsetLeft + n.offsetWidth ? n.style.left = this.player_.currentWidth() - this.barrageDisplay[i].distance * this.barrageDisplay[i].showTime / this.SHOW_TIME + "px" : (this.removeChild(this.barrageDisplay[i]),
this.barrageDisplay.splice(i, 1))
}
var s = this;
p.requestAnimationFrame(function() {
s.updateAnimation()
})
}
,
t.play = function() {
this.paused = !1,
this.lastTime = -1
}
,
t.pause = function() {
this.paused = !0,
this.lastTime = -1
}
,
t.open = function() {}
,
t.close = function() {}
,
e.getEmoList = function() {
return Lr
}
,
e.emoPicUrlPre = function() {
return Pr
}
,
t.currentTimeInSecond = function(e) {
if (void 0 === e)
return this.currentTimeInSecond_;
this.currentTimeInSecond_ = e
}
,
t.timeUpdateHandler = function() {
if (Ir && (!this.player_.ads || !0 !== this.player_.ads.isInAdMode())) {
var e = Math.round(this.player_.currentTime());
if (this.currentTimeInSecond() !== e && (this.currentTimeInSecond(e),
this.isVod))
for (var t = this.commentData.length - 1; 0 <= t; t--)
this.commentData[t].relative_time <= 1e3 * this.player_.currentTime() && (this.addBarrage(this.commentData[t].message, !1),
this.commentData.splice(t, 1));
if (this.isVod) {
if (this.currentTimeInSecond() < 0)
return;
if (!0 !== this.player_.options_.hasBarrage)
return;
if (-1 === this.loadCommentTimeInSecond_ || this.loadCommentTimeInSecond_ + this.BARRAGE_TIME_INTERVAL <= this.currentTimeInSecond()) {
this.loadCommentTimeInSecond_ = this.currentTimeInSecond();
var n = this.player_.httpPre_ + this.player_.options_.barrageContentUrl + "app=" + this.player_.options_.barrageApp + "&prepage=1000&itemid=" + this.player_.options_.barrageItemId + "&relative_time=" + 1e3 * this.loadCommentTimeInSecond_ + "&relative_end_time=" + 1e3 * (this.loadCommentTimeInSecond_ + this.BARRAGE_TIME_INTERVAL);
Ar(n, this)
}
}
}
}
,
t.liveBarrageLoadTimerHandler = function() {
if (this.liveBarrageLoadCounter++,
this.liveBarrageLoadCounter % 4 == 0 && (this.player_.log("show live"),
0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 0),
0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 1),
0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 2)),
60 <= this.liveBarrageLoadCounter || 0 === this.liveBarrageLoadCounter) {
this.liveBarrageLoadCounter = 0,
this.player_.log("loadComments live");
var e = this.player_.httpPre_ + this.player_.options_.barrageContentUrl + "app=" + this.player_.options_.barrageApp + "&prepage=45&itemid=" + this.player_.options_.barrageItemId + "&nature=1";
Ar(e, this)
}
}
,
t.seeking = function() {
if (this.isVod) {
for (this.commentData.length = 0; 0 < this.barrageDisplay.length; )
this.removeChild(this.barrageDisplay.pop());
this.loadCommentTimeInSecond_ = -1
}
}
,
t.emoJSON = function(e) {
if (void 0 === e)
return this.emoJSON_;
this.emoJSON_ = e
}
,
t.emoData = function() {
return this.emoJSON().data
}
,
t.onEmoConfigLoaded = function() {
if (this.player().options().debug && this.player_.log("[barrage-layer] config loaded"),
!0 !== Ir) {
Ir = !0,
Pr = this.emoJSON_.picUrl;
for (var e = this.emoData().length, t = 0; t < e; t++)
Lr.push(this.emoData()[t])
}
}
,
t.commentLoaded = function(e) {
if (this.isVod) {
if (void 0 === this.commentData)
return;
this.commentData.length = 0;
var t, n = JSON.parse(e);
t = n.data.content.length;
for (var i = 0; i < t; i++)
this.commentData.push(n.data.content[i])
} else {
if (void 0 === this.commentData)
return;
this.commentData.length = 0;
var r, s = JSON.parse(e);
r = s.data.content.length;
for (var a = 0; a < r; a++)
this.commentData.push(s.data.content[a])
}
}
,
t.showBarrage = function(e) {
this.player_.ads && !0 === this.player_.ads.isInAdMode() || this.addBarrage(e, !0)
}
,
t.addBarrage = function(e, t, n) {
this.narrageIdCounter++;
void 0 === n && (n = Math.floor(3 * Math.random()));
var i = new wr(this.player_,this.options_,e,"b" + this.narrageIdCounter,n,t);
this.addChild(i),
i.velocity = (this.player_.currentWidth() + i.width()) / this.SHOW_TIME,
i.distance = this.player_.currentWidth() + i.width(),
i.showTime = 0,
this.barrageDisplay.push(i)
}
,
t.toggleDisplay = function() {
this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show()
}
,
t.createEl = function() {
return a.prototype.createEl.call(this, "div", {
className: "vjs-barrage-layer"
})
}
,
t.updateDisplay = function() {}
,
e
}(He);
He.registerComponent("BarrageLayer", Mr);
var jr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "choose-video-button-prev"
}
,
t.handleClick = function(e) {
var t = this.player().getChild("chooseVideoPanel");
void 0 !== t && t.prevPage_()
}
,
t.hide = function() {
this.addClass("hideButton")
}
,
t.show = function() {
this.removeClass("hideButton")
}
,
t.playerResize = function() {
this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
}
,
e
}(Qt);
He.registerComponent("PrevPageButton", jr);
var Or = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "choose-video-button-next"
}
,
t.handleClick = function(e) {
var t = this.player().getChild("chooseVideoPanel");
void 0 !== t && t.nextPage_()
}
,
t.playerResize = function() {
this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
}
,
e
}(Qt);
He.registerComponent("NextPageButton", Or);
var Nr = function(n) {
function e(e, t) {
return void 0 === t && (t = {}),
n.call(this, e, t) || this
}
We(e, n);
var t = e.prototype;
return t.panelState_ = function() {}
,
t.createEl = function() {
return n.prototype.createEl.call(this, "div", {
className: "choose-video-content",
innerHTML: ""
})
}
,
t.resetPage = function() {}
,
t.updatePage = function(e) {
var t = this.player().options_.chooseVideoData.data.list
, n = 8;
e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
600 <= this.player().currentHeight() && (n = 12,
e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1)),
e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
this.el().innerHTML = "";
for (var i = "", r = 0; r < n; r++)
void 0 !== t[e * n + r] && (i += '"),
r === n - 1 && (i += "
");
this.el().innerHTML = i;
var s = .23 * this.player().currentWidth() / 16 * 9 + 40;
this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - n / 4 * s) / 2 + 20 + "px"
}
,
t.dispose = function() {
n.prototype.dispose.call(this)
}
,
e
}(He);
He.registerComponent("ChooseVideoPage", Nr);
var Dr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "choose-video-close " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {}
,
t.playerResize = function() {
var e = 8;
600 <= this.player().currentHeight() && (e = 12);
var t = .23 * this.player().currentWidth() / 16 * 9 + 40;
this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - e / 4 * t) / 2 + "px"
}
,
e
}(Qt);
He.registerComponent("ChooseVideoCloseButton", Dr);
var Br = function(o) {
function e(e, t) {
var n;
void 0 === t && (t = {}),
(n = o.call(this, e, t) || this).on(e, "playerresize", n.playerResize);
var i = new jr(e,t)
, r = new Or(e,t);
n.leftBtn(i),
n.rightBtn(r);
var s = new Nr(e,t);
n.page(s),
n.addChild(i),
n.addChild(s),
n.addChild(r);
var a = new Dr(e,t);
return n.addChild(a),
n.on(a, "click", n.hide),
n
}
We(e, o);
var t = e.prototype;
return t.leftBtn = function(e) {
if (void 0 === e)
return this.leftBtn_;
this.leftBtn_ = e
}
,
t.rightBtn = function(e) {
if (void 0 === e)
return this.rightBtn_;
this.rightBtn_ = e
}
,
t.page = function(e) {
if (void 0 === e)
return this.page_;
this.page_ = e
}
,
t.pageNum = function(e) {
if (void 0 === e)
return void 0 === this.pageNum_ && (this.pageNum_ = 0),
this.pageNum_;
this.pageNum_ !== e && (this.pageNum_ = e,
this.pageNum_ < 0 && (this.pageNum_ = 0),
this.updatePage())
}
,
t.playerResize = function() {
this.updatePage()
}
,
t.prevPage_ = function() {
this.pageNum() <= 0 || this.pageNum(this.pageNum() - 1)
}
,
t.nextPage_ = function() {
this.pageNum(this.pageNum() + 1)
}
,
t.createEl = function() {
return o.prototype.createEl.call(this, "div", {
className: "choose-video-panel vjs-hidden"
})
}
,
t.hideToggle = function() {
this.hasClass("vjs-hidden") ? this.show() : this.hide()
}
,
t.hide = function() {
this.hasClass("vjs-hidden") || this.addClass("vjs-hidden"),
this.player().getChild("ControlBar").getChild("chooseVideoButton").updateButtonState()
}
,
t.show = function() {
this.removeClass("vjs-hidden")
}
,
t.updatePage = function() {
this.pageNum() <= 0 ? this.leftBtn_.hide() : this.leftBtn_.show();
var e = 8;
600 <= this.player().currentHeight() && (e = 12);
var t = Math.ceil(this.player().options_.chooseVideoData.data.list.length / e) - 1;
this.pageNum() >= t ? this.rightBtn_.hide() : this.rightBtn_.show(),
this.page().updatePage(this.pageNum())
}
,
t.dispose = function() {
o.prototype.dispose.call(this)
}
,
e
}(He);
He.registerComponent("ChooseVideoPanel", Br);
var Rr = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
n = i.call(this, e, t) || this,
t.replay = void 0 === t.replay || t.replay,
n.on(e, "play", n.handlePlay),
n.on(e, "pause", n.handlePause),
t.replay && n.on(e, "ended", n.handleEnded),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return i.prototype.buildCSSClass.call(this) + " vjs-play-control-mini"
}
,
t.handleClick = function(e) {
this.player_.paused() ? this.player_.play() : this.player_.pause()
}
,
t.handleSeeked = function(e) {
this.removeClass("vjs-ended"),
this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
}
,
t.handlePlay = function(e) {
this.removeClass("vjs-ended"),
this.removeClass("vjs-paused"),
this.addClass("vjs-playing"),
this.controlText("Pause")
}
,
t.handlePause = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-paused"),
this.controlText("Play")
}
,
t.handleEnded = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-ended"),
this.controlText("Replay"),
this.one(this.player_, "seeked", this.handleSeeked)
}
,
e
}(Qt);
Rr.prototype.controlText_ = "Play",
He.registerComponent("PlayToggleMini", Rr);
var Fr = function(i) {
function e(e, t) {
var n;
return n = i.call(this, e, t) || this,
t && (n.menuButton_ = t.menuButton),
n.focusedChild_ = -1,
n.on("mouseover", n.handleMouseOver),
n.on("mouseout", n.handleMouseOut),
n.boundHandleBlur_ = Te(Ve(n), n.handleBlur),
n.boundHandleTapClick_ = Te(Ve(n), n.handleTapClick),
n
}
We(e, i);
var t = e.prototype;
return t.handleMouseOver = function(e) {
this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.addClass("vjs-hover")
}
,
t.handleMouseOut = function(e) {
this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.removeClass("vjs-hover")
}
,
t.addEventListenerForItem = function(e) {
e instanceof He && (this.on(e, "blur", this.boundHandleBlur_),
this.on(e, ["tap", "click"], this.boundHandleTapClick_))
}
,
t.removeEventListenerForItem = function(e) {
e instanceof He && (this.off(e, "blur", this.boundHandleBlur_),
this.off(e, ["tap", "click"], this.boundHandleTapClick_))
}
,
t.removeChild = function(e) {
"string" == typeof e && (e = this.getChild(e)),
this.removeEventListenerForItem(e),
i.prototype.removeChild.call(this, e)
}
,
t.addItem = function(e) {
var t = this.addChild(e);
t && this.addEventListenerForItem(t)
}
,
t.createEl = function() {
var e = this.options_.contentElType || "ul";
this.contentEl_ = w(e, {
className: "vjs-menu-content"
}),
this.contentEl_.setAttribute("role", "menu");
var t = i.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
}
,
t.dispose = function() {
this.contentEl_ = null,
this.boundHandleBlur_ = null,
this.boundHandleTapClick_ = null,
i.prototype.dispose.call(this)
}
,
t.handleBlur = function(e) {
var t = e.relatedTarget || f.activeElement;
if (!this.children().some(function(e) {
return e.el() === t
})) {
var n = this.menuButton_;
n && n.buttonPressed_ && t !== n.el().firstChild && n.unpressButton()
}
}
,
t.handleTapClick = function(t) {
if (this.menuButton_) {
this.menuButton_.unpressButton();
var e = this.children();
if (!Array.isArray(e))
return;
var n = e.filter(function(e) {
return e.el() === t.target
})[0];
if (!n)
return;
"CaptionSettingsMenuItem" !== n.name() && this.menuButton_.focus()
}
}
,
t.handleKeyDown = function(e) {
Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
e.stopPropagation(),
this.stepForward()) : (Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up")) && (e.preventDefault(),
e.stopPropagation(),
this.stepBack())
}
,
t.stepForward = function() {
var e = 0;
void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1),
this.focus(e)
}
,
t.stepBack = function() {
var e = 0;
void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1),
this.focus(e)
}
,
t.focus = function(e) {
void 0 === e && (e = 0);
var 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())
}
,
e
}(He);
He.registerComponent("Menu", Fr);
var Hr = function(r) {
function e(e, t) {
var n;
void 0 === t && (t = {}),
(n = r.call(this, e, t) || this).menuButton_ = new Qt(e,t),
n.menuButton_.controlText(n.controlText_),
n.menuButton_.el_.setAttribute("aria-haspopup", "true");
var i = Qt.prototype.buildCSSClass();
return n.menuButton_.el_.className = n.buildCSSClass() + " " + i,
n.menuButton_.removeClass("vjs-control"),
n.addChild(n.menuButton_),
n.update(),
n.enabled_ = !0,
n.on(n.menuButton_, "tap", n.handleClick),
n.on(n.menuButton_, "click", n.handleClick),
n.on(n.menuButton_, "keydown", n.handleKeyDown),
n.on(n.menuButton_, "mouseenter", function() {
n.addClass("vjs-hover"),
n.menu.show(),
n.handleMouseEnter(),
ge(f, "keyup", Te(Ve(n), n.handleMenuKeyUp))
}),
n.on("mouseleave", n.handleMouseLeave),
n.on("keydown", n.handleSubmenuKeyDown),
n
}
We(e, r);
var t = e.prototype;
return t.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()
}
,
t.createMenu = function() {
var e = new Fr(this.player_,{
menuButton: this
});
if (this.hideThreshold_ = 0,
this.options_.title) {
var t = w("li", {
className: "vjs-menu-title",
innerHTML: Re(this.options_.title),
tabIndex: -1
});
this.hideThreshold_ += 1;
var n = new He(this.player_,{
el: t
});
e.addItem(n)
}
if (this.items = this.createItems(),
this.items)
for (var i = 0; i < this.items.length; i++)
e.addItem(this.items[i]);
return e
}
,
t.createItems = function() {}
,
t.createEl = function() {
return r.prototype.createEl.call(this, "div", {
className: this.buildWrapperCSSClass()
}, {})
}
,
t.buildWrapperCSSClass = function() {
var e = "vjs-menu-button";
return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
"vjs-menu-button " + e + " " + Qt.prototype.buildCSSClass() + " " + r.prototype.buildCSSClass.call(this)
}
,
t.buildCSSClass = function() {
var e = "vjs-menu-button";
return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
"vjs-menu-button " + e + " " + r.prototype.buildCSSClass.call(this)
}
,
t.controlText = function(e, t) {
return void 0 === t && (t = this.menuButton_.el()),
this.menuButton_.controlText(e, t)
}
,
t.dispose = function() {
this.handleMouseLeave(),
r.prototype.dispose.call(this)
}
,
t.handleClick = function(e) {
this.buttonPressed_ ? this.unpressButton() : this.pressButton()
}
,
t.handleMouseLeave = function(e) {
this.removeClass("vjs-hover"),
ye(f, "keyup", Te(this, this.handleMenuKeyUp))
}
,
t.focus = function() {
this.menuButton_.focus()
}
,
t.blur = function() {
this.menuButton_.blur()
}
,
t.handleKeyDown = function(e) {
Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab") ? (this.buttonPressed_ && this.unpressButton(),
Mt.isEventKey(e, "Tab") || (e.preventDefault(),
this.menuButton_.focus())) : (Mt.isEventKey(e, "Up") || Mt.isEventKey(e, "Down")) && (this.buttonPressed_ || (e.preventDefault(),
this.pressButton()))
}
,
t.handleMenuKeyUp = function(e) {
(Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && this.removeClass("vjs-hover")
}
,
t.handleMouseEnter = function() {}
,
t.handleSubmenuKeyPress = function(e) {
this.handleSubmenuKeyDown(e)
}
,
t.handleSubmenuKeyDown = function(e) {
(Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && (this.buttonPressed_ && this.unpressButton(),
Mt.isEventKey(e, "Tab") || (e.preventDefault(),
this.menuButton_.focus()))
}
,
t.pressButton = function() {
if (this.enabled_) {
if (this.buttonPressed_ = !0,
this.menu.show(),
this.menu.lockShowing(),
this.menuButton_.el_.setAttribute("aria-expanded", "true"),
ht && E())
return;
this.menu.focus()
}
}
,
t.unpressButton = function() {
this.enabled_ && (this.buttonPressed_ = !1,
this.menu.unlockShowing(),
this.menu.hide(),
this.menuButton_.el_.setAttribute("aria-expanded", "false"))
}
,
t.disable = function() {
this.unpressButton(),
this.enabled_ = !1,
this.addClass("vjs-disabled"),
this.menuButton_.disable()
}
,
t.enable = function() {
this.enabled_ = !0,
this.removeClass("vjs-disabled"),
this.menuButton_.enable()
}
,
e
}(He);
He.registerComponent("MenuButton", Hr);
var Vr = ["Tab", "Esc", "Up", "Down", "Right", "Left"]
, Qr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).selectable = t.selectable,
n.isSelected_ = t.selected || !1,
n.multiSelectable = t.multiSelectable,
n.selected(n.isSelected_),
n.selectable ? n.multiSelectable ? n.el_.setAttribute("role", "menuitemcheckbox") : n.el_.setAttribute("role", "menuitemradio") : n.el_.setAttribute("role", "menuitem"),
n.off("mouseover", n.handleMouseOver),
n.off("mouseout", n.handleMouseOut),
n
}
We(e, i);
var t = e.prototype;
return t.handleMouseOver = function(e) {}
,
t.handleMouseOut = function(e) {}
,
t.createEl = function(e, t, n) {
return this.nonIconControl = !0,
i.prototype.createEl.call(this, "li", b({
className: "vjs-menu-item",
innerHTML: '",
tabIndex: -1
}, t), n)
}
,
t.handleKeyDown = function(t) {
Vr.some(function(e) {
return Mt.isEventKey(t, e)
}) || i.prototype.handleKeyDown.call(this, t)
}
,
t.handleClick = function(e) {
this.selected(!0)
}
,
t.selected = function(e) {
this.selectable && (e ? (this.addClass("vjs-selected"),
this.el_.setAttribute("aria-checked", "true"),
this.controlText(", selected"),
this.isSelected_ = !0) : (this.removeClass("vjs-selected"),
this.el_.setAttribute("aria-checked", "false"),
this.controlText(""),
this.isSelected_ = !1))
}
,
e
}(Vt);
He.registerComponent("MenuItem", Qr);
var Ur = function(r) {
function e(e, t) {
var n, i = t.content;
return t.label = i,
t.selectable = !0,
t.multiSelectable = !1,
(n = r.call(this, e, t) || this).label = i,
n.on("mouseover", n.handleMouseOver),
n.on("mouseout", n.handleMouseOut),
n
}
We(e, r);
var t = e.prototype;
return t.handleClick = function(e) {
if (!0 === e.shiftKey) {
var t = this.player_.getDebugInfo()
, n = f.createElement("textarea");
n.value = t,
f.body.appendChild(n),
n.select();
var i = f.execCommand("copy");
f.body.removeChild(n),
i ? this.player_.log("[CMI] debug info has copied") : this.player_.warn("[CMI] copy failed!")
}
r.prototype.handleClick.call(this)
}
,
t.handleMouseOver = function(e) {}
,
t.handleMouseOut = function(e) {
this.selected(!1)
}
,
e
}(Qr);
Ur.prototype.contentElType = "button",
He.registerComponent("ContextMenuItem", Ur);
var qr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).showDebug_ = !1,
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this);
return e.oncontextmenu = function() {
return !1
}
,
e
}
,
t.moveAndShow = function(e, t) {
this.showDebug_ = t,
this.showDebug_ && this.player_.log("[player] show debug contextmenu"),
this.update(),
this.el().style.left = e.offsetX + "px",
this.el().style.top = e.offsetY + "px",
this.addClass("vjs-hover"),
this.menu.show()
}
,
t.dispose = function() {
this.labelEl_ = null,
i.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "context-menu-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "context-menu " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
var e = new Fr(this.player());
return e.addChild(new Ur(this.player(),{
content: "core:" + this.player_.playerversion + " " + this.player_.updatedate
})),
e.addChild(new Ur(this.player(),{
content: "wrap:" + this.options().playerOptions.wrapperVersion + " " + this.options().playerOptions.wrapperupdate
})),
this.showDebug_ && e.addChild(new Ur(this.player(),{
content: "debug info..."
})),
e
}
,
t.updateARIAAttributes = function() {
this.el().setAttribute("aria-valuenow", this.player().playbackRate())
}
,
t.handleClick = function(e) {}
,
e
}(Hr);
qr.prototype.controlText_ = "",
He.registerComponent("ContextMenuButton", qr);
var zr = function(u) {
function e(e, t, n) {
var i, r = Fe({
createEl: !1
}, t);
if (i = u.call(this, e, r, n) || this,
t.playerOptions.sources && 0 !== t.playerOptions.sources.length)
e.src(t.playerOptions.sources);
else
for (var s = 0, a = t.playerOptions.techOrder; s < a.length; s++) {
var o = Re(a[s])
, l = pi.getTech(o);
if (o || (l = He.getComponent(o)),
l && l.isSupported()) {
e.loadTech_(o);
break
}
}
return i
}
return We(e, u),
e
}(He);
He.registerComponent("MediaLoader", zr);
var Wr = function(i) {
function e(e, t) {
var n;
return n = i.call(this, e, t) || this,
oo.browser.IS_SAFARI ? (n.canplay(!1),
n.on(e, "canplaythrough", n.canClick)) : n.canplay(!0),
n.update(),
e.on("posterchange", Te(Ve(n), n.update)),
G(n.el()),
n
}
We(e, i);
var t = e.prototype;
return t.canClick = function() {
this.canplay(!0)
}
,
t.canplay = function(e) {
return void 0 !== e && (this.canplay_ = e),
this.canplay_
}
,
t.dispose = function() {
this.player().off("posterchange", this.update),
i.prototype.dispose.call(this)
}
,
t.createEl = function() {
return w("div", {
className: "vjs-poster",
tabIndex: -1
})
}
,
t.update = function(e) {
var t = this.player().poster();
this.setSrc(t),
t ? this.show() : this.hide()
}
,
t.setSrc = function(e) {
var t = "";
e && (t = 'url("' + e + '")'),
this.el_.style.backgroundImage = t
}
,
t.handleClick = function(e) {
if (!0 === this.canplay() && this.player_.controls()) {
var t = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
!this.player_.tech(!0) || (st || nt) && t || this.player_.tech(!0).focus(),
this.player_.paused() ? At(this.player_.play()) : this.player_.pause()
}
}
,
e
}(Vt);
He.registerComponent("PosterImage", Wr);
var Kr = function(r) {
function e() {
return r.apply(this, arguments) || this
}
return We(e, r),
e.prototype.createEl = function() {
var e = this.player_.isAudio()
, t = this.localize(e ? "Audio Player" : "Video Player")
, n = w("span", {
className: "vjs-control-text",
innerHTML: this.localize("{1} is loading.", [t])
})
, i = r.prototype.createEl.call(this, "div", {
className: "vjs-loading-spinner",
dir: "ltr"
});
return i.appendChild(n),
i
}
,
e
}(He);
He.registerComponent("LoadingSpinner", Kr);
var Xr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).mouseused_ = !1,
oo.browser.IS_SAFARI && (n.hide(),
n.one(e, "canplay", n.beforeShow)),
oo.browser.IS_FIREFOX && n.hide(),
n.one(e, "canplaythrough", n.show),
n.on("mousedown", n.handleMouseDown),
G(n.el()),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-big-play-button"
}
,
t.show = function() {
this.player().options().debug && this.player().log("show-bigplaybutton"),
oo.browser.IS_SAFARI,
i.prototype.show.call(this)
}
,
t.beforeShow = function() {
this.player().log("beforeShow"),
this.setTimeout(function() {
this.show()
}, 100)
}
,
t.handleClick = function(e) {
oo.browser.IS_SAFARI;
var t = this.player_.play();
if (this.mouseused_ && e.clientX && e.clientY) {
var n = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
return At(t),
void (!this.player_.tech(!0) || (st || nt) && n || this.player_.tech(!0).focus())
}
var i = this.player_.getChild("controlBar")
, r = i && i.getChild("playToggle");
if (r) {
var s = function() {
return r.focus()
};
xt(t) ? t.then(s, function() {}) : this.setTimeout(s, 1)
} else
this.player_.tech(!0).focus()
}
,
t.handleKeyDown = function(e) {
this.mouseused_ = !1,
i.prototype.handleKeyDown.call(this, e)
}
,
t.handleMouseDown = function(e) {
this.mouseused_ = !0
}
,
e
}(Qt);
Xr.prototype.controlText_ = "Play Video",
He.registerComponent("BigPlayButton", Xr);
var Gr = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).controlText(t && t.controlText || n.localize("Close")),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-close-button " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {
this.trigger({
type: "close",
bubbles: !1
})
}
,
t.handleKeyDown = function(e) {
Mt.isEventKey(e, "Esc") ? (e.preventDefault(),
e.stopPropagation(),
this.trigger("click")) : i.prototype.handleKeyDown.call(this, e)
}
,
e
}(Qt);
He.registerComponent("CloseButton", Gr);
var Yr = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
n = i.call(this, e, t) || this,
t.replay = void 0 === t.replay || t.replay,
n.on(e, "play", n.handlePlay),
n.on(e, "pause", n.handlePause),
t.replay && n.on(e, "ended", n.handleEnded),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-play-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {
this.player_.paused() ? this.player_.play() : this.player_.pause()
}
,
t.handleSeeked = function(e) {
this.removeClass("vjs-ended"),
this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
}
,
t.handlePlay = function(e) {
this.removeClass("vjs-ended"),
this.removeClass("vjs-paused"),
this.addClass("vjs-playing"),
this.controlText("Pause")
}
,
t.handlePause = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-paused"),
this.controlText("Play")
}
,
t.handleEnded = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-ended"),
this.controlText("Replay"),
this.one(this.player_, "seeked", this.handleSeeked)
}
,
e
}(Qt);
Yr.prototype.controlText_ = "Play",
He.registerComponent("PlayToggle", Yr);
var $r = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
t.vertical = !0,
"undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
t.volumeBar.vertical = t.vertical),
(n = i.call(this, e, t) || this).throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
n.on("click", n.handlerClick),
n.on("touchstart", n.handleMouseDown),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-next-control-container",
innerHTML: '' + this.player().options_.nextTitle + "
"
})
}
,
t.handleMouseDown = function(e) {}
,
t.handlerMouseOver = function(e) {}
,
t.handlerClick = function(e) {}
,
t.handleMouseUp = function(e) {}
,
t.handleMouseMove = function(e) {}
,
e
}(He);
$r.prototype.options_ = {},
He.registerComponent("NextControl", $r);
var Jr = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
n = i.call(this, e, t) || this,
t.next = void 0 === t.next || t.next,
n.on("mouseover", n.handleMouseOver),
n.on("mouseout", n.handleMouseOut),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-next-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {}
,
t.handleMouseOver = function(e) {}
,
t.handleMouseOut = function(e) {}
,
t.handleKeyPress = function(e) {}
,
t.handlePlay = function(e) {
this.removeClass("vjs-ended"),
this.removeClass("vjs-paused"),
this.addClass("vjs-playing"),
this.controlText("Next")
}
,
t.handlePause = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-paused"),
this.controlText("Next")
}
,
t.handleEnded = function(e) {
this.removeClass("vjs-playing"),
this.addClass("vjs-ended"),
this.controlText("Next")
}
,
e
}(Qt);
Jr.prototype.controlText_ = "Next",
He.registerComponent("NextButton", Jr);
var Zr = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
t.inline = !1,
(n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
n.on("click", n.handlerClick),
n.on("mouseover", n.handleMouseOver),
n.on("mouseout", n.handleMouseOut),
n
}
We(e, i);
var t = e.prototype;
return t.volumePanelState_ = function() {}
,
t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-next-panel vjs-control vjs-next-panel-vertical"
})
}
,
t.dispose = function() {
this.handleMouseOut(),
i.prototype.dispose.call(this)
}
,
t.handleVolumeControlKeyUp = function(e) {
Mt.isEventKey(e, "Esc")
}
,
t.handleMouseOver = function(e) {
this.addClass("vjs-hover"),
ge(f, "keyup", Te(this, this.handleKeyPress))
}
,
t.handleMouseOut = function(e) {
this.removeClass("vjs-hover"),
ye(f, "keyup", Te(this, this.handleKeyPress))
}
,
t.handlerClick = function(e) {
this.player().trigger("nextvideo")
}
,
t.handleKeyPress = function(e) {
Mt.isEventKey(e, "Esc") && this.handleMouseOut()
}
,
e
}(He);
Zr.prototype.options_ = {
children: ["nextButton", "nextControl"]
},
He.registerComponent("NextPanel", Zr);
var es = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "webfullscreenchange", n.handleWebfullscreenChange),
!1 === f[e.fsApi_.webfullscreenEnabled] && n.disable(),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-webfullscreen-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handleWebfullscreenChange = function(e) {
this.player_.isWebFullscreen() ? this.controlText("Non-Webfullscreen") : this.controlText("Webfullscreen")
}
,
t.handleClick = function(e) {
this.player_.isWebFullscreen() ? this.player_.exitFullWindow() : this.player_.enterFullWindow()
}
,
e
}(Qt);
es.prototype.controlText_ = "Webfullscreen",
He.registerComponent("WebfullscreenToggle", es);
var ts = function(r) {
function e(e, t) {
var n, i = t.content;
return t.multiSelectable = !1,
(n = r.call(this, e, t) || this).label = i,
n.on(e, "autonextchange", n.update),
n
}
We(e, r);
var t = e.prototype;
return t.createEl = function(e, t, n) {
return this.nonIconControl = !0,
r.prototype.createEl.call(this, "li", b({
className: "vjs-menu-item",
innerHTML: ' ',
tabIndex: -1
}, t), n)
}
,
t.handleClick = function(e) {
!0 === this.player().autoNext() ? this.player().autoNext(!1) : (this.player().autoNext(!0),
this.player().loop2(!1))
}
,
t.update = function(e) {
!0 === this.player().autoNext() ? (this.removeClass("selectorOff"),
this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
this.addClass("selectorOff"))
}
,
e
}(Qr);
ts.prototype.contentElType = "button",
He.registerComponent("SetupMenuItemAutoNext", ts);
var ns = function(r) {
function e(e, t) {
var n, i = t.content;
return t.multiSelectable = !1,
(n = r.call(this, e, t) || this).label = i,
n.on(e, "loop2change", n.update),
n
}
We(e, r);
var t = e.prototype;
return t.createEl = function(e, t, n) {
return this.nonIconControl = !0,
r.prototype.createEl.call(this, "li", b({
className: "vjs-menu-item",
innerHTML: ' ',
tabIndex: -1
}, t), n)
}
,
t.handleClick = function(e) {
!0 === this.player().loop2() ? this.player().loop2(!1) : (this.player().loop2(!0),
this.player().autoNext(!1)),
this.player().log("loop2 click" + this.player().loop2())
}
,
t.update = function(e) {
!0 === this.player().loop2() ? (this.removeClass("selectorOff"),
this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
this.addClass("selectorOff"))
}
,
e
}(Qr);
ns.prototype.contentElType = "button",
He.registerComponent("SetupMenuItemLoop", ns);
var is = function(n) {
function e(e, t) {
return n.call(this, e, t) || this
}
We(e, n);
var t = e.prototype;
return t.createEl = function() {
var e = n.prototype.createEl.call(this);
return this.labelEl_ = w("div", {
className: "vjs-setup-value",
innerHTML: ""
}),
e.appendChild(this.labelEl_),
e
}
,
t.dispose = function() {
this.labelEl_ = null,
n.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "vjs-setup " + n.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-setup " + n.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
var e = new Fr(this.player());
return !0 === this.player().options_.controlBar.nextPanel && e.addChild(new ts(this.player(),{
content: "Auto Next"
})),
e.addChild(new ns(this.player(),{
content: "Loop"
})),
e
}
,
t.updateARIAAttributes = function() {}
,
t.handleClick = function(e) {}
,
t.handleMouseEnter = function() {
this.player().trigger("analyticALI.play.1.17")
}
,
e
}(Hr);
is.prototype.controlText_ = "Setup",
He.registerComponent("SetupMenuButton", is);
var rs = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).updateLabel(),
n.on(e, "choosevideochange", n.updateLabel),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this);
return this.labelEl_ = w("div", {
className: "choose-video-value",
innerHTML: "videos"
}),
e.appendChild(this.labelEl_),
e
}
,
t.dispose = function() {
this.labelEl_ = null,
i.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "choose-video " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "choose-video " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
return new Fr(this.player())
}
,
t.updateMenu = function() {}
,
t.updateARIAAttributes = function() {}
,
t.handleClick = function(e) {
var t = this.player().getChild("chooseVideoPanel");
void 0 !== t && (t.hideToggle(),
t.updatePage(),
this.updateButtonState())
}
,
t.updateButtonState = function() {
var e = this.player().getChild("chooseVideoPanel");
void 0 !== e && (e.hasClass("vjs-hidden") ? this.removeClass("vjs-selected") : this.addClass("vjs-selected"))
}
,
t.handleMouseEnter = function() {}
,
t.updateVisibility = function(e) {}
,
t.updateLabel = function(e) {
this.labelEl_.innerHTML = "" + this.localize("videos")
}
,
e
}(Hr);
rs.prototype.controlText_ = "videos",
He.registerComponent("ChooseVideoButton", rs);
var ss = function(s) {
function e(e, t) {
var n, i = t.tracks;
if ((n = s.call(this, e, t) || this).items.length <= 1 && n.hide(),
!i)
return Ve(n);
var r = Te(Ve(n), n.update);
return i.addEventListener("removetrack", r),
i.addEventListener("addtrack", r),
n.player_.on("ready", r),
n.player_.on("dispose", function() {
i.removeEventListener("removetrack", r),
i.removeEventListener("addtrack", r)
}),
n
}
return We(e, s),
e
}(Hr);
He.registerComponent("TrackButton", ss);
var as = function(r) {
function e(e, t) {
return r.call(this, e, t) || this
}
We(e, r);
var t = e.prototype;
return t.createEl = function(e, t, n) {
var i = '",
r.prototype.createEl.call(this, e, b({
innerHTML: i
}, t), n)
}
,
t.handleClick = function(e) {
r.prototype.handleClick.call(this, e),
this.player().changeAudioMode(this.options_.audioModeIndex)
}
,
e
}(Qr);
He.registerComponent("audioModeMenuItem", as);
var os = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
(n = i.call(this, e, t) || this).on(e, "changeAudioMode", n.onChange),
n.show(),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this);
return this.labelEl_ = w("div", {
className: "vjs-audio-button-value",
innerHTML: "" + this.localize("original")
}),
e.appendChild(this.labelEl_),
e
}
,
t.buildCSSClass = function() {
return "vjs-audio-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-audio-button " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createItems = function(e) {
return void 0 === e && (e = []),
e.push(new as(this.player_,{
audioModeIndex: 0,
audioLabel: "original",
selectable: !0,
multiSelectable: !1
})),
e.push(new as(this.player_,{
audioModeIndex: 1,
audioLabel: "earphone",
selectable: !0,
multiSelectable: !1
})),
e.push(new as(this.player_,{
audioModeIndex: 2,
audioLabel: "soundbox",
selectable: !0,
multiSelectable: !1
})),
e[0].selected(!0),
e
}
,
t.onChange = function(e) {
for (var t = 0; t < this.items.length; t++)
this.items[t].selected(!1);
this.items[e.audioMode].selected(!0),
this.labelEl_.innerHTML = "" + this.localize(this.items[e.audioMode].options_.audioLabel)
}
,
e
}(ss);
os.prototype.controlText_ = "audio mode",
He.registerComponent("AudioModeButton", os);
var ls = function(n) {
function e(e, t) {
return n.call(this, e, t) || this
}
We(e, n);
var t = e.prototype;
return t.createEl = function() {
var e = "vjs-quality-menu-permit"
, t = n.prototype.createEl.call(this, "span", {
className: e
});
return this.contentEl_ = w("span", {
className: e + "-display",
innerHTML: "" + this.localize("登录看")
}, {
"aria-live": "off",
role: "presentation"
}),
t.appendChild(this.contentEl_),
t
}
,
t.visible = function(e) {
e ? this.removeClass("opacity-0") : this.addClass("opacity-0")
}
,
t.dispose = function() {
this.contentEl_ = null,
this.textNode_ = null,
n.prototype.dispose.call(this)
}
,
t.updateContent = function(e) {}
,
e
}(He);
ls.prototype.labelText_ = "Time",
ls.prototype.controlText_ = "PlaybackQualityMenuPermit",
He.registerComponent("PlaybackQualityMenuPermit", ls);
var us = function(l) {
function e(e, t, n) {
var i, r = t.quality, s = t.quality;
if (t.label = r,
t.selected = 1 === s,
t.selectable = !0,
t.multiSelectable = !1,
(i = l.call(this, e, t) || this).label = r,
i.quality = s,
i.permit = t.permit,
n) {
var a = new ls(e,t);
i.permit,
0,
i.permit <= 0 && a.visible(!1),
i.addChild(a)
}
i.on(e, "qualitychange", i.update);
var o = i.player_.qualityLevels();
return i.on(o, "change", i.update2),
i
}
We(e, l);
var t = e.prototype;
return t.handleClick = function(e) {
if (0 !== this.permit)
return this.player().log("this.permit" + this.permit),
this.player().pause(),
this.player().trigger("loginstatus"),
void cr.set("h5vodlocaldata", {
lastQuality: this.label,
lastVolume: this.player().volume()
});
l.prototype.handleClick.call(this),
this.player().switchQualityDirect(this.label),
this.player().trigger("analyticALI.play.1.13")
}
,
t.update = function(e) {
this.selected(this.player().getCurentQuality() === this.quality)
}
,
t.update2 = function(e) {
this.selected(this.player().getCurentQuality() === this.quality)
}
,
t.playbackQualities = function() {
return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
}
,
t.playbackQualityIndexs = function() {
return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
}
,
e
}(Qr);
us.prototype.contentElType = "Playback Quality",
He.registerComponent("PlaybackQualityMenuItem", us);
var cs = function(r) {
function e(e, t) {
var n;
(n = r.call(this, e, t) || this).updateVisibility(),
n.updateLabel(),
n.on(e, "loadstart", n.updateVisibility),
n.on(e, "loadedmetadata", n.updateMenu);
n.player().options().qualityPermitMode;
n.on(e, "qualitychange", n.updateLabel);
var i = n.player_.qualityLevels();
return n.on(i, "change", n.updateLabel2),
n
}
We(e, r);
var t = e.prototype;
return t.createEl = function() {
var e = r.prototype.createEl.call(this);
return this.labelEl_ = w("div", {
className: "vjs-playback-quality-value",
innerHTML: "HD"
}),
e.appendChild(this.labelEl_),
e
}
,
t.dispose = function() {
this.labelEl_ = null,
r.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
for (var e = new Fr(this.player()), t = !!this.player().options().qualityPermitMode, n = this.player().options().customQualityList, i = t ? n : ["HD-"], r = !1, s = i.length - 1; 0 <= s; s--)
if (0 < i[s].permition) {
r = !0;
break
}
if (r && this.addClass("vjs-playback-quality-wide"),
i)
for (var a = i.length - 1; 0 <= a; a--) {
var o = void 0;
i[a].enabled && (o = t && r ? new us(this.player(),{
quality: "" + i[a].label,
permit: i[a].permition
},!0) : new us(this.player(),{
quality: "" + i[a].label,
permit: 0
},!1),
e.addChild(o))
}
return e
}
,
t.updateMenu = function() {
var e = !!this.player().options().qualityPermitMode;
if (this.player().changingToMainContent() && e)
for (var t = this.player_.qualityLevels().length, n = 0; n < t; n++) {
var i = this.player().options_.playbackQualities
, r = this.player().options_.playbackQualityIndex[i.lastIndexOf(this.player().getMainContentQuality())];
this.player_.qualityLevels()[n].enabled = n === r
}
}
,
t.initSwitchQuality = function() {
var e = this.player_.qualityLevels().length;
this.player_.clearPlaybackQualityLevel();
for (var t = 0; t < e; t++)
this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
this.player().switchQuality(this.player().options().customDefaultQuality, !0),
this.updateLabel()
}
,
t.updateARIAAttributes = function() {
this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
}
,
t.handleClick = function(e) {
for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
if (n[r] > t) {
i = n[r];
break
}
this.player().playbackQuality(i)
}
,
t.handleMouseEnter = function() {
this.player().trigger("analyticALI.play.1.14")
}
,
t.playbackQualities = function() {
return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
}
,
t.playbackQualityIndexs = function() {
return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
}
,
t.playbackQualitySupported = function() {
return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
}
,
t.updateVisibility = function(e) {
this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
}
,
t.updateLabel = function(e) {
this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
}
,
t.updateLabel2 = function(e) {
this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
}
,
e
}(Hr);
cs.prototype.controlText_ = "Playback Quality",
He.registerComponent("PlaybackQualityMenuButton", cs);
var hs = function(a) {
function e(e, t) {
var n, i = t.quality, r = t.quality;
t.label = i,
t.selected = 1 === r,
t.selectable = !0,
t.multiSelectable = !1,
(n = a.call(this, e, t) || this).label = i,
n.quality = r,
n.on(e, "qualitychange", n.update);
var s = n.player_.qualityLevels();
return n.on(s, "change", n.update2),
n
}
We(e, a);
var t = e.prototype;
return t.handleClick = function(e) {
a.prototype.handleClick.call(this),
this.player().switchQuality(this.label),
this.player().trigger("analyticALI.play.1.13")
}
,
t.update = function(e) {
this.selected(this.player().getCurentQuality() === this.quality)
}
,
t.update2 = function(e) {
this.selected(this.player().getCurentQuality() === this.quality)
}
,
t.playbackQualities = function() {
return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
}
,
t.playbackQualityIndexs = function() {
return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
}
,
e
}(Qr);
hs.prototype.contentElType = "Playback Quality",
He.registerComponent("PlaybackQualityMenuItem3", hs);
var ds = function(r) {
function e(e, t) {
var n;
if ((n = r.call(this, e, t) || this).player().options().qualityPermitMode)
return Ve(n);
n.updateVisibility(),
n.updateLabel(),
n.on(e, "loadstart", n.updateVisibility),
n.on(e, "loadedmetadata", n.updateMenu),
n.on(e, "qualitychange", n.updateLabel);
var i = n.player_.qualityLevels();
return n.on(i, "change", n.updateLabel2),
n
}
We(e, r);
var t = e.prototype;
return t.createEl = function() {
var e = r.prototype.createEl.call(this);
return this.labelEl_ = w("div", {
className: "vjs-playback-quality-value",
innerHTML: "HD"
}),
e.appendChild(this.labelEl_),
e
}
,
t.dispose = function() {
this.labelEl_ = null,
r.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
for (var e = new Fr(this.player()), t = ["HD-"], n = t.length - 1; 0 <= n; n--)
e.addChild(new hs(this.player(),{
quality: "" + t[n]
}));
return e
}
,
t.updateMenu = function() {
var e = this.player_.qualityLevels().length;
this.player_.clearPlaybackQualityLevel();
for (var t = 0; t < e; t++)
this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
for (var n, i = this.playbackQualities(), r = this.menu; 0 < r.children_.length; )
n = r.children_[0],
r.removeChild(n);
var s, a, o = cr.get("h5vodlocaldata");
if (void 0 !== o && void 0 !== o.lastQuality && 0 < this.player_.GET_DEFAULT_QUALITY_LABELS().indexOf(o.lastQuality) ? s = o.lastQuality : (s = "",
this.player_.log("no lastQuality")),
"" !== s && 0 <= i.indexOf(s))
a = s;
else if (null !== this.player_.options_.vdnDefaultStream) {
a = this.player_.options_.vdnDefaultStream,
this.player().options().debug && this.player_.log("vdn vdnDefaultStream: " + a)
}
if (i.indexOf(a) < 0 && (a = 1 === this.player_.options_.logicIndex ? this.player_.GET_DEFAULT_QUALITY_LABELS()[6] : this.player_.GET_DEFAULT_QUALITY_LABELS()[3]),
0 <= i.indexOf(a) || (a = 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[3]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[3] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[4]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[4] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[2]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[2] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[5]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[5] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[1]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[1] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[7]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[7] : i[0]),
this.player().options().debug && this.player_.log("[PlaybackQualityMenuItem3] defaultStream: " + a),
this.player().switchQuality(a, !0),
this.updateLabel(),
i)
for (var l = i.length - 1; 0 <= l; l--) {
var u = new hs(this.player(),{
quality: "" + i[l]
});
r.addChild(u),
u.update()
}
}
,
t.updateARIAAttributes = function() {
this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
}
,
t.handleClick = function(e) {
for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
if (n[r] > t) {
i = n[r];
break
}
this.player().playbackQuality(i)
}
,
t.handleMouseEnter = function() {
this.player().trigger("analyticALI.play.1.14")
}
,
t.playbackQualities = function() {
return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
}
,
t.playbackQualityIndexs = function() {
return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
}
,
t.playbackQualitySupported = function() {
return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
}
,
t.updateVisibility = function(e) {
this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
}
,
t.updateLabel = function(e) {
this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
}
,
t.updateLabel2 = function(e) {
this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
}
,
e
}(Hr);
ds.prototype.controlText_ = "Playback Quality",
He.registerComponent("PlaybackQualityMenuButton3", ds);
var ps = function(e) {
function t() {
return e.apply(this, arguments) || this
}
We(t, e);
var n = t.prototype;
return n.buildCSSClass = function() {
return "vjs-current-time"
}
,
n.updateContent = function(e) {
var t;
t = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(),
this.updateTextNode_(t)
}
,
t
}(Rt);
ps.prototype.labelText_ = "Current Time",
ps.prototype.controlText_ = "Current Time",
He.registerComponent("CurrentTimeDisplay", ps);
var fs = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
n.on(e, "loadstart", n.updateContent),
n.on(e, "loadedmetadata", n.updateContent),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-duration"
}
,
t.updateContent = function(e) {
var t = this.player_.duration();
this.updateTextNode_(t)
}
,
e
}(Rt);
fs.prototype.labelText_ = "Duration",
fs.prototype.controlText_ = "Duration",
He.registerComponent("DurationDisplay", fs);
var vs = function(e) {
function t() {
return e.apply(this, arguments) || this
}
return We(t, e),
t.prototype.createEl = function() {
return e.prototype.createEl.call(this, "div", {
className: "vjs-time-control vjs-time-divider",
innerHTML: "/
"
}, {
"aria-hidden": !0
})
}
,
t
}(He);
He.registerComponent("TimeDivider", vs);
var gs = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-remaining-time"
}
,
t.createEl = function() {
var e = i.prototype.createEl.call(this);
return e.insertBefore(w("span", {}, {
"aria-hidden": !0
}, "-"), this.contentEl_),
e
}
,
t.updateContent = function(e) {
var t;
"number" == typeof this.player_.duration() && (t = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime(),
this.updateTextNode_(t))
}
,
e
}(Rt);
gs.prototype.labelText_ = "Remaining Time",
gs.prototype.controlText_ = "Remaining Time",
He.registerComponent("RemainingTimeDisplay", gs);
var ys = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).updateShowing(),
n.on(n.player(), "durationchange", n.updateShowing),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this, "div", {
className: "vjs-live-control vjs-control"
});
return this.contentEl_ = w("div", {
className: "vjs-live-display",
innerHTML: '' + this.localize("Stream Type") + " " + this.localize("LIVE")
}, {
"aria-live": "off"
}),
e.appendChild(this.contentEl_),
e
}
,
t.dispose = function() {
this.contentEl_ = null,
i.prototype.dispose.call(this)
}
,
t.updateShowing = function(e) {
this.player().duration() === 1 / 0 ? this.show() : this.hide()
}
,
e
}(He);
He.registerComponent("LiveDisplay", ys);
var ms = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).updateLiveEdgeStatus(),
n.player_.liveTracker && n.on(n.player_.liveTracker, "liveedgechange", n.updateLiveEdgeStatus),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this, "button", {
className: "vjs-seek-to-live-control vjs-control"
});
return this.textEl_ = w("span", {
className: "vjs-seek-to-live-text",
innerHTML: this.localize("LIVE")
}, {
"aria-hidden": "true"
}),
e.appendChild(this.textEl_),
e
}
,
t.updateLiveEdgeStatus = function() {
!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() ? (this.setAttribute("aria-disabled", !0),
this.addClass("vjs-at-live-edge"),
this.controlText("Seek to live, currently playing live")) : (this.setAttribute("aria-disabled", !1),
this.removeClass("vjs-at-live-edge"),
this.controlText("Seek to live, currently behind live"))
}
,
t.handleClick = function() {
this.player_.liveTracker.seekToLiveEdge()
}
,
t.dispose = function() {
this.player_.liveTracker && this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatus),
this.textEl_ = null,
i.prototype.dispose.call(this)
}
,
e
}(Qt);
ms.prototype.controlText_ = "Seek to live, currently playing live",
He.registerComponent("SeekToLive", ms);
function _s(e, t, n) {
return e = Number(e),
Math.min(n, Math.max(t, isNaN(e) ? t : e))
}
var bs = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).bar = n.getChild(n.options_.barName),
n.vertical(!!n.options_.vertical),
n.enable(),
n
}
We(e, i);
var t = e.prototype;
return t.enabled = function() {
return this.enabled_
}
,
t.enable = function() {
this.enabled() || (this.on("mousedown", this.handleMouseDown),
this.on("touchstart", this.handleMouseDown),
this.on("keydown", this.handleKeyDown),
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)
}
,
t.disable = function() {
if (this.enabled()) {
var e = this.bar.el_.ownerDocument;
this.off("mousedown", this.handleMouseDown),
this.off("touchstart", this.handleMouseDown),
this.off("keydown", this.handleKeyDown),
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
}
}
,
t.createEl = function(e, t, n) {
return void 0 === t && (t = {}),
void 0 === n && (n = {}),
t.className = t.className + " vjs-slider",
t = b({
tabIndex: 0
}, t),
n = b({
role: "slider",
"aria-valuenow": 0,
"aria-valuemin": 0,
"aria-valuemax": 100,
tabIndex: 0
}, n),
i.prototype.createEl.call(this, e, t, n)
}
,
t.handleMouseDown = function(e) {
var t = this.bar.el_.ownerDocument;
"mousedown" === e.type && e.preventDefault(),
"touchstart" !== e.type || it || e.preventDefault(),
R(),
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)
}
,
t.handleMouseMove = function(e) {}
,
t.handleMouseUp = function() {
var e = this.bar.el_.ownerDocument;
F(),
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()
}
,
t.update = function() {
var t = this;
if (this.el_ && this.bar) {
var n = this.getProgress();
return n === this.progress_ || (this.progress_ = n,
this.requestAnimationFrame(function() {
var e = t.vertical() ? "height" : "width";
t.bar.el().style[e] = (100 * n).toFixed(2) + "%"
})),
n
}
}
,
t.getProgress = function() {
return Number(_s(this.getPercent(), 0, 1).toFixed(4))
}
,
t.calculateDistance = function(e) {
var t = Q(this.el_, e);
return this.vertical() ? t.y : t.x
}
,
t.handleKeyDown = function(e) {
Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
e.stopPropagation(),
this.stepBack()) : Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up") ? (e.preventDefault(),
e.stopPropagation(),
this.stepForward()) : i.prototype.handleKeyDown.call(this, e)
}
,
t.handleClick = function(e) {
e.stopPropagation(),
e.preventDefault()
}
,
t.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")
}
,
e
}(He);
He.registerComponent("Slider", bs);
function Ts(e, t) {
return _s(e / t * 100, 0, 100).toFixed(2) + "%"
}
var Cs = function(r) {
function e(e, t) {
var n;
return (n = r.call(this, e, t) || this).partEls_ = [],
n.on(e, "progress", n.update),
n
}
We(e, r);
var t = e.prototype;
return t.createEl = function() {
var e = r.prototype.createEl.call(this, "div", {
className: "vjs-load-progress"
})
, t = w("span", {
className: "vjs-control-text"
})
, n = w("span", {
textContent: this.localize("Loaded")
})
, i = f.createTextNode(": ");
return this.percentageEl_ = w("span", {
className: "vjs-control-text-loaded-percentage",
textContent: "0%"
}),
e.appendChild(t),
t.appendChild(n),
t.appendChild(i),
t.appendChild(this.percentageEl_),
e
}
,
t.dispose = function() {
this.partEls_ = null,
this.percentageEl_ = null,
r.prototype.dispose.call(this)
}
,
t.update = function(e) {
var h = this;
this.requestAnimationFrame(function() {
var e = h.player_.liveTracker
, t = h.player_.buffered()
, n = e && e.isLive() ? e.seekableEnd() : h.player_.duration()
, i = h.player_.bufferedEnd()
, r = h.partEls_
, s = Ts(i, n);
h.percent_ !== s && (h.el_.style.width = s,
x(h.percentageEl_, s),
h.percent_ = s);
for (var a = 0; a < t.length; a++) {
var o = t.start(a)
, l = t.end(a)
, u = r[a];
u || (u = h.el_.appendChild(w()),
r[a] = u),
u.dataset.start === o && u.dataset.end === l || (u.dataset.start = o,
u.dataset.end = l,
u.style.left = Ts(o, i),
u.style.width = Ts(l - o, i))
}
for (var c = r.length; c > t.length; c--)
h.el_.removeChild(r[c - 1]);
r.length = t.length
})
}
,
e
}(He);
He.registerComponent("LoadProgressBar", Cs);
var ks = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-time-tooltip"
}, {
"aria-hidden": "true"
})
}
,
t.update = function(e, t, n) {
var i = H(this.el_)
, r = H(this.player_.el())
, s = e.width * t;
if (r && i) {
var a = e.left - r.left + s
, o = e.width - s + (r.right - e.right)
, l = i.width / 2;
a < l ? l += l - a : o < l && (l = o),
l < 0 ? l = 0 : l > i.width && (l = i.width),
this.el_.style.right = "-" + l + "px",
this.write(n)
}
}
,
t.write = function(e) {
x(this.el_, e)
}
,
t.updateTime = function(r, s, a, o) {
var l = this;
this.rafId_ && this.cancelAnimationFrame(this.rafId_),
this.rafId_ = this.requestAnimationFrame(function() {
var e, t = l.player_.duration();
if (l.player_.liveTracker && l.player_.liveTracker.isLive()) {
var n = l.player_.liveTracker.liveWindow()
, i = n - s * n;
e = (i < 1 ? "" : "-") + Bt(i, n)
} else
e = Bt(a, t);
l.update(r, s, e),
o && o()
})
}
,
e
}(He);
He.registerComponent("TimeTooltip", ks);
var Es = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-play-progress vjs-slider-bar"
}, {
"aria-hidden": "true"
})
}
,
t.update = function(e, t) {
var n = this.getChild("timeTooltip");
if (n) {
var i = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
n.updateTime(e, t, i)
}
}
,
e
}(He);
Es.prototype.options_ = {
children: []
},
He.registerComponent("PlayProgressBar", Es);
var Ss = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-mouse-display"
})
}
,
t.update = function(e, t) {
var n = this
, i = t * this.player_.duration();
this.getChild("timeTooltip").updateTime(e, t, i, function() {
n.el_.style.left = e.width * t + "px"
})
}
,
e
}(He);
Ss.prototype.options_ = {
children: ["timeTooltip"]
},
He.registerComponent("MouseTimeDisplay", Ss);
var ws = function(r) {
function e(e, t, n) {
var i;
return void 0 === n && (n = 0),
(i = r.call(this, e, t) || this).index_ = n,
i.start_ = e.options_.cuePoints[n].start,
i.title_ = e.options_.cuePoints[n].title,
i.end_ = e.options_.cuePoints[n].end,
i.guid_ = e.options_.cuePoints[n].guid,
i.on(e, "durationchange", i.update),
i.on(i.el_, "mouseover", i.handleMouseOver),
i.on(i.el_, "mouseout", i.handleMouseOut),
i.on(i.el_, "mousedown", i.handleMouseDown),
i
}
We(e, r);
var t = e.prototype;
return t.createEl = function() {
return r.prototype.createEl.call(this, "div", {
className: "vjs-cue-point"
}, {
"aria-hidden": "true"
})
}
,
t.getIndex = function() {
return this.index_
}
,
t.getStart = function() {
return this.start_
}
,
t.getTitle = function() {
return this.title_
}
,
t.getEnd = function() {
return this.end_
}
,
t.handleMouseOver = function(e) {
this.parentComponent_.parentComponent_.getChild("cuePointPreview").show(),
this.parentComponent_.parentComponent_.getChild("cuePointPreview").updateCue(this.index_, this.guid_, this.title_, this.start_ / 1e3),
this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").hide()
}
,
t.handleMouseOut = function(e) {
this.parentComponent_.parentComponent_.getChild("cuePointPreview").hide(),
this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").show()
}
,
t.handleClick = function(e) {
e.stopPropagation()
}
,
t.handleMouseDown = function(e) {
this.player_.currentTime(this.start_ / 1e3),
e.stopPropagation()
}
,
t.update = function() {
isNaN(this.player_.duration()) && this.player_.duration(),
this.el().style.left = this.getStart() / 1e3 / this.player_.duration() * 100 + "%"
}
,
e
}(He);
ws.prototype.options_ = {
children: []
},
He.registerComponent("CuePoint", ws);
var xs = function(s) {
function e(e, t) {
var n;
if ((n = s.call(this, e, t) || this).setEventHandlers_(),
void 0 !== e.options_.cuePoints && 0 < e.options_.cuePoints.length)
for (var i = 0; i < e.options_.cuePoints.length; i++) {
var r = new ws(e,t,i);
n.addChild(r)
}
return n
}
We(e, s);
var t = e.prototype;
return t.setEventHandlers_ = function() {
this.update_ = Te(this, this.update),
this.update = Ce(this.update_, 30),
this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update),
this.player_.liveTracker && this.on(this.player_.liveTracker, "liveedgechange", this.update),
this.updateInterval = null,
this.on(this.player_, ["playing"], this.enableInterval_),
this.on(this.player_, ["ended", "pause", "waiting"], this.disableInterval_),
"hidden"in f && "visibilityState"in f && this.on(f, "visibilitychange", this.toggleVisibility_)
}
,
t.toggleVisibility_ = function(e) {
f.hidden ? this.disableInterval_(e) : (this.enableInterval_(),
this.update())
}
,
t.enableInterval_ = function() {
this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30))
}
,
t.disableInterval_ = function(e) {
this.player_.liveTracker && this.player_.liveTracker.isLive() && "ended" !== e.type || this.updateInterval && (this.clearInterval(this.updateInterval),
this.updateInterval = null)
}
,
t.createEl = function() {
return s.prototype.createEl.call(this, "div", {
className: "vjs-progress-holder"
}, {
"aria-label": this.localize("Progress Bar")
})
}
,
t.update = function(e) {
var i = this
, r = s.prototype.update.call(this);
return this.requestAnimationFrame(function() {
var e = i.player_.ended() ? i.player_.duration() : i.getCurrentTime_()
, t = i.player_.liveTracker
, n = i.player_.duration();
t && t.isLive() && (n = i.player_.liveTracker.liveCurrentTime()),
i.percent_ !== r && (i.el_.setAttribute("aria-valuenow", (100 * r).toFixed(2)),
i.percent_ = r),
i.currentTime_ === e && i.duration_ === n || (i.el_.setAttribute("aria-valuetext", i.localize("progress bar timing: currentTime={1} duration={2}", [Bt(e, n), Bt(n, n)], "{1} of {2}")),
i.currentTime_ = e,
i.duration_ = n),
i.bar && i.bar.update(H(i.el()), i.getProgress())
}),
r
}
,
t.getCurrentTime_ = function() {
return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()
}
,
t.getPercent = function() {
var e, t = this.getCurrentTime_(), n = this.player_.liveTracker;
return n && n.isLive() ? (e = (t - n.seekableStart()) / n.liveWindow(),
n.atLiveEdge() && (e = 1)) : e = t / this.player_.duration(),
e
}
,
t.handleMouseDown = function(e) {
X(e) && (e.stopPropagation(),
this.player_.scrubbing(!0),
this.videoWasPlaying = !this.player_.paused(),
this.player_.pause(),
s.prototype.handleMouseDown.call(this, e))
}
,
t.handleMouseMove = function(e) {
if (X(e)) {
var t, n = this.calculateDistance(e), i = this.player_.liveTracker;
if (i && i.isLive()) {
if (.99 <= n)
return void i.seekToLiveEdge();
var r = i.seekableStart()
, s = i.liveCurrentTime();
if (s <= (t = r + n * i.liveWindow()) && (t = s),
t <= r && (t = r + .1),
t === 1 / 0)
return
} else
(t = n * this.player_.duration()) === this.player_.duration() && (t -= .1);
this.player_.currentTime(t)
}
}
,
t.enable = function() {
s.prototype.enable.call(this);
var e = this.getChild("mouseTimeDisplay");
e && e.show()
}
,
t.disable = function() {
s.prototype.disable.call(this);
var e = this.getChild("mouseTimeDisplay");
e && e.hide()
}
,
t.handleMouseUp = function(e) {
s.prototype.handleMouseUp.call(this, e),
e && e.stopPropagation(),
this.player_.scrubbing(!1),
this.player_.trigger({
type: "timeupdate",
target: this,
manuallyTriggered: !0
}),
this.videoWasPlaying ? At(this.player_.play()) : this.update_()
}
,
t.stepForward = function() {
this.player_.currentTime(this.player_.currentTime() + 10)
}
,
t.stepBack = function() {
this.player_.currentTime(this.player_.currentTime() - 10)
}
,
t.handleAction = function(e) {
this.player_.paused() ? this.player_.play() : this.player_.pause()
}
,
t.handleKeyDown = function(e) {
if (Mt.isEventKey(e, "Space") || Mt.isEventKey(e, "Enter"))
e.preventDefault(),
e.stopPropagation(),
this.handleAction(e);
else if (Mt.isEventKey(e, "Home"))
e.preventDefault(),
e.stopPropagation(),
this.player_.currentTime(0);
else if (Mt.isEventKey(e, "End"))
e.preventDefault(),
e.stopPropagation(),
this.player_.currentTime(this.player_.duration());
else if (/^[0-9]$/.test(Mt(e))) {
e.preventDefault(),
e.stopPropagation();
var t = 10 * (Mt.codes[Mt(e)] - Mt.codes[0]) / 100;
this.player_.currentTime(this.player_.duration() * t)
} else
Mt.isEventKey(e, "PgDn") ? (e.preventDefault(),
e.stopPropagation(),
this.player_.currentTime(this.player_.currentTime() - 120)) : Mt.isEventKey(e, "PgUp") ? (e.preventDefault(),
e.stopPropagation(),
this.player_.currentTime(this.player_.currentTime() + 120)) : s.prototype.handleKeyDown.call(this, e)
}
,
e
}(bs);
xs.prototype.options_ = {
children: ["loadProgressBar", "playProgressBar"],
barName: "playProgressBar"
},
ht || Je || xs.prototype.options_.children.push("mouseTimeDisplay"),
He.registerComponent("SeekBar", xs);
var As = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
(n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
n.on("mouseover", n.handlerMouseOver),
n.on("click", n.handlerClick),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "cue-point-preview vjs-hidden",
innerHTML: '-
88:88'
})
}
,
t.updateCue = function(e, t, n, i) {
var r = Bt(i, this.player_.duration())
, s = this.player_.httpPre_ + this.player_.options_.videoSnapUrl;
void 0 !== this.player_.options_.videoSnapUrl && "" !== this.player_.options_.videoSnapUrl && " " !== this.player_.options_.videoSnapUrl ? this.el_.innerHTML = '' + n + '
' + r + "
" : this.el_.innerHTML = '' + n + '
' + r + "
"
}
,
t.handleMouseDown = function(e) {}
,
t.handlerMouseOver = function(e) {
this.player().log("[cue-point-preview] mouse over")
}
,
t.handlerClick = function(e) {}
,
t.handleMouseUp = function(e) {}
,
t.handleMouseMove = function(e) {}
,
t.update = function(e, t) {
var n = e.width * t + 10 - 73;
n < 10 ? n = 10 : n > e.width + 10 - 146 && (n = e.width + 10 - 146),
this.el_.style.left = n + "px"
}
,
e
}(He);
As.prototype.options_ = {
children: []
},
He.registerComponent("CuePointPreview", As);
var Ps = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).handleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
n.throttledHandleMouseSeek = Ce(Te(Ve(n), n.handleMouseSeek), 30),
n.enable(),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-progress-control vjs-control"
})
}
,
t.handleMouseMove = function(e) {
var t = this.getChild("seekBar");
if (t) {
var n = t.getChild("playProgressBar")
, i = t.getChild("mouseTimeDisplay");
if (n || i) {
var r = t.el()
, s = H(r)
, a = Q(r, e).x;
a = _s(0, 1, a),
i && i.update(s, a),
n && n.update(s, t.getProgress());
var o = this.getChild("cuePointPreview");
o && o.update(s, a)
}
}
}
,
t.handleMouseSeek = function(e) {
var t = this.getChild("seekBar");
t && t.handleMouseMove(e)
}
,
t.enabled = function() {
return this.enabled_
}
,
t.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)
}
,
t.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)
}
,
t.handleMouseDown = function(e) {
var t = this.el_.ownerDocument
, n = this.getChild("seekBar");
n && n.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)
}
,
t.handleMouseUp = function(e) {
var t = this.el_.ownerDocument
, n = this.getChild("seekBar");
n && n.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)
}
,
e
}(He);
Ps.prototype.options_ = {
children: ["seekBar", "cuePointPreview"]
},
He.registerComponent("ProgressControl", Ps);
var Ls = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, ["enterpictureinpicture", "leavepictureinpicture"], n.handlePictureInPictureChange),
f.pictureInPictureEnabled || n.disable(),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-picture-in-picture-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handlePictureInPictureChange = function(e) {
this.player_.isInPictureInPicture() ? this.controlText("Exit Picture-in-Picture") : this.controlText("Picture-in-Picture")
}
,
t.handleClick = function(e) {
this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture()
}
,
e
}(Qt);
Ls.prototype.controlText_ = "Picture-in-Picture",
He.registerComponent("PictureInPictureToggle", Ls);
var Is = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on(e, "fullscreenchange", n.handleFullscreenChange),
!1 === f[e.fsApi_.fullscreenEnabled] && n.disable(),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-fullscreen-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handleFullscreenChange = function(e) {
this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen")
}
,
t.handleClick = function(e) {
this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen()
}
,
e
}(Qt);
Is.prototype.controlText_ = "Fullscreen",
He.registerComponent("FullscreenToggle", Is);
var Ms = function(e) {
function t() {
return e.apply(this, arguments) || this
}
return We(t, e),
t.prototype.createEl = function() {
return e.prototype.createEl.call(this, "div", {
className: "vjs-volume-level",
innerHTML: ''
})
}
,
t
}(He);
He.registerComponent("VolumeLevel", Ms);
var js = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).on("slideractive", n.updateLastVolume_),
n.on(e, "volumechange", n.updateARIAAttributes),
e.ready(function() {
return n.updateARIAAttributes()
}),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
return i.prototype.createEl.call(this, "div", {
className: "vjs-volume-bar vjs-slider-bar"
}, {
"aria-label": this.localize("Volume Level"),
"aria-live": "polite"
})
}
,
t.handleMouseDown = function(e) {
X(e) && i.prototype.handleMouseDown.call(this, e)
}
,
t.handleMouseMove = function(e) {
X(e) && (this.checkMuted(),
this.player_.volume(this.calculateDistance(e)))
}
,
t.checkMuted = function() {
this.player_.muted() && this.player_.muted(!1)
}
,
t.getPercent = function() {
return this.player_.muted() ? 0 : this.player_.volume()
}
,
t.stepForward = function() {
this.checkMuted(),
this.player_.volume(this.player_.volume() + .1)
}
,
t.stepBack = function() {
this.checkMuted(),
this.player_.volume(this.player_.volume() - .1)
}
,
t.updateARIAAttributes = function(e) {
var t = this.player_.muted() ? 0 : this.volumeAsPercentage_();
this.el_.setAttribute("aria-valuenow", t),
this.el_.setAttribute("aria-valuetext", t + "%")
}
,
t.volumeAsPercentage_ = function() {
return Math.round(100 * this.player_.volume())
}
,
t.updateLastVolume_ = function() {
var e = this
, t = this.player_.volume();
this.one("sliderinactive", function() {
0 === e.player_.volume() && e.player_.lastVolume_(t)
})
}
,
e
}(bs);
js.prototype.options_ = {
children: ["volumeLevel"],
barName: "volumeLevel"
},
js.prototype.playerEvent = "volumechange",
He.registerComponent("VolumeBar", js);
var Os = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
t.vertical = t.vertical || !1,
"undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
t.volumeBar.vertical = t.vertical),
n = i.call(this, e, t) || this,
function(e, t) {
t.tech_ && !t.tech_.featuresVolumeControl && e.addClass("vjs-hidden"),
e.on(t, "loadstart", function() {
t.tech_.featuresVolumeControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden")
})
}(Ve(n), e),
n.throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
n.on("mousedown", n.handleMouseDown),
n.on("touchstart", n.handleMouseDown),
n.on(n.volumeBar, ["focus", "slideractive"], function() {
n.volumeBar.addClass("vjs-slider-active"),
n.addClass("vjs-slider-active"),
n.trigger("slideractive")
}),
n.on(n.volumeBar, ["blur", "sliderinactive"], function() {
n.volumeBar.removeClass("vjs-slider-active"),
n.removeClass("vjs-slider-active"),
n.trigger("sliderinactive")
}),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = "vjs-volume-horizontal";
return this.options_.vertical && (e = "vjs-volume-vertical"),
i.prototype.createEl.call(this, "div", {
className: "vjs-volume-control vjs-control " + e
})
}
,
t.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)
}
,
t.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)
}
,
t.handleMouseMove = function(e) {
this.volumeBar.handleMouseMove(e)
}
,
e
}(He);
Os.prototype.options_ = {
children: ["volumeBar"]
},
He.registerComponent("VolumeControl", Os);
var Ns = function(i) {
function e(e, t) {
var n;
return n = i.call(this, e, t) || this,
Ut(Ve(n), e),
n.on(e, ["loadstart", "volumechange"], n.update),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-mute-control " + i.prototype.buildCSSClass.call(this)
}
,
t.handleClick = function(e) {
var t = this.player_.volume()
, n = this.player_.lastVolume_();
if (0 === t) {
var i = n < .1 ? .1 : n;
this.player_.volume(i),
this.player_.muted(!1)
} else
this.player_.muted(!this.player_.muted())
}
,
t.update = function(e) {
this.updateIcon_(),
this.updateControlText_()
}
,
t.updateIcon_ = function() {
var e = this.player_.volume()
, t = 3;
ht && this.player_.tech_ && this.player_.tech_.el_ && 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 n = 0; n < 4; n++)
I(this.el_, "vjs-vol-" + n);
L(this.el_, "vjs-vol-" + t)
}
,
t.updateControlText_ = function() {
var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute";
this.controlText() !== e && this.controlText(e)
}
,
e
}(Qt);
Ns.prototype.controlText_ = "Mute",
He.registerComponent("MuteToggle", Ns);
var Ds = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
"undefined" != typeof t.inline ? t.inline = t.inline : t.inline = !0,
"undefined" != typeof t.volumeControl && !c(t.volumeControl) || (t.volumeControl = t.volumeControl || {},
t.volumeControl.vertical = !t.inline),
(n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
n.on(n.muteToggle, "keyup", n.handleKeyPress),
n.on(n.volumeControl, "keyup", n.handleVolumeControlKeyUp),
n.on("keydown", n.handleKeyPress),
n.on("mouseover", n.handleMouseOver),
n.on("mouseout", n.handleMouseOut),
n.on(n.volumeControl, ["slideractive"], n.sliderActive_),
n.on(n.volumeControl, ["sliderinactive"], n.sliderInactive_),
n
}
We(e, i);
var t = e.prototype;
return t.sliderActive_ = function() {
this.addClass("vjs-slider-active")
}
,
t.sliderInactive_ = function() {
this.removeClass("vjs-slider-active")
}
,
t.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")
}
,
t.createEl = function() {
var e = "vjs-volume-panel-horizontal";
return this.options_.inline || (e = "vjs-volume-panel-vertical"),
i.prototype.createEl.call(this, "div", {
className: "vjs-volume-panel vjs-control " + e
})
}
,
t.dispose = function() {
this.handleMouseOut(),
i.prototype.dispose.call(this)
}
,
t.handleVolumeControlKeyUp = function(e) {
Mt.isEventKey(e, "Esc") && this.muteToggle.focus()
}
,
t.handleMouseOver = function(e) {
this.addClass("vjs-hover"),
ge(f, "keyup", Te(this, this.handleKeyPress))
}
,
t.handleMouseOut = function(e) {
this.removeClass("vjs-hover"),
ye(f, "keyup", Te(this, this.handleKeyPress))
}
,
t.handleKeyPress = function(e) {
Mt.isEventKey(e, "Esc") && this.handleMouseOut()
}
,
e
}(He);
Ds.prototype.options_ = {
children: ["muteToggle", "volumeControl"]
},
He.registerComponent("VolumePanel", Ds);
var Bs = function(l) {
function e(e, t) {
var i, n = t.track, r = e.textTracks();
t.label = n.label || n.language || "Unknown",
t.selected = "showing" === n.mode,
(i = l.call(this, e, t) || this).track = n,
i.kinds = (t.kinds || [t.kind || i.track.kind]).filter(Boolean);
function s() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
i.handleTracksChange.apply(Ve(i), t)
}
function a() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
i.handleSelectedLanguageChange.apply(Ve(i), t)
}
var o;
e.on(["loadstart", "texttrackchange"], s),
r.addEventListener("change", s),
r.addEventListener("selectedlanguagechange", a),
i.on("dispose", function() {
e.off(["loadstart", "texttrackchange"], s),
r.removeEventListener("change", s),
r.removeEventListener("selectedlanguagechange", a)
}),
void 0 === r.onchange && i.on(["tap", "click"], function() {
if ("object" != typeof p.Event)
try {
o = new p.Event("change")
} catch (e) {}
o || (o = f.createEvent("Event")).initEvent("change", !0, !0),
r.dispatchEvent(o)
});
return i.handleTracksChange(),
i
}
We(e, l);
var t = e.prototype;
return t.handleClick = function(e) {
var t = this.track
, n = this.player_.textTracks();
if (l.prototype.handleClick.call(this, e),
n)
for (var i = 0; i < n.length; i++) {
var r = n[i];
-1 !== this.kinds.indexOf(r.kind) && (r === t ? "showing" !== r.mode && (r.mode = "showing") : "disabled" !== r.mode && (r.mode = "disabled"))
}
}
,
t.handleTracksChange = function(e) {
var t = "showing" === this.track.mode;
t !== this.isSelected_ && this.selected(t)
}
,
t.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
}
}
}
,
t.dispose = function() {
this.track = null,
l.prototype.dispose.call(this)
}
,
e
}(Qr);
He.registerComponent("TextTrackMenuItem", Bs);
var Rs = function(n) {
function e(e, t) {
return 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,
n.call(this, e, t) || this
}
We(e, n);
var t = e.prototype;
return t.handleTracksChange = function(e) {
for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
var s = t[i];
if (-1 < this.options_.kinds.indexOf(s.kind) && "showing" === s.mode) {
n = !1;
break
}
}
n !== this.isSelected_ && this.selected(n)
}
,
t.handleSelectedLanguageChange = function(e) {
for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
var s = t[i];
if (-1 < ["captions", "descriptions", "subtitles"].indexOf(s.kind) && "showing" === s.mode) {
n = !1;
break
}
}
n && (this.player_.cache_.selectedLanguage = {
enabled: !1
})
}
,
e
}(Bs);
He.registerComponent("OffTextTrackMenuItem", Rs);
var Fs = function(n) {
function e(e, t) {
return void 0 === t && (t = {}),
t.tracks = e.textTracks(),
n.call(this, e, t) || this
}
return We(e, n),
e.prototype.createItems = function(e, t) {
var n;
void 0 === e && (e = []),
void 0 === t && (t = Bs),
this.label_ && (n = this.label_ + " off"),
e.push(new Rs(this.player_,{
kinds: this.kinds_,
kind: this.kind_,
label: n
})),
this.hideThreshold_ += 1;
var i = this.player_.textTracks();
Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]);
for (var r = 0; r < i.length; r++) {
var s = i[r];
if (-1 < this.kinds_.indexOf(s.kind)) {
var a = new t(this.player_,{
track: s,
kinds: this.kinds_,
kind: this.kind_,
selectable: !0,
multiSelectable: !1
});
a.addClass("vjs-" + s.kind + "-menu-item"),
e.push(a)
}
}
return e
}
,
e
}(ss);
He.registerComponent("TextTrackButton", Fs);
var Hs = function(a) {
function e(e, t) {
var n, i = t.track, r = t.cue, s = e.currentTime();
return t.selectable = !0,
t.multiSelectable = !1,
t.label = r.text,
t.selected = r.startTime <= s && s < r.endTime,
(n = a.call(this, e, t) || this).track = i,
n.cue = r,
i.addEventListener("cuechange", Te(Ve(n), n.update)),
n
}
We(e, a);
var t = e.prototype;
return t.handleClick = function(e) {
a.prototype.handleClick.call(this),
this.player_.currentTime(this.cue.startTime),
this.update(this.cue.startTime)
}
,
t.update = function(e) {
var t = this.cue
, n = this.player_.currentTime();
this.selected(t.startTime <= n && n < t.endTime)
}
,
e
}(Qr);
He.registerComponent("ChaptersTrackMenuItem", Hs);
var Vs = function(i) {
function e(e, t, n) {
return i.call(this, e, t, n) || this
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-chapters-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-chapters-button " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.update = function(e) {
this.track_ && (!e || "addtrack" !== e.type && "removetrack" !== e.type) || this.setTrack(this.findChaptersTrack()),
i.prototype.update.call(this)
}
,
t.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 n = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
n && n.addEventListener("load", this.updateHandler_)
}
}
}
,
t.findChaptersTrack = function() {
for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) {
var n = e[t];
if (n.kind === this.kind_)
return n
}
}
,
t.getMenuCaption = function() {
return this.track_ && this.track_.label ? this.track_.label : this.localize(Re(this.kind_))
}
,
t.createMenu = function() {
return this.options_.title = this.getMenuCaption(),
i.prototype.createMenu.call(this)
}
,
t.createItems = function() {
var e = [];
if (!this.track_)
return e;
var t = this.track_.cues;
if (!t)
return e;
for (var n = 0, i = t.length; n < i; n++) {
var r = t[n]
, s = new Hs(this.player_,{
track: this.track_,
cue: r
});
e.push(s)
}
return e
}
,
e
}(Fs);
Vs.prototype.kind_ = "chapters",
Vs.prototype.controlText_ = "Chapters",
He.registerComponent("ChaptersButton", Vs);
var Qs = function(a) {
function e(e, t, n) {
var i;
i = a.call(this, e, t, n) || this;
var r = e.textTracks()
, s = Te(Ve(i), i.handleTracksChange);
return r.addEventListener("change", s),
i.on("dispose", function() {
r.removeEventListener("change", s)
}),
i
}
We(e, a);
var t = e.prototype;
return t.handleTracksChange = function(e) {
for (var t = this.player().textTracks(), n = !1, i = 0, r = t.length; i < r; i++) {
var s = t[i];
if (s.kind !== this.kind_ && "showing" === s.mode) {
n = !0;
break
}
}
n ? this.disable() : this.enable()
}
,
t.buildCSSClass = function() {
return "vjs-descriptions-button " + a.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-descriptions-button " + a.prototype.buildWrapperCSSClass.call(this)
}
,
e
}(Fs);
Qs.prototype.kind_ = "descriptions",
Qs.prototype.controlText_ = "Descriptions",
He.registerComponent("DescriptionsButton", Qs);
var Us = function(i) {
function e(e, t, n) {
return i.call(this, e, t, n) || this
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-subtitles-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-subtitles-button " + i.prototype.buildWrapperCSSClass.call(this)
}
,
e
}(Fs);
Us.prototype.kind_ = "subtitles",
Us.prototype.controlText_ = "Subtitles",
He.registerComponent("SubtitlesButton", Us);
var qs = function(i) {
function e(e, t) {
var n;
return t.track = {
player: e,
kind: t.kind,
label: t.kind + " settings",
selectable: !1,
default: !1,
mode: "disabled"
},
t.selectable = !1,
t.name = "CaptionSettingsMenuItem",
(n = i.call(this, e, t) || this).addClass("vjs-texttrack-settings"),
n.controlText(", opens " + t.kind + " settings dialog"),
n
}
return We(e, i),
e.prototype.handleClick = function(e) {
this.player().getChild("textTrackSettings").open()
}
,
e
}(Bs);
He.registerComponent("CaptionSettingsMenuItem", qs);
var zs = function(i) {
function e(e, t, n) {
return i.call(this, e, t, n) || this
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-captions-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-captions-button " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createItems = function() {
var e = [];
return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
kind: this.kind_
})),
this.hideThreshold_ += 1),
i.prototype.createItems.call(this, e)
}
,
e
}(Fs);
zs.prototype.kind_ = "captions",
zs.prototype.controlText_ = "Captions",
He.registerComponent("CaptionsButton", zs);
var Ws = function(r) {
function e() {
return r.apply(this, arguments) || this
}
return We(e, r),
e.prototype.createEl = function(e, t, n) {
var i = '",
r.prototype.createEl.call(this, e, b({
innerHTML: i
}, t), n)
}
,
e
}(Bs);
He.registerComponent("SubsCapsMenuItem", Ws);
var Ks = function(i) {
function e(e, t) {
var n;
return void 0 === t && (t = {}),
(n = i.call(this, e, t) || this).label_ = "subtitles",
-1 < ["en", "en-us", "en-ca", "fr-ca"].indexOf(n.player_.language_) && (n.label_ = "captions"),
n.menuButton_.controlText(Re(n.label_)),
n
}
We(e, i);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-subs-caps-button " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-subs-caps-button " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createItems = function() {
var e = [];
return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
kind: this.label_
})),
this.hideThreshold_ += 1),
e = i.prototype.createItems.call(this, e, Ws)
}
,
e
}(Fs);
Ks.prototype.kinds_ = ["captions", "subtitles"],
Ks.prototype.controlText_ = "Subtitles",
He.registerComponent("SubsCapsButton", Ks);
var Xs = function(a) {
function e(e, t) {
var i, n = t.track, r = e.audioTracks();
t.label = n.label || n.language || "Unknown",
t.selected = n.enabled,
(i = a.call(this, e, t) || this).track = n,
i.addClass("vjs-" + n.kind + "-menu-item");
function s() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
i.handleTracksChange.apply(Ve(i), t)
}
return r.addEventListener("change", s),
i.on("dispose", function() {
r.removeEventListener("change", s)
}),
i
}
We(e, a);
var t = e.prototype;
return t.createEl = function(e, t, n) {
var i = '",
a.prototype.createEl.call(this, e, b({
innerHTML: i
}, t), n)
}
,
t.handleClick = function(e) {
var t = this.player_.audioTracks();
a.prototype.handleClick.call(this, e);
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enabled = i === this.track
}
}
,
t.handleTracksChange = function(e) {
this.selected(this.track.enabled)
}
,
e
}(Qr);
He.registerComponent("AudioTrackMenuItem", Xs);
var Gs = function(n) {
function e(e, t) {
return void 0 === t && (t = {}),
t.tracks = e.audioTracks(),
n.call(this, e, t) || this
}
We(e, n);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-audio-button " + n.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-audio-button " + n.prototype.buildWrapperCSSClass.call(this)
}
,
t.createItems = function(e) {
void 0 === e && (e = []),
this.hideThreshold_ = 1;
for (var t = this.player_.audioTracks(), n = 0; n < t.length; n++) {
var i = t[n];
e.push(new Xs(this.player_,{
track: i,
selectable: !0,
multiSelectable: !1
}))
}
return e
}
,
e
}(ss);
Gs.prototype.controlText_ = "Audio Track",
He.registerComponent("AudioTrackButton", Gs);
var Ys = function(s) {
function e(e, t) {
var n, i = t.rate, r = parseFloat(i, 10);
return t.label = i,
t.selected = 1 === r,
t.selectable = !0,
t.multiSelectable = !1,
(n = s.call(this, e, t) || this).label = i,
n.rate = r,
n.on(e, "ratechange", n.update),
n
}
We(e, s);
var t = e.prototype;
return t.handleClick = function(e) {
s.prototype.handleClick.call(this),
this.player().playbackRate(this.rate)
}
,
t.update = function(e) {
this.selected(this.player().playbackRate() === this.rate)
}
,
e
}(Qr);
Ys.prototype.contentElType = "button",
He.registerComponent("PlaybackRateMenuItem", Ys);
var $s = function(i) {
function e(e, t) {
var n;
return (n = i.call(this, e, t) || this).updateVisibility(),
n.updateLabel(),
n.on(e, "loadstart", n.updateVisibility),
n.on(e, "ratechange", n.updateLabel),
n
}
We(e, i);
var t = e.prototype;
return t.createEl = function() {
var e = i.prototype.createEl.call(this);
return "en" === this.player().language() ? this.labelEl_ = w("div", {
className: "vjs-playback-rate-value",
innerHTML: "1x"
}) : (this.player().language(),
this.labelEl_ = w("div", {
className: "vjs-playback-rate-value",
innerHTML: "倍速"
})),
e.appendChild(this.labelEl_),
e
}
,
t.dispose = function() {
this.labelEl_ = null,
i.prototype.dispose.call(this)
}
,
t.buildCSSClass = function() {
return "vjs-playback-rate " + i.prototype.buildCSSClass.call(this)
}
,
t.buildWrapperCSSClass = function() {
return "vjs-playback-rate " + i.prototype.buildWrapperCSSClass.call(this)
}
,
t.createMenu = function() {
var e = new Fr(this.player())
, t = this.playbackRates();
if (t)
for (var n = t.length - 1; 0 <= n; n--)
e.addChild(new Ys(this.player(),{
rate: t[n] + "x"
}));
return e
}
,
t.updateARIAAttributes = function() {
this.el().setAttribute("aria-valuenow", this.player().playbackRate())
}
,
t.handleClick = function(e) {}
,
t.playbackRates = function() {
return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates
}
,
t.playbackRateSupported = function() {
return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length
}
,
t.updateVisibility = function(e) {
this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
}
,
t.updateLabel = function(e) {
this.playbackRateSupported() && ("en" === this.player().language() ? this.labelEl_.innerHTML = this.player().playbackRate() + "x" : this.labelEl_.innerHTML = "倍速")
}
,
e
}(Hr);
$s.prototype.controlText_ = "Playback Rate",
He.registerComponent("PlaybackRateMenuButton", $s);
var Js = function(e) {
function t() {
return e.apply(this, arguments) || this
}
We(t, e);
var n = t.prototype;
return n.buildCSSClass = function() {
return "vjs-spacer " + e.prototype.buildCSSClass.call(this)
}
,
n.createEl = function() {
return e.prototype.createEl.call(this, "div", {
className: this.buildCSSClass()
})
}
,
t
}(He);
He.registerComponent("Spacer", Js);
var Zs = function(t) {
function e() {
return t.apply(this, arguments) || this
}
We(e, t);
var n = e.prototype;
return n.buildCSSClass = function() {
return "vjs-custom-control-spacer " + t.prototype.buildCSSClass.call(this)
}
,
n.createEl = function() {
var e = t.prototype.createEl.call(this, {
className: this.buildCSSClass()
});
return e.innerHTML = " ",
e
}
,
e
}(Js);
He.registerComponent("CustomControlSpacer", Zs);
var ea = function(e) {
function t() {
return e.apply(this, arguments) || this
}
return We(t, e),
t.prototype.createEl = function() {
return e.prototype.createEl.call(this, "div", {
className: "vjs-control-bar",
dir: "ltr"
})
}
,
t
}(He);
ea.prototype.options_ = {
children: ["playToggle", "nextPanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "chooseVideoButton", "audioModeButton", "playbackRateMenuButton", "playbackQualityMenuButton", "playbackQualityMenuButton3", "descriptionsButton", "subsCapsButton", "audioTrackButton", "setupMenuButton", "volumePanel", "webfullscreenToggle", "fullscreenToggle", "progressControl"]
},
He.registerComponent("ControlBar", ea);
var ta = function(r) {
function e(e, t) {
var n;
(n = r.call(this, e, t) || this).on(e, "error", n.open);
var i = e;
return n.el().oncontextmenu = function(e) {
return !0 === e.ctrlKey && e.altKey ? i.showContextMenu(e, !0) : !0 === e.ctrlKey && i.showContextMenu(e, !1),
!1
}
,
n
}
We(e, r);
var t = e.prototype;
return t.buildCSSClass = function() {
return "vjs-error-display " + r.prototype.buildCSSClass.call(this)
}
,
t.content = function() {
var e = this.player().error();
return e ? "" + this.localize(e.message) : "无法继续播放"
}
,
t.fill = function() {
r.prototype.fill.call(this)
}
,
t.description = function() {
return ""
}
,
e
}(Ot);
ta.prototype.options_ = r({}, Ot.prototype.options_, {
pauseOnOpen: !0,
fillAlways: !0,
temporary: !1,
uncloseable: !0
}),
He.registerComponent("ErrorDisplay", ta);
var na = "vjs-text-track-settings"
, ia = ["#000", "Black"]
, ra = ["#00F", "Blue"]
, sa = ["#0FF", "Cyan"]
, aa = ["#0F0", "Green"]
, oa = ["#F0F", "Magenta"]
, la = ["#F00", "Red"]
, ua = ["#FFF", "White"]
, ca = ["#FF0", "Yellow"]
, ha = ["1", "Opaque"]
, da = ["0.5", "Semi-Transparent"]
, pa = ["0", "Transparent"]
, fa = {
backgroundColor: {
selector: ".vjs-bg-color > select",
id: "captions-background-color-%s",
label: "Color",
options: [ia, ua, la, aa, ra, ca, oa, sa]
},
backgroundOpacity: {
selector: ".vjs-bg-opacity > select",
id: "captions-background-opacity-%s",
label: "Transparency",
options: [ha, da, pa]
},
color: {
selector: ".vjs-fg-color > select",
id: "captions-foreground-color-%s",
label: "Color",
options: [ua, ia, la, aa, ra, ca, oa, sa]
},
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: [ha, da]
},
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: [pa, da, ha]
}
};
function va(e, t) {
if (t && (e = t(e)),
e && "none" !== e)
return e
}
fa.windowColor.options = fa.backgroundColor.options;
var ga = function(i) {
function e(e, t) {
var n;
return t.temporary = !1,
(n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
n.fill(),
n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
n.endDialog = w("p", {
className: "vjs-control-text",
textContent: n.localize("End of dialog window.")
}),
n.el().appendChild(n.endDialog),
n.setDefaults(),
void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
n.on(n.$(".vjs-done-button"), "click", function() {
n.saveSettings(),
n.close()
}),
n.on(n.$(".vjs-default-button"), "click", function() {
n.setDefaults(),
n.updateDisplay()
}),
a(fa, function(e) {
n.on(n.$(e.selector), "change", n.updateDisplay)
}),
n.options_.persistTextTrackSettings && n.restoreSettings(),
n
}
We(e, i);
var t = e.prototype;
return t.dispose = function() {
this.endDialog = null,
i.prototype.dispose.call(this)
}
,
t.createElSelect_ = function(e, t, n) {
var i = this;
void 0 === t && (t = ""),
void 0 === n && (n = "label");
var r = fa[e]
, s = r.id.replace("%s", this.id_)
, a = [t, s].join(" ").trim();
return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "" + n + ">", '").join("")
}
,
t.createElFgColor_ = function() {
var e = "captions-text-legend-" + this.id_;
return ['"].join("")
}
,
t.createElBgColor_ = function() {
var e = "captions-background-" + this.id_;
return ['"].join("")
}
,
t.createElWinColor_ = function() {
var e = "captions-window-" + this.id_;
return ['"].join("")
}
,
t.createElColors_ = function() {
return w("div", {
className: "vjs-track-settings-colors",
innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
})
}
,
t.createElFont_ = function() {
return w("div", {
className: "vjs-track-settings-font",
innerHTML: ['", '", '"].join("")
})
}
,
t.createElControls_ = function() {
var e = this.localize("restore all settings to the default values");
return w("div", {
className: "vjs-track-settings-controls",
innerHTML: ['", '"].join("")
})
}
,
t.content = function() {
return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
}
,
t.label = function() {
return this.localize("Caption Settings Dialog")
}
,
t.description = function() {
return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
}
,
t.buildCSSClass = function() {
return i.prototype.buildCSSClass.call(this) + " vjs-text-track-settings"
}
,
t.getValues = function() {
var r = this;
return o(fa, function(e, t, n) {
var i = function(e, t) {
return va(e.options[e.options.selectedIndex].value, t)
}(r.$(t.selector), t.parser);
return void 0 !== i && (e[n] = i),
e
}, {})
}
,
t.setValues = function(n) {
var i = this;
a(fa, function(e, t) {
!function(e, t, n) {
if (t)
for (var i = 0; i < e.options.length; i++)
if (va(e.options[i].value, n) === t) {
e.selectedIndex = i;
break
}
}(i.$(e.selector), n[t], e.parser)
})
}
,
t.setDefaults = function() {
var n = this;
a(fa, function(e) {
var t = e.hasOwnProperty("default") ? e.default : 0;
n.$(e.selector).selectedIndex = t
})
}
,
t.restoreSettings = function() {
var e;
try {
e = JSON.parse(p.localStorage.getItem(na))
} catch (e) {
m.warn(e)
}
e && this.setValues(e)
}
,
t.saveSettings = function() {
if (this.options_.persistTextTrackSettings) {
var e = this.getValues();
try {
Object.keys(e).length ? p.localStorage.setItem(na, JSON.stringify(e)) : p.localStorage.removeItem(na)
} catch (e) {
m.warn(e)
}
}
}
,
t.updateDisplay = function() {
var e = this.player_.getChild("textTrackDisplay");
e && e.updateDisplay()
}
,
t.conditionalBlur_ = function() {
this.previouslyActiveEl_ = null;
var e = this.player_.controlBar
, t = e && e.subsCapsButton
, n = e && e.captionsButton;
t ? t.focus() : n && n.focus()
}
,
e
}(Ot);
He.registerComponent("TextTrackSettings", ga);
var ya = function(s) {
function e(e, t) {
var n, i = t.ResizeObserver || p.ResizeObserver;
null === t.ResizeObserver && (i = !1);
var r = Fe({
createEl: !i,
reportTouchActivity: !1
}, t);
return (n = s.call(this, e, r) || this).ResizeObserver = t.ResizeObserver || p.ResizeObserver,
n.loadListener_ = null,
n.resizeObserver_ = null,
n.debouncedHandler_ = function(i, r, s, a) {
var o;
void 0 === a && (a = p);
function e() {
var e = this
, t = arguments
, n = function() {
n = o = null,
s || i.apply(e, t)
};
!o && s && i.apply(e, t),
a.clearTimeout(o),
o = a.setTimeout(n, r)
}
return e.cancel = function() {
a.clearTimeout(o),
o = null
}
,
e
}(function() {
n.resizeHandler()
}, 100, !1, Ve(n)),
i ? (n.resizeObserver_ = new n.ResizeObserver(n.debouncedHandler_),
n.resizeObserver_.observe(e.el())) : (n.loadListener_ = function() {
if (n.el_ && n.el_.contentWindow) {
var e = n.debouncedHandler_
, t = n.unloadListener_ = function() {
ye(this, "resize", e),
ye(this, "unload", t),
t = null
}
;
ge(n.el_.contentWindow, "unload", t),
ge(n.el_.contentWindow, "resize", e)
}
}
,
n.one("load", n.loadListener_)),
n
}
We(e, s);
var t = e.prototype;
return t.createEl = function() {
return s.prototype.createEl.call(this, "iframe", {
className: "vjs-resize-manager",
tabIndex: -1
}, {
"aria-hidden": "true"
})
}
,
t.resizeHandler = function() {
this.player_ && this.player_.trigger && this.player_.trigger("playerresize")
}
,
t.dispose = function() {
this.debouncedHandler_ && this.debouncedHandler_.cancel(),
this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()),
this.resizeObserver_.disconnect()),
this.loadListener_ && this.off("load", this.loadListener_),
this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow),
this.ResizeObserver = null,
this.resizeObserver = null,
this.debouncedHandler_ = null,
this.loadListener_ = null,
s.prototype.dispose.call(this)
}
,
e
}(He);
He.registerComponent("ResizeManager", ya);
var ma = {
trackingThreshold: 30,
liveTolerance: 15
}
, _a = function(r) {
function e(e, t) {
var n, i = Fe(ma, t, {
createEl: !1
});
return (n = r.call(this, e, i) || this).reset_(),
n.on(n.player_, "durationchange", n.handleDurationchange),
st && "hidden"in f && "visibilityState"in f && n.on(f, "visibilitychange", n.handleVisibilityChange),
n
}
We(e, r);
var t = e.prototype;
return t.handleVisibilityChange = function() {
this.player_.duration() === 1 / 0 && (f.hidden ? this.stopTracking() : this.startTracking())
}
,
t.trackLive_ = function() {
var e = this.player_.seekable();
if (e && e.length) {
var t = Number(p.performance.now().toFixed(4))
, n = -1 === this.lastTime_ ? 0 : (t - this.lastTime_) / 1e3;
this.lastTime_ = t,
this.pastSeekEnd_ = this.pastSeekEnd() + n;
var i = this.liveCurrentTime()
, r = this.player_.currentTime()
, s = this.player_.paused() || this.seekedBehindLive_ || Math.abs(i - r) > this.options_.liveTolerance;
this.timeupdateSeen_ && i !== 1 / 0 || (s = !1),
s !== this.behindLiveEdge_ && (this.behindLiveEdge_ = s,
this.trigger("liveedgechange"))
}
}
,
t.handleDurationchange = function() {
this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold ? (this.player_.options_.liveui && this.player_.addClass("vjs-liveui"),
this.startTracking()) : (this.player_.removeClass("vjs-liveui"),
this.stopTracking())
}
,
t.startTracking = function() {
this.isTracking() || (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()),
this.trackingInterval_ = this.setInterval(this.trackLive_, 30),
this.trackLive_(),
this.on(this.player_, ["play", "pause"], this.trackLive_),
this.timeupdateSeen_ ? this.on(this.player_, "seeked", this.handleSeeked) : (this.one(this.player_, "play", this.handlePlay),
this.one(this.player_, "timeupdate", this.handleFirstTimeupdate)))
}
,
t.handleFirstTimeupdate = function() {
this.timeupdateSeen_ = !0,
this.on(this.player_, "seeked", this.handleSeeked)
}
,
t.handleSeeked = function() {
var e = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
this.seekedBehindLive_ = !this.skipNextSeeked_ && 2 < e,
this.skipNextSeeked_ = !1,
this.trackLive_()
}
,
t.handlePlay = function() {
this.one(this.player_, "timeupdate", this.seekToLiveEdge)
}
,
t.reset_ = function() {
this.lastTime_ = -1,
this.pastSeekEnd_ = 0,
this.lastSeekEnd_ = -1,
this.behindLiveEdge_ = !0,
this.timeupdateSeen_ = !1,
this.seekedBehindLive_ = !1,
this.skipNextSeeked_ = !1,
this.clearInterval(this.trackingInterval_),
this.trackingInterval_ = null,
this.off(this.player_, ["play", "pause"], this.trackLive_),
this.off(this.player_, "seeked", this.handleSeeked),
this.off(this.player_, "play", this.handlePlay),
this.off(this.player_, "timeupdate", this.handleFirstTimeupdate),
this.off(this.player_, "timeupdate", this.seekToLiveEdge)
}
,
t.stopTracking = function() {
this.isTracking() && (this.reset_(),
this.trigger("liveedgechange"))
}
,
t.seekableEnd = function() {
for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
t.push(e.end(n));
return t.length ? t.sort()[t.length - 1] : 1 / 0
}
,
t.seekableStart = function() {
for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
t.push(e.start(n));
return t.length ? t.sort()[0] : 0
}
,
t.liveWindow = function() {
var e = this.liveCurrentTime();
return e === 1 / 0 ? 1 / 0 : e - this.seekableStart()
}
,
t.isLive = function() {
return this.isTracking()
}
,
t.atLiveEdge = function() {
return !this.behindLiveEdge()
}
,
t.liveCurrentTime = function() {
return this.pastSeekEnd() + this.seekableEnd()
}
,
t.pastSeekEnd = function() {
var e = this.seekableEnd();
return -1 !== this.lastSeekEnd_ && e !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0),
this.lastSeekEnd_ = e,
this.pastSeekEnd_
}
,
t.behindLiveEdge = function() {
return this.behindLiveEdge_
}
,
t.isTracking = function() {
return "number" == typeof this.trackingInterval_
}
,
t.seekToLiveEdge = function() {
this.seekedBehindLive_ = !1,
this.atLiveEdge() || (this.skipNextSeeked_ = !0,
this.player_.currentTime(this.liveCurrentTime()))
}
,
t.dispose = function() {
this.off(f, "visibilitychange", this.handleVisibilityChange),
this.stopTracking(),
r.prototype.dispose.call(this)
}
,
e
}(He);
He.registerComponent("LiveTracker", _a);
function ba(e) {
var t = e.el();
if (t.hasAttribute("src"))
return e.triggerSourceset(t.src),
!0;
var n = e.$$("source")
, i = []
, r = "";
if (!n.length)
return !1;
for (var s = 0; s < n.length; s++) {
var a = n[s].src;
a && -1 === i.indexOf(a) && i.push(a)
}
return !!i.length && (1 === i.length && (r = i[0]),
e.triggerSourceset(r),
!0)
}
function Ta(e, t) {
for (var n = {}, i = 0; i < e.length && !((n = Object.getOwnPropertyDescriptor(e[i], t)) && n.set && n.get); i++)
;
return n.enumerable = !0,
n.configurable = !0,
n
}
function Ca(s) {
var a = s.el();
if (!a.resetSourceWatch_) {
var t = {}
, e = function(e) {
return Ta([e.el(), p.HTMLMediaElement.prototype, p.Element.prototype, wa], "innerHTML")
}(s)
, n = function(r) {
return function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
var i = r.apply(a, t);
return ba(s),
i
}
};
["append", "appendChild", "insertAdjacentHTML"].forEach(function(e) {
a[e] && (t[e] = a[e],
a[e] = n(t[e]))
}),
Object.defineProperty(a, "innerHTML", Fe(e, {
set: n(e.set)
})),
a.resetSourceWatch_ = function() {
a.resetSourceWatch_ = null,
Object.keys(t).forEach(function(e) {
a[e] = t[e]
}),
Object.defineProperty(a, "innerHTML", e)
}
,
s.one("sourceset", a.resetSourceWatch_)
}
}
function ka(i) {
if (i.featuresSourceset) {
var r = i.el();
if (!r.resetSourceset_) {
var n = function(e) {
return Ta([e.el(), p.HTMLMediaElement.prototype, xa], "src")
}(i)
, s = r.setAttribute
, t = r.load;
Object.defineProperty(r, "src", Fe(n, {
set: function(e) {
var t = n.set.call(r, e);
return i.triggerSourceset(r.src),
t
}
})),
r.setAttribute = function(e, t) {
var n = s.call(r, e, t);
return /src/i.test(e) && i.triggerSourceset(r.src),
n
}
,
r.load = function() {
var e = t.call(r);
return ba(i) || (i.triggerSourceset(""),
Ca(i)),
e
}
,
r.currentSrc ? i.triggerSourceset(r.currentSrc) : ba(i) || Ca(i),
r.resetSourceset_ = function() {
r.resetSourceset_ = null,
r.load = t,
r.setAttribute = s,
Object.defineProperty(r, "src", n),
r.resetSourceWatch_ && r.resetSourceWatch_()
}
}
}
}
function Ea(t, n, i, e) {
function r(e) {
return Object.defineProperty(t, n, {
value: e,
enumerable: !0,
writable: !0
})
}
void 0 === e && (e = !0);
var s = {
configurable: !0,
enumerable: !0,
get: function() {
var e = i();
return r(e),
e
}
};
return e && (s.set = r),
Object.defineProperty(t, n, s)
}
var Sa, wa = 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 n = f.createDocumentFragment(); t.childNodes.length; )
n.appendChild(t.childNodes[0]);
return this.innerText = "",
p.Element.prototype.appendChild.call(this, n),
this.innerHTML
}
}), xa = Object.defineProperty({}, "src", {
get: function() {
return this.hasAttribute("src") ? an(p.Element.prototype.getAttribute.call(this, "src")) : ""
},
set: function(e) {
return p.Element.prototype.setAttribute.call(this, "src", e),
e
}
}), Aa = function(c) {
function o(e, t) {
var n;
n = c.call(this, e, t) || this;
var i = e.source
, r = !1;
if (i && (n.el_.currentSrc !== i.src || e.tag && 3 === e.tag.initNetworkState_) ? n.setSource(i) : n.handleLateInit_(n.el_),
e.enableSourceset && n.setupSourcesetHandling_(),
n.el_.hasChildNodes()) {
for (var s = n.el_.childNodes, a = s.length, o = []; a--; ) {
var l = s[a];
"track" === l.nodeName.toLowerCase() && (n.featuresNativeTextTracks ? (n.remoteTextTrackEls().addTrackElement_(l),
n.remoteTextTracks().addTrack(l.track),
n.textTracks().addTrack(l.track),
r || n.el_.hasAttribute("crossorigin") || !ln(l.src) || (r = !0)) : o.push(l))
}
for (var u = 0; u < o.length; u++)
n.el_.removeChild(o[u])
}
return n.proxyNativeTracks_(),
n.featuresNativeTextTracks && r && m.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),
n.restoreMetadataTracksInIOSNativePlayer_(),
(lt || ct || et) && !0 === e.nativeControlsForTouch && n.setControls(!0),
n.proxyWebkitFullscreen_(),
n.triggerReady(),
n
}
We(o, c);
var e = o.prototype;
return e.dispose = function() {
this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(),
o.disposeMediaElement(this.el_),
this.options_ = null,
c.prototype.dispose.call(this)
}
,
e.setupSourcesetHandling_ = function() {
ka(this)
}
,
e.restoreMetadataTracksInIOSNativePlayer_ = function() {
function e() {
n = [];
for (var e = 0; e < i.length; e++) {
var t = i[e];
"metadata" === t.kind && n.push({
track: t,
storedMode: t.mode
})
}
}
var n, i = this.textTracks();
e(),
i.addEventListener("change", e),
this.on("dispose", function() {
return i.removeEventListener("change", e)
});
function r() {
for (var e = 0; e < n.length; e++) {
var t = n[e];
"disabled" === t.track.mode && t.track.mode !== t.storedMode && (t.track.mode = t.storedMode)
}
i.removeEventListener("change", r)
}
this.on("webkitbeginfullscreen", function() {
i.removeEventListener("change", e),
i.removeEventListener("change", r),
i.addEventListener("change", r)
}),
this.on("webkitendfullscreen", function() {
i.removeEventListener("change", e),
i.addEventListener("change", e),
i.removeEventListener("change", r)
})
}
,
e.overrideNative_ = function(e, t) {
var n = this;
if (t === this["featuresNative" + e + "Tracks"]) {
var i = e.toLowerCase();
this[i + "TracksListeners_"] && Object.keys(this[i + "TracksListeners_"]).forEach(function(e) {
n.el()[i + "Tracks"].removeEventListener(e, n[i + "TracksListeners_"][e])
}),
this["featuresNative" + e + "Tracks"] = !t,
this[i + "TracksListeners_"] = null,
this.proxyNativeTracksForType_(i)
}
}
,
e.overrideNativeAudioTracks = function(e) {
this.overrideNative_("Audio", e)
}
,
e.overrideNativeVideoTracks = function(e) {
this.overrideNative_("Video", e)
}
,
e.proxyNativeTracksForType_ = function(n) {
var i = this
, e = On[n]
, r = this.el()[e.getterName]
, s = this[e.getterName]();
if (this["featuresNative" + e.capitalName + "Tracks"] && r && r.addEventListener) {
var a = {
change: function(e) {
var t = {
type: "change",
target: s,
currentTarget: s,
srcElement: s
};
s.trigger(t),
"text" === n && i[Nn.remoteText.getterName]().trigger(t)
},
addtrack: function(e) {
s.addTrack(e.track)
},
removetrack: function(e) {
s.removeTrack(e.track)
}
}
, t = function() {
for (var e = [], t = 0; t < s.length; t++) {
for (var n = !1, i = 0; i < r.length; i++)
if (r[i] === s[t]) {
n = !0;
break
}
n || e.push(s[t])
}
for (; e.length; )
s.removeTrack(e.shift())
};
this[e.getterName + "Listeners_"] = a,
Object.keys(a).forEach(function(t) {
var n = a[t];
r.addEventListener(t, n),
i.on("dispose", function(e) {
return r.removeEventListener(t, n)
})
}),
this.on("loadstart", t),
this.on("dispose", function(e) {
return i.off("loadstart", t)
})
}
}
,
e.proxyNativeTracks_ = function() {
var t = this;
On.names.forEach(function(e) {
t.proxyNativeTracksForType_(e)
})
}
,
e.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),
o.disposeMediaElement(e),
e = t
} else {
e = f.createElement("video");
var n = Fe({}, this.options_.tag && O(this.options_.tag));
lt && !0 === this.options_.nativeControlsForTouch || delete n.controls,
j(e, b(n, {
id: this.options_.techId,
class: "vjs-tech"
}))
}
e.playerId = this.options_.playerId
}
"undefined" != typeof this.options_.preload && D(e, "preload", this.options_.preload);
for (var i = ["loop", "muted", "playsinline", "autoplay"], r = 0; r < i.length; r++) {
var s = i[r]
, a = this.options_[s];
"undefined" != typeof a && (a ? D(e, s, s) : B(e, s),
e[s] = a)
}
return e
}
,
e.handleLateInit_ = function(e) {
if (0 !== e.networkState && 3 !== e.networkState) {
if (0 === e.readyState) {
var t = !1
, n = function() {
t = !0
};
this.on("loadstart", n);
var i = function() {
t || this.trigger("loadstart")
};
return this.on("loadedmetadata", i),
void this.ready(function() {
this.off("loadstart", n),
this.off("loadedmetadata", i),
t || this.trigger("loadstart")
})
}
var r = ["loadstart"];
r.push("loadedmetadata"),
2 <= e.readyState && r.push("loadeddata"),
3 <= e.readyState && r.push("canplay"),
4 <= e.readyState && r.push("canplaythrough"),
this.ready(function() {
r.forEach(function(e) {
this.trigger(e)
}, this)
})
}
}
,
e.setCurrentTime = function(e) {
try {
this.el_.currentTime = e
} catch (e) {
m(e, "Video is not ready. (Video.js)")
}
}
,
e.duration = function() {
var t = this;
if (this.el_.duration === 1 / 0 && Je && it && 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
}
,
e.width = function() {
return this.el_.offsetWidth
}
,
e.height = function() {
return this.el_.offsetHeight
}
,
e.proxyWebkitFullscreen_ = function() {
var e = this;
if ("webkitDisplayingFullscreen"in this.el_) {
var t = function() {
this.trigger("fullscreenchange", {
isFullscreen: !1
})
}
, n = function() {
"webkitPresentationMode"in this.el_ && "picture-in-picture" !== this.el_.webkitPresentationMode && (this.one("webkitendfullscreen", t),
this.trigger("fullscreenchange", {
isFullscreen: !0
}))
};
this.on("webkitbeginfullscreen", n),
this.on("dispose", function() {
e.off("webkitbeginfullscreen", n),
e.off("webkitendfullscreen", t)
})
}
}
,
e.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
}
,
e.enterFullScreen = function() {
var e = this.el_;
if (e.paused && e.networkState <= e.HAVE_METADATA)
At(this.el_.play()),
this.setTimeout(function() {
e.pause();
try {
e.webkitEnterFullScreen()
} catch (e) {
this.trigger("fullscreenerror", e)
}
}, 0);
else
try {
e.webkitEnterFullScreen()
} catch (e) {
this.trigger("fullscreenerror", e)
}
}
,
e.exitFullScreen = function() {
this.el_.webkitDisplayingFullscreen ? this.el_.webkitExitFullScreen() : this.trigger("fullscreenerror", new Error("The video is not fullscreen"))
}
,
e.requestPictureInPicture = function() {
return this.el_.requestPictureInPicture()
}
,
e.src = function(e) {
if (void 0 === e)
return this.el_.src;
this.setSrc(e)
}
,
e.reset = function() {
o.resetMediaElement(this.el_)
}
,
e.currentSrc = function() {
return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc
}
,
e.setControls = function(e) {
this.el_.controls = !!e
}
,
e.addTextTrack = function(e, t, n) {
return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, n) : c.prototype.addTextTrack.call(this, e, t, n)
}
,
e.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
}
,
e.addRemoteTextTrack = function(e, t) {
var n = c.prototype.addRemoteTextTrack.call(this, e, t);
return this.featuresNativeTextTracks && this.el().appendChild(n),
n
}
,
e.removeRemoteTextTrack = function(e) {
if (c.prototype.removeRemoteTextTrack.call(this, e),
this.featuresNativeTextTracks)
for (var t = this.$$("track"), n = t.length; n--; )
e !== t[n] && e !== t[n].track || this.el().removeChild(t[n])
}
,
e.getVideoPlaybackQuality = function() {
if ("function" == typeof this.el().getVideoPlaybackQuality)
return this.el().getVideoPlaybackQuality();
var e = {};
return "undefined" != typeof this.el().webkitDroppedFrameCount && "undefined" != typeof 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
}
,
o
}(pi);
Ea(Aa, "TEST_VID", function() {
if (C()) {
var e = f.createElement("video")
, t = f.createElement("track");
return t.kind = "captions",
t.srclang = "en",
t.label = "English",
e.appendChild(t),
e
}
}),
Aa.isSupported = function() {
try {
Aa.TEST_VID.volume = .5
} catch (e) {
return !1
}
return !(!Aa.TEST_VID || !Aa.TEST_VID.canPlayType)
}
,
Aa.canPlayType = function(e) {
return Aa.TEST_VID.canPlayType(e)
}
,
Aa.canPlaySource = function(e, t) {
return Aa.canPlayType(e.type)
}
,
Aa.canControlVolume = function() {
try {
var e = Aa.TEST_VID.volume;
return Aa.TEST_VID.volume = e / 2 + .1,
e !== Aa.TEST_VID.volume
} catch (e) {
return !1
}
}
,
Aa.canMuteVolume = function() {
try {
var e = Aa.TEST_VID.muted;
return Aa.TEST_VID.muted = !e,
Aa.TEST_VID.muted ? D(Aa.TEST_VID, "muted", "muted") : B(Aa.TEST_VID, "muted"),
e !== Aa.TEST_VID.muted
} catch (e) {
return !1
}
}
,
Aa.canControlPlaybackRate = function() {
if (Je && it && rt < 58)
return !1;
try {
var e = Aa.TEST_VID.playbackRate;
return Aa.TEST_VID.playbackRate = e / 2 + .1,
e !== Aa.TEST_VID.playbackRate
} catch (e) {
return !1
}
}
,
Aa.canOverrideAttributes = function() {
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
}
,
Aa.supportsNativeTextTracks = function() {
return dt || ht && it
}
,
Aa.supportsNativeVideoTracks = function() {
return !(!Aa.TEST_VID || !Aa.TEST_VID.videoTracks)
}
,
Aa.supportsNativeAudioTracks = function() {
return !(!Aa.TEST_VID || !Aa.TEST_VID.audioTracks)
}
,
Aa.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "qualitychange", "resize", "volumechange"],
[["featuresVolumeControl", "canControlVolume"], ["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(e) {
var t = e[0]
, n = e[1];
Ea(Aa.prototype, t, function() {
return Aa[n]()
}, !0)
}),
Aa.prototype.movingMediaElementInDOM = !ht,
Aa.prototype.featuresFullscreenResize = !0,
Aa.prototype.featuresProgressEvents = !0,
Aa.prototype.featuresTimeupdateEvents = !0,
Aa.patchCanPlayType = function() {
4 <= Ze && !tt && !it && (Sa = Aa.TEST_VID && Aa.TEST_VID.constructor.prototype.canPlayType,
Aa.TEST_VID.constructor.prototype.canPlayType = function(e) {
return e && /^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e) ? "maybe" : Sa.call(this, e)
}
)
}
,
Aa.unpatchCanPlayType = function() {
var e = Aa.TEST_VID.constructor.prototype.canPlayType;
return Sa && (Aa.TEST_VID.constructor.prototype.canPlayType = Sa),
e
}
,
Aa.patchCanPlayType(),
Aa.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) {}
}()
}
}
,
Aa.resetMediaElement = function(e) {
if (e) {
for (var t = e.querySelectorAll("source"), n = t.length; n--; )
e.removeChild(t[n]);
e.removeAttribute("src"),
"function" == typeof e.load && function() {
try {
e.load()
} catch (e) {}
}()
}
}
,
["muted", "defaultMuted", "autoplay", "controls", "loop", "playsinline"].forEach(function(e) {
Aa.prototype[e] = function() {
return this.el_[e] || this.el_.hasAttribute(e)
}
}),
["muted", "defaultMuted", "autoplay", "loop", "playsinline"].forEach(function(t) {
Aa.prototype["set" + Re(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", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "played", "networkState", "readyState", "videoWidth", "videoHeight", "crossOrigin"].forEach(function(e) {
Aa.prototype[e] = function() {
return this.el_[e]
}
}),
["volume", "src", "poster", "preload", "playbackRate", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "crossOrigin"].forEach(function(t) {
Aa.prototype["set" + Re(t)] = function(e) {
this.el_[t] = e
}
}),
["pause", "load", "play"].forEach(function(e) {
Aa.prototype[e] = function() {
return this.el_[e]()
}
}),
pi.withSourceHandlers(Aa),
Aa.nativeSourceHandler = {},
Aa.nativeSourceHandler.canPlayType = function(e) {
try {
return Aa.TEST_VID.canPlayType(e)
} catch (e) {
return ""
}
}
,
Aa.nativeSourceHandler.canHandleSource = function(e, t) {
if (e.type)
return Aa.nativeSourceHandler.canPlayType(e.type);
if (e.src) {
var n = on(e.src);
return Aa.nativeSourceHandler.canPlayType("video/" + n)
}
return ""
}
,
Aa.nativeSourceHandler.handleSource = function(e, t, n) {
t.setSrc(e.src)
}
,
Aa.nativeSourceHandler.dispose = function() {}
,
Aa.registerSourceHandler(Aa.nativeSourceHandler),
pi.registerTech("Html5", Aa);
var Pa = ["progress", "abort", "suspend", "emptied", "stalled", "loadedmetadata", "loadeddata", "timeupdate", "resize", "volumechange", "texttrackchange"]
, La = {
canplay: "CanPlay",
canplaythrough: "CanPlayThrough",
playing: "Playing",
seeked: "Seeked"
}
, Ia = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"]
, Ma = {};
Ia.forEach(function(e) {
var t = "x" === e.charAt(0) ? "x-" + e.substring(1) : e;
Ma[e] = "vjs-layout-" + t
});
var ja = {
tiny: 210,
xsmall: 320,
small: 425,
medium: 768,
large: 1440,
xlarge: 2560,
huge: 1 / 0
}
, Oa = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
, Na = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
, Da = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
, Ba = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
, Ra = function(h) {
function d(e, t, n) {
var i;
if (e.id = e.id || t.id || "vjs_video_" + le(),
(t = b(d.getTagSettings(e), t)).initChildren = !1,
t.createEl = !1,
t.evented = !1,
t.reportTouchActivity = !1,
!t.language)
if ("function" == typeof e.closest) {
var r = e.closest("[lang]");
r && r.getAttribute && (t.language = r.getAttribute("lang"))
} else
for (var s = e; s && 1 === s.nodeType; ) {
if (O(s).hasOwnProperty("lang")) {
t.language = s.getAttribute("lang");
break
}
s = s.parentNode
}
if ((i = h.call(this, null, t, n) || this).boundDocumentFullscreenChange_ = Te(Ve(i), i.documentFullscreenChange_),
i.boundFullWindowOnEscKey_ = Te(Ve(i), i.fullWindowOnEscKey),
i.isFullscreen_ = !1,
i.isWebFullscreen_ = !1,
i.log = _(i.id_),
i.fsApi_ = _t,
i.isPosterFromTech_ = !1,
i.queuedCallbacks_ = [],
i.isReady_ = !1,
i.hasStarted_ = !1,
i.userActive_ = !1,
!i.options_ || !i.options_.techOrder || !i.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 (i.tag = e,
i.tagAttributes = e && O(e),
i.language(i.options_.language),
t.languages) {
var a = {};
Object.getOwnPropertyNames(t.languages).forEach(function(e) {
a[e.toLowerCase()] = t.languages[e]
}),
i.languages_ = a
} else
i.languages_ = d.prototype.options_.languages;
i.resetCache_();
var o = cr.get("h5vodlocaldata");
if (void 0 !== o && void 0 !== o.lastVolume && i.volume(Number(o.lastVolume)),
i.poster_ = t.poster || "",
void 0 !== i.options_.controlBar.playbackQualityLabels && 5 <= i.options_.controlBar.playbackQualityLabels.length && i.options_.controlBar.playbackQualityLabels.length <= 10)
for (var l = 0; l < i.options_.controlBar.playbackQualityLabels.length; l++)
Na[l] = i.options_.controlBar.playbackQualityLabels[l];
i.options_.playbackQualities = ["EMP"],
i.options_.playbackQualityIndex = [],
i.controls_ = !!t.controls,
i.mini_ = !!t.mini,
void 0 !== t.isHttps ? !0 === t.isHttps ? i.httpPre_ = "https://" : i.httpPre_ = "http://" : i.httpPre_ = "https://",
e.controls = !1,
e.removeAttribute("controls"),
i.changingSrc_ = !1,
i.playCallbacks_ = [],
i.playTerminatedQueue_ = [],
e.hasAttribute("autoplay") ? i.autoplay(!0) : i.autoplay(i.options_.autoplay),
t.plugins && Object.keys(t.plugins).forEach(function(e) {
if ("function" != typeof i[e])
throw new Error('plugin "' + e + '" does not exist')
}),
i.scrubbing_ = !1,
i.el_ = i.createEl(),
Oe(Ve(i), {
eventBusKey: "el_"
}),
i.fsApi_.requestFullscreen && (ge(f, i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_),
i.on(i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_)),
i.fluid_ && i.on("playerreset", i.updateStyleEl_);
var u = Fe(i.options_);
t.plugins && Object.keys(t.plugins).forEach(function(e) {
i[e](t.plugins[e])
}),
i.options_.playerOptions = u,
i.middleware_ = [],
i.initChildren(),
i.player().options().qualityPermitMode ? i.getChild("controlBar").removeChild("PlaybackQualityMenuButton3") : i.getChild("controlBar").removeChild("PlaybackQualityMenuButton"),
i.isAudio("audio" === e.nodeName.toLowerCase()),
i.controls() ? i.addClass("vjs-controls-enabled") : i.addClass("vjs-controls-disabled"),
i.el_.setAttribute("role", "region"),
i.isAudio() ? i.el_.setAttribute("aria-label", i.localize("Audio Player")) : i.el_.setAttribute("aria-label", i.localize("Video Player")),
i.isAudio() && i.addClass("vjs-audio"),
i.flexNotSupported_() && i.addClass("vjs-no-flex"),
lt && i.addClass("vjs-touch-enabled"),
ht || i.addClass("vjs-workinghover"),
d.players[i.id_] = Ve(i);
var c = y.split(".")[0];
return i.version = y,
i.playerversion = v + (i.player().options_.drmLabel ? "d" : ""),
1 !== i.options_.logicIndex || i.options_.enableVip || (i.playerversion += " 4k"),
i.updatedate = g,
i.addClass("vjs-v" + c),
i.userActive(!0),
i.reportUserActivity(),
i.one("play", i.listenForUserActivity_),
i.on("stageclick", i.handleStageClick_),
i.on("keydown", i.handleKeyDown),
i.breakpoints(i.options_.breakpoints),
i.responsive(i.options_.responsive),
i
}
We(d, h);
var e = d.prototype;
return e.GET_DEFAULT_QUALITY_LABELS = function() {
return Na
}
,
e.GET_CUSTOM_QUALITY_LABELS = function() {
return Ba
}
,
e.GET_CUSTOM_QUALITIES_DIVIDE = function() {
return Da
}
,
e.dispose = function() {
this.player_.paused()
var i = this;
this.trigger("dispose"),
this.off("dispose"),
ye(f, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_),
ye(f, "keydown", this.boundFullWindowOnEscKey_),
this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_),
this.styleEl_ = null),
d.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),
function(e) {
vi[e.id()] = null
}(this),
Dn.names.forEach(function(e) {
var t = Dn[e]
, n = i[t.getterName]();
n && n.off && n.off()
}),
h.prototype.dispose.call(this)
}
,
e.createEl = function() {
var t, n = this.tag, e = this.playerElIngest_ = n.parentNode && n.parentNode.hasAttribute && n.parentNode.hasAttribute("data-vjs-player"), i = "video-js" === this.tag.tagName.toLowerCase();
e ? t = this.el_ = n.parentNode : i || (t = this.el_ = h.prototype.createEl.call(this, "div"));
var r = O(n);
if (i) {
for (t = this.el_ = n,
n = this.tag = f.createElement("video"); t.children.length; )
n.appendChild(t.firstChild);
P(t, "video-js") || L(t, "video-js"),
t.appendChild(n),
e = this.playerElIngest_ = t,
Object.keys(t).forEach(function(e) {
try {
n[e] = t[e]
} catch (e) {}
})
}
if (n.setAttribute("tabindex", "-1"),
r.tabindex = "-1",
(st || it && ot) && (n.setAttribute("role", "application"),
r.role = "application"),
n.removeAttribute("width"),
n.removeAttribute("height"),
"width"in r && delete r.width,
"height"in r && delete r.height,
Object.getOwnPropertyNames(r).forEach(function(e) {
i && "class" === e || t.setAttribute(e, r[e]),
i && n.setAttribute(e, r[e])
}),
n.playerId = n.id,
n.id += "_html5_api",
n.className = "vjs-tech",
n.player = t.player = this,
this.addClass("vjs-paused"),
!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
this.styleEl_ = re("vjs-styles-dimensions");
var s = $(".vjs-styles-defaults")
, a = $("head");
a.insertBefore(this.styleEl_, s ? s.nextSibling : a.firstChild)
}
this.fill_ = !1,
this.fluid_ = !1,
this.width(this.options_.width),
this.height(this.options_.height),
this.fill(this.options_.fill),
this.fluid(this.options_.fluid),
this.aspectRatio(this.options_.aspectRatio),
this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
for (var o = n.getElementsByTagName("a"), l = 0; l < o.length; l++) {
var u = o.item(l);
L(u, "vjs-hidden"),
u.setAttribute("hidden", "hidden")
}
n.initNetworkState_ = n.networkState,
n.parentNode && !e && n.parentNode.insertBefore(t, n),
A(n, t),
this.children_.unshift(n);
var c = this;
return n.oncontextmenu = function(e) {
return !0 === e.ctrlKey && e.altKey ? c.showContextMenu(e, !0) : c.showContextMenu(e, !1),
!1
}
,
this.el_.setAttribute("lang", this.language_),
this.el_ = t
}
,
e.crossOrigin = function(e) {
if (!e)
return this.techGet_("crossOrigin");
"anonymous" === e || "use-credentials" === e ? this.techCall_("setCrossOrigin", e) : m.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + e + '"')
}
,
e.showContextMenu = function(e, t) {
this.getChild("contextMenuButton").moveAndShow(e, t)
}
,
e.getDebugInfo = function() {
var e = "";
e += "WH DEBUG:";
var t, n = JSON.parse('{"DEBUG_INFO":"aaa1"}');
for (t in this.options_)
"playerOptions" !== t && (n[t] = this.options_[t]);
return delete n.controlBar.playerOptions,
n.tech = this.tech_.debugInfo,
e += JSON.stringify(n)
}
,
e.width = function(e) {
return this.dimension("width", e)
}
,
e.height = function(e) {
return this.dimension("height", e)
}
,
e.dimension = function(e, t) {
var n = e + "_";
if (void 0 === t)
return this[n] || 0;
if ("" === t || "auto" === t)
return this[n] = void 0,
void this.updateStyleEl_();
var i = parseFloat(t);
isNaN(i) ? m.error('Improper value "' + t + '" supplied for for ' + e) : (this[n] = i,
this.updateStyleEl_())
}
,
e.fluid = function(e) {
if (void 0 === e)
return !!this.fluid_;
this.fluid_ = !!e,
Me(this) && this.off("playerreset", this.updateStyleEl_),
e ? (this.addClass("vjs-fluid"),
this.fill(!1),
function(e, t) {
Me(e) ? t() : (e.eventedCallbacks || (e.eventedCallbacks = []),
e.eventedCallbacks.push(t))
}(function() {
this.on("playerreset", this.updateStyleEl_)
})) : this.removeClass("vjs-fluid"),
this.updateStyleEl_()
}
,
e.fill = function(e) {
if (void 0 === e)
return !!this.fill_;
this.fill_ = !!e,
e ? (this.addClass("vjs-fill"),
this.fluid(!1)) : this.removeClass("vjs-fill")
}
,
e.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_()
}
,
e.updateStyleEl_ = function() {
if (!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
var e, t, n, i = (void 0 !== this.aspectRatio_ && "auto" !== this.aspectRatio_ ? this.aspectRatio_ : 0 < this.videoWidth() ? this.videoWidth() + ":" + this.videoHeight() : "16:9").split(":"), r = i[1] / i[0];
e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / r : this.videoWidth() || 300,
t = void 0 !== this.height_ ? this.height_ : e * r,
n = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions",
this.addClass(n),
se(this.styleEl_, "\n ." + n + " {\n width: " + e + "px;\n height: " + t + "px;\n }\n\n ." + n + ".vjs-fluid {\n padding-top: " + 100 * r + "%;\n }\n ")
} else {
var s = "number" == typeof this.width_ ? this.width_ : this.options_.width
, a = "number" == typeof this.height_ ? this.height_ : this.options_.height
, o = this.tech_ && this.tech_.el();
o && (0 <= s && (o.width = s),
0 <= a && (o.height = a))
}
}
,
e.loadTech_ = function(e, t) {
var n = this;
this.tech_ && this.unloadTech_();
var i = Re(e)
, r = e.charAt(0).toLowerCase() + e.slice(1);
"Html5" !== i && this.tag && (pi.getTech("Html5").disposeMediaElement(this.tag),
this.tag.player = null,
this.tag = null),
this.techName_ = i,
this.isReady_ = !1;
var s = {
source: t,
autoplay: "string" != typeof this.autoplay() && this.autoplay(),
nativeControlsForTouch: this.options_.nativeControlsForTouch,
playerId: this.id(),
techId: this.id() + "_" + r + "_api",
playsinline: this.options_.playsinline,
preload: this.options_.preload,
loop: this.options_.loop,
autoNext: this.options_.autoNext,
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,
Promise: this.options_.Promise
};
Dn.names.forEach(function(e) {
var t = Dn[e];
s[t.getterName] = n[t.privateName]
}),
b(s, this.options_[i]),
b(s, this.options_[r]),
b(s, this.options_[e.toLowerCase()]),
this.tag && (s.tag = this.tag),
t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (s.startTime = this.cache_.currentTime);
var a = pi.getTech(e);
if (!a)
throw new Error("No Tech named '" + i + "' exists! '" + i + "' should be registered using videojs.registerTech()'");
this.tech_ = new a(s),
this.tech_.ready(Te(this, this.handleTechReady_), !0),
It(this.textTracksJson_ || [], this.tech_),
Pa.forEach(function(e) {
n.on(n.tech_, e, n["handleTech" + Re(e) + "_"])
}),
Object.keys(La).forEach(function(t) {
n.on(n.tech_, t, function(e) {
0 === n.tech_.playbackRate() && n.tech_.seeking() ? n.queuedCallbacks_.push({
callback: n["handleTech" + La[t] + "_"].bind(n),
event: e
}) : n["handleTech" + La[t] + "_"](e)
})
}),
this.on("loadedmetadata", this.initPlaybackQualityLevelDirect),
this.on("adended", this.handleADSEnded_),
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_, "fullscreenerror", this.handleTechFullscreenError_),
this.on(this.tech_, "enterpictureinpicture", this.handleTechEnterPictureInPicture_),
this.on(this.tech_, "leavepictureinpicture", this.handleTechLeavePictureInPicture_),
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.on(this.tech_, "qualitychange", this.handleTechQualityChange_),
this.usingNativeControls(this.techGet_("controls")),
this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(),
this.tech_.el().parentNode === this.el() || "Html5" === i && this.tag || A(this.tech_.el(), this.el()),
this.autoNext(this.options_.setup_autoNext),
this.loop2(this.options_.setup_loop),
this.tag && (this.tag.player = null,
this.tag = null)
}
,
e.unloadTech_ = function() {
var n = this;
Dn.names.forEach(function(e) {
var t = Dn[e];
n[t.privateName] = n[t.getterName]()
}),
this.textTracksJson_ = Lt(this.tech_),
this.isReady_ = !1,
this.tech_.dispose(),
this.tech_ = !1,
this.isPosterFromTech_ && (this.poster_ = "",
this.trigger("posterchange")),
this.isPosterFromTech_ = !1
}
,
e.tech = function(e) {
return void 0 === e && m.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),
this.tech_
}
,
e.addTechControlsListeners_ = function() {
this.removeTechControlsListeners_(),
this.on(this.tech_, "mouseup", this.handleTechClick_),
this.on(this.tech_, "dblclick", this.handleTechDoubleClick_),
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_)
}
,
e.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_, "mouseup", this.handleTechClick_),
this.off(this.tech_, "dblclick", this.handleTechDoubleClick_)
}
,
e.handleTechReady_ = function() {
this.triggerReady(),
this.cache_.volume && this.techCall_("setVolume", this.cache_.volume),
this.handleTechPosterChange_(),
this.handleTechDurationChange_()
}
,
e.handleTechLoadStart_ = function() {
this.removeClass("vjs-ended"),
this.removeClass("vjs-seeking"),
this.error(null),
this.handleTechDurationChange_(),
this.paused() ? (this.hasStarted(!1),
this.trigger("loadstart")) : (this.trigger("loadstart"),
this.trigger("firstplay")),
this.manualAutoplay_(this.autoplay())
}
,
e.manualAutoplay_ = function(t) {
var i = this;
if (this.tech_ && "string" == typeof t) {
var e, n = function() {
var e = i.muted();
i.muted(!0);
function t() {
i.muted(e)
}
i.playTerminatedQueue_.push(t);
var n = i.play();
if (xt(n))
return n.catch(t)
};
if ("any" === t && !0 !== this.muted() ? xt(e = this.play()) && (e = e.catch(n)) : e = "muted" === t && !0 !== this.muted() ? n() : this.play(),
xt(e))
return e.then(function() {
i.trigger({
type: "autoplay-success",
autoplay: t
})
}).catch(function(e) {
i.trigger({
type: "autoplay-failure",
autoplay: t
})
})
}
}
,
e.updateSourceCaches_ = function(e) {
void 0 === e && (e = "");
var t = e
, n = "";
"string" != typeof t && (t = e.src,
n = e.type),
this.cache_.source = this.cache_.source || {},
this.cache_.sources = this.cache_.sources || [],
t && !n && (n = function(e, t) {
if (!t)
return "";
if (e.cache_.source.src === t && e.cache_.source.type)
return e.cache_.source.type;
var n = e.cache_.sources.filter(function(e) {
return e.src === t
});
if (n.length)
return n[0].type;
for (var i = e.$$("source"), r = 0; r < i.length; r++) {
var s = i[r];
if (s.type && s.src && s.src === t)
return s.type
}
return Ei(t)
}(this, t)),
this.cache_.source = Fe({}, e, {
src: t,
type: n
});
for (var i = this.cache_.sources.filter(function(e) {
return e.src && e.src === t
}), r = [], s = this.$$("source"), a = [], o = 0; o < s.length; o++) {
var l = O(s[o]);
r.push(l),
l.src && l.src === t && a.push(l.src)
}
a.length && !i.length ? this.cache_.sources = r : i.length || (this.cache_.sources = [this.cache_.source]),
this.cache_.src = t
}
,
e.handleTechSourceset_ = function(e) {
var n = this;
if (!this.changingSrc_) {
var t = function(e) {
return n.updateSourceCaches_(e)
}
, i = this.currentSource().src
, r = e.src;
i && !/^blob:/.test(i) && /^blob:/.test(r) && (this.lastSource_ && (this.lastSource_.tech === r || this.lastSource_.player === i) || (t = function() {}
)),
t(r),
e.src || this.tech_.any(["sourceset", "loadstart"], function(e) {
if ("sourceset" !== e.type) {
var t = n.techGet("currentSrc");
n.lastSource_.tech = t,
n.updateSourceCaches_(t)
}
})
}
this.lastSource_ = {
player: this.currentSource().src,
tech: e.src
},
this.trigger({
src: e.src,
type: "sourceset"
})
}
,
e.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"))
}
,
e.handleTechPlay_ = function() {
this.removeClass("vjs-ended"),
this.removeClass("vjs-paused"),
this.addClass("vjs-playing"),
this.hasStarted(!0),
this.trigger("play")
}
,
e.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")
}
,
e.handleTechQualityChange_ = function() {
this.cache_.lastPlaybackQuality = this.tech_.playbackQuality(),
this.trigger("qualitychange")
}
,
e.handleTechWaiting_ = function() {
var t = this;
this.addClass("vjs-waiting"),
this.trigger("waiting");
var n = this.currentTime();
this.on("timeupdate", function e() {
n !== t.currentTime() && (t.removeClass("vjs-waiting"),
t.off("timeupdate", e))
})
}
,
e.handleTechCanPlay_ = function() {
this.removeClass("vjs-waiting"),
this.trigger("canplay")
}
,
e.handleTechCanPlayThrough_ = function() {
this.removeClass("vjs-waiting"),
this.trigger("canplaythrough")
}
,
e.handleTechPlaying_ = function() {
this.removeClass("vjs-waiting"),
this.trigger("playing")
}
,
e.handleTechSeeking_ = function() {
this.addClass("vjs-seeking"),
this.trigger("seeking")
}
,
e.handleTechSeeked_ = function() {
this.removeClass("vjs-seeking"),
this.removeClass("vjs-ended"),
this.trigger("seeked")
}
,
e.handleTechFirstPlay_ = function() {
this.options_.starttime && (m.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")
}
,
e.handleTechPause_ = function() {
this.removeClass("vjs-playing"),
this.addClass("vjs-paused"),
this.trigger("pause")
}
,
e.isPlaying = function() {
return this.hasClass("vjs-playing")
}
,
e.handleTechEnded_ = function() {
this.addClass("vjs-ended"),
this.trigger("ended")
}
,
e.handleTechDurationChange_ = function() {
this.duration(this.techGet_("duration")),
void 0 !== this.mainContentDuration_ || isNaN(this.duration()) || 0 === this.duration() || (this.mainContentDuration_ = this.duration())
}
,
e.handleTechClick_ = function(e) {
X(e) ? this.controls_ && (this.mini_ || (this.paused() ? At(this.play()) : this.pause())) : e.button
}
,
e.handleTechDoubleClick_ = function(t) {
this.controls_ && (this.mini_ || Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(e) {
return e.contains(t.target)
}) || void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.doubleClick && !1 === this.options_.userActions.doubleClick || (void 0 !== this.options_ && void 0 !== this.options_.userActions && "function" == typeof this.options_.userActions.doubleClick ? this.options_.userActions.doubleClick.call(this, t) : this.isFullscreen() ? this.exitFullscreen() : this.requestFullscreen()))
}
,
e.handleTechTap_ = function() {
this.userActive(!this.userActive())
}
,
e.handleTechTouchStart_ = function() {
this.userWasActive = this.userActive()
}
,
e.handleTechTouchMove_ = function() {
this.userWasActive && this.reportUserActivity()
}
,
e.handleTechTouchEnd_ = function(e) {
e.preventDefault()
}
,
e.handleStageClick_ = function() {
this.reportUserActivity()
}
,
e.toggleFullscreenClass_ = function() {
this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen")
}
,
e.toggleWebFullscreenClass_ = function() {
this.isWebFullscreen() ? this.addClass("vjs-webfullscreen") : this.removeClass("vjs-webfullscreen")
}
,
e.documentFullscreenChange_ = function(e) {
var t = e.target.player;
if (!t || t === this) {
var n = this.el()
, i = f[this.fsApi_.fullscreenElement] === n;
!i && n.matches ? i = n.matches(":" + this.fsApi_.fullscreen) : !i && n.msMatchesSelector && (i = n.msMatchesSelector(":" + this.fsApi_.fullscreen)),
this.isFullscreen(i)
}
}
,
e.handleTechFullscreenChange_ = function(e, t) {
t && this.isFullscreen(t.isFullscreen)
}
,
e.handleTechFullscreenError_ = function(e, t) {
this.trigger("fullscreenerror", t)
}
,
e.togglePictureInPictureClass_ = function() {
this.isInPictureInPicture() ? this.addClass("vjs-picture-in-picture") : this.removeClass("vjs-picture-in-picture")
}
,
e.handleTechEnterPictureInPicture_ = function(e) {
this.isInPictureInPicture(!0)
}
,
e.handleTechLeavePictureInPicture_ = function(e) {
this.isInPictureInPicture(!1)
}
,
e.handleTechError_ = function() {
var e = this.tech_.error();
this.error(e)
}
,
e.handleTechTextData_ = function(e, t) {
var n = null;
1 < arguments.length && (n = t),
this.trigger("textdata", n)
}
,
e.getCache = function() {
return this.cache_
}
,
e.resetCache_ = function() {
this.cache_ = {
currentTime: 0,
initTime: 0,
inactivityTimeout: this.options_.inactivityTimeout,
duration: NaN,
lastVolume: 1,
lastPlaybackRate: this.defaultPlaybackRate(),
lastPlaybackQuality: this.defaultPlaybackQuality(),
media: null,
src: "",
source: {},
sources: [],
volume: 1
}
}
,
e.techCall_ = function(e, t) {
this.ready(function() {
if (e in bi)
return function(e, t, n, i) {
return t[n](e.reduce(Ci(n), i))
}(this.middleware_, this.tech_, e, t);
if (e in Ti)
return mi(this.middleware_, this.tech_, e, t);
try {
this.tech_ && this.tech_[e](t)
} catch (e) {
throw m(e),
e
}
}, !0)
}
,
e.techGet_ = function(t) {
if (this.tech_ && this.tech_.isReady_) {
if (t in _i)
return function(e, t, n) {
return e.reduceRight(Ci(n), t[n]())
}(this.middleware_, this.tech_, t);
if (t in Ti)
return mi(this.middleware_, this.tech_, t);
try {
return this.tech_[t]()
} catch (e) {
if (void 0 === this.tech_[t])
throw m("Video.js: " + t + " method not defined for " + this.techName_ + " playback technology.", e),
e;
if ("TypeError" === e.name)
throw m("Video.js: " + t + " unavailable on " + this.techName_ + " playback technology element.", e),
this.tech_.isReady_ = !1,
e;
throw m(e),
e
}
}
}
,
e.play = function() {
var t = this
, e = this.options_.Promise || p.Promise;
return e ? new e(function(e) {
t.play_(e)
}
) : this.play_()
}
,
e.play_ = function(e) {
var t = this;
void 0 === e && (e = At),
this.playCallbacks_.push(e);
var n = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
if (this.waitToPlay_ && (this.off(["ready", "loadstart"], this.waitToPlay_),
this.waitToPlay_ = null),
!this.isReady_ || !n)
return this.waitToPlay_ = function(e) {
t.play_()
}
,
this.one(["ready", "loadstart"], this.waitToPlay_),
void (n || !dt && !ht || this.load());
var i = this.techGet_("play");
null === i ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(i)
}
,
e.runPlayTerminatedQueue_ = function() {
var e = this.playTerminatedQueue_.slice(0);
this.playTerminatedQueue_ = [],
e.forEach(function(e) {
e()
})
}
,
e.runPlayCallbacks_ = function(t) {
var e = this.playCallbacks_.slice(0);
this.playCallbacks_ = [],
this.playTerminatedQueue_ = [],
e.forEach(function(e) {
e(t)
})
}
,
e.pause = function() {
this.techCall_("pause")
}
,
e.paused = function() {
return !1 !== this.techGet_("paused")
}
,
e.played = function() {
return this.techGet_("played") || gt(0, 0)
}
,
e.scrubbing = function(e) {
if ("undefined" == typeof e)
return this.scrubbing_;
this.scrubbing_ = !!e,
e ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing")
}
,
e.currentTime = function(e) {
return "undefined" != typeof e ? (e < 0 && (e = 0),
this.isReady_ && !this.changingSrc_ && this.tech_ && this.tech_.isReady_ ? (this.techCall_("setCurrentTime", e),
void (this.cache_.initTime = 0)) : (this.cache_.initTime = e,
this.off("canplay", this.applyInitTime_),
void this.one("canplay", this.applyInitTime_))) : (this.cache_.currentTime = this.techGet_("currentTime") || 0,
this.cache_.currentTime)
}
,
e.applyInitTime_ = function() {
this.currentTime(this.cache_.initTime)
}
,
e.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"),
isNaN(e) || this.trigger("durationchange"))
}
,
e.remainingTime = function() {
return this.duration() - this.currentTime()
}
,
e.remainingTimeDisplay = function() {
return Math.floor(this.duration()) - Math.floor(this.currentTime())
}
,
e.buffered = function() {
var e = this.techGet_("buffered");
return e && e.length || (e = gt(0, 0)),
e
}
,
e.bufferedPercent = function() {
return yt(this.buffered(), this.duration())
}
,
e.bufferedEnd = function() {
var e = this.buffered()
, t = this.duration()
, n = e.end(e.length - 1);
return t < n && (n = t),
n
}
,
e.volume = function(e) {
var t;
if (void 0 === e)
return t = parseFloat(this.techGet_("volume")),
isNaN(t) ? 1 : t;
if (t = Math.max(0, Math.min(1, parseFloat(e))),
this.cache_.volume = t,
this.techCall_("setVolume", t),
0 < t) {
this.lastVolume_(t);
var n = cr.get("h5vodlocaldata");
void 0 !== n ? cr.set("h5vodlocaldata", {
lastQuality: n.lastQuality,
lastVolume: this.lastVolume_()
}) : cr.set("h5vodlocaldata", {
lastQuality: null,
lastVolume: this.lastVolume_()
})
}
}
,
e.muted = function(e) {
if (void 0 === e)
return this.techGet_("muted") || !1;
this.techCall_("setMuted", e)
}
,
e.defaultMuted = function(e) {
return void 0 !== e ? this.techCall_("setDefaultMuted", e) : this.techGet_("defaultMuted") || !1
}
,
e.lastVolume_ = function(e) {
if (void 0 === e || 0 === e)
return this.cache_.lastVolume;
this.cache_.lastVolume = e
}
,
e.supportsFullScreen = function() {
return this.techGet_("supportsFullScreen") || !1
}
,
e.supportsWebFullScreen = function() {
return !0
}
,
e.isFullscreen = function(e) {
if (void 0 === e)
return this.isFullscreen_;
var t = this.isFullscreen_;
return this.isFullscreen_ = Boolean(e),
this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger("fullscreenchange"),
void this.toggleFullscreenClass_()
}
,
e.isWebFullscreen = function(e) {
if (void 0 === e)
return this.isWebFullscreen_;
var t = this.isWebFullscreen_;
return this.isWebFullscreen_ = Boolean(e),
this.isWebFullscreen_ !== t && this.trigger("webfullscreenchange"),
void this.toggleWebFullscreenClass_()
}
,
e.requestFullscreen = function(a) {
var e = this.options_.Promise || p.Promise;
if (e) {
var o = this;
return new e(function(e, n) {
function i() {
o.off(o.fsApi_.fullscreenerror, r),
o.off(o.fsApi_.fullscreenchange, t)
}
function t() {
i(),
e()
}
function r(e, t) {
i(),
n(t)
}
o.one("fullscreenchange", t),
o.one("fullscreenerror", r);
var s = o.requestFullscreenHelper_(a);
if (s)
return s.then(i, i),
s
}
)
}
return this.requestFullscreenHelper_()
}
,
e.requestFullscreenHelper_ = function(e) {
var t, n = this;
if (this.fsApi_.prefixed || (t = this.options_.fullscreen && this.options_.fullscreen.options || {},
void 0 !== e && (t = e)),
this.isWebFullscreen() && this.exitFullWindow(),
this.fsApi_.requestFullscreen) {
var i = this.el_[this.fsApi_.requestFullscreen](t);
return i && i.then(function() {
return n.isFullscreen(!0)
}, function() {
return n.isFullscreen(!1)
}),
i
}
this.tech_.supportsFullScreen() ? this.techCall_("enterFullScreen") : this.enterFullWindow()
}
,
e.requestFullWindow = function(e) {}
,
e.exitFullscreen = function() {
var e = this.options_.Promise || p.Promise;
if (e) {
var a = this;
return new e(function(e, n) {
function i() {
a.off(a.fsApi_.fullscreenerror, r),
a.off(a.fsApi_.fullscreenchange, t)
}
function t() {
i(),
e()
}
function r(e, t) {
i(),
n(t)
}
a.one("fullscreenchange", t),
a.one("fullscreenerror", r);
var s = a.exitFullscreenHelper_();
if (s)
return s.then(i, i),
s
}
)
}
return this.exitFullscreenHelper_()
}
,
e.exitFullscreenHelper_ = function() {
var e = this;
if (this.fsApi_.requestFullscreen) {
var t = f[this.fsApi_.exitFullscreen]();
return t && t.then(function() {
return e.isFullscreen(!1)
}),
t
}
this.tech_.supportsFullScreen() ? this.techCall_("exitFullScreen") : this.exitFullWindow()
}
,
e.enterFullWindow = function() {
this.isFullscreen() && this.exitFullscreen(),
this.isWebFullscreen(!0),
this.isFullWindow = !0,
this.docOrigOverflow = f.documentElement.style.overflow,
ge(f, "keydown", this.boundFullWindowOnEscKey_),
f.documentElement.style.overflow = "hidden",
L(f.body, "vjs-webfull-window"),
this.trigger("enterFullWindow")
}
,
e.fullWindowOnEscKey = function(e) {
Mt.isEventKey(e, "Esc") && (!0 === this.isFullscreen() ? this.exitFullscreen() : this.exitFullWindow(),
!0 === this.isWebFullscreen() && this.exitFullWindow())
}
,
e.exitFullWindow = function() {
this.isWebFullscreen(!1),
this.isFullWindow = !1,
ye(f, "keydown", this.boundFullWindowOnEscKey_),
f.documentElement.style.overflow = this.docOrigOverflow,
I(f.body, "vjs-webfull-window"),
this.trigger("exitFullWindow")
}
,
e.isInPictureInPicture = function(e) {
return void 0 !== e ? (this.isInPictureInPicture_ = !!e,
void this.togglePictureInPictureClass_()) : !!this.isInPictureInPicture_
}
,
e.requestPictureInPicture = function() {
if ("pictureInPictureEnabled"in f)
return this.techGet_("requestPictureInPicture")
}
,
e.exitPictureInPicture = function() {
if ("pictureInPictureEnabled"in f)
return f.exitPictureInPicture()
}
,
e.showBarrage = function(e) {
var t = this.getChild("BarrageLayer");
t && t.showBarrage(e)
}
,
e.barrageToggle = function(e) {
var t = this.getChild("BarrageLayer");
if (t)
return !0 === e ? t.show() : !1 === e && t.hide(),
!t.hasClass("vjs-hidden")
}
,
e.handleKeyDown = function(e) {
var t = this.options_.userActions;
if (t && t.hotkeys) {
!function(e) {
var t = e.tagName.toLowerCase();
if (e.isContentEditable)
return !0;
if ("input" === t)
return -1 === ["button", "checkbox", "hidden", "radio", "reset", "submit"].indexOf(e.type);
return -1 !== ["textarea"].indexOf(t)
}(this.el_.ownerDocument.activeElement) && ("function" == typeof t.hotkeys ? t.hotkeys.call(this, e) : this.handleHotkeys(e))
}
}
,
e.handleHotkeys = function(e) {
var t = this.options_.userActions ? this.options_.userActions.hotkeys : {}
, n = t.stepForward
, i = void 0 === n ? function(e) {
return Mt.isEventKey(e, "right")
}
: n
, r = t.stepBack
, s = void 0 === r ? function(e) {
return Mt.isEventKey(e, "left")
}
: r
, a = t.fullscreenKey
, o = void 0 === a ? function(e) {
return Mt.isEventKey(e, "f")
}
: a
, l = t.muteKey
, u = void 0 === l ? function(e) {
return Mt.isEventKey(e, "m")
}
: l
, c = t.playPauseKey
, h = void 0 === c ? function(e) {
return Mt.isEventKey(e, "k") || Mt.isEventKey(e, "Space")
}
: c;
if (o.call(this, e)) {
e.preventDefault(),
e.stopPropagation();
var d = He.getComponent("FullscreenToggle");
!1 !== f[this.fsApi_.fullscreenEnabled] && d.prototype.handleClick.call(this, e)
} else if (u.call(this, e)) {
e.preventDefault(),
e.stopPropagation(),
He.getComponent("MuteToggle").prototype.handleClick.call(this, e)
} else if (h.call(this, e)) {
if (e.preventDefault(),
e.stopPropagation(),
this.ads && !1 === this.ads.isInAdMode())
He.getComponent("PlayToggle").prototype.handleClick.call(this, e)
} else
s.call(this, e) ? (e.preventDefault(),
e.stopPropagation(),
this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() - 20)) : i.call(this, e) && (e.preventDefault(),
e.stopPropagation(),
this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() + 20))
}
,
e.canPlayType = function(e) {
for (var t, n = 0, i = this.options_.techOrder; n < i.length; n++) {
var r = i[n]
, s = pi.getTech(r);
if (s = s || He.getComponent(r)) {
if (s.isSupported() && (t = s.canPlayType(e)))
return t
} else
m.error('The "' + r + '" tech is undefined. Skipped browser support check for that tech.')
}
return ""
}
,
e.selectSource = function(e) {
function t(e, n, i) {
var r;
return e.some(function(t) {
return n.some(function(e) {
if (r = i(t, e))
return !0
})
}),
r
}
function n(e, t) {
var n = e[0];
if (e[1].canPlaySource(t, r.options_[n.toLowerCase()]))
return {
source: t,
tech: n
}
}
var i, r = this, s = this.options_.techOrder.map(function(e) {
return [e, pi.getTech(e)]
}).filter(function(e) {
var t = e[0]
, n = e[1];
return n ? n.isSupported() : (m.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'),
!1)
});
return (this.options_.sourceOrder ? t(e, s, (i = n,
function(e, t) {
return i(t, e)
}
)) : t(s, e, n)) || !1
}
,
e.src = function(e) {
var n = this;
if ("undefined" == typeof e)
return this.cache_.src || "";
var i = function t(e) {
if (Array.isArray(e)) {
var n = [];
e.forEach(function(e) {
e = t(e),
Array.isArray(e) ? n = n.concat(e) : l(e) && n.push(e)
}),
e = n
} else
e = "string" == typeof e && e.trim() ? [wi({
src: e
})] : l(e) && "string" == typeof e.src && e.src && e.src.trim() ? [wi(e)] : [];
return e
}(e);
i.length ? (this.changingSrc_ = !0,
this.cache_.sources = i,
this.updateSourceCaches_(i[0]),
yi(this, i[0], function(e, t) {
if (n.middleware_ = t,
n.cache_.sources = i,
n.updateSourceCaches_(e),
n.src_(e))
return 1 < i.length ? n.src(i.slice(1)) : (n.changingSrc_ = !1,
n.setTimeout(function() {
this.error({
code: 4,
message: this.localize(this.options_.notSupportedMessage)
})
}, 0),
void n.triggerReady());
!function(e, t) {
e.forEach(function(e) {
return e.setTech && e.setTech(t)
})
}(t, n.tech_)
})) : this.setTimeout(function() {
this.error({
code: 4,
message: this.localize(this.options_.notSupportedMessage)
})
}, 0)
}
,
e.src_ = function(e) {
var t = this
, n = this.selectSource([e]);
return !n || (function(e, t) {
return Re(e) === Re(t)
}(n.tech, this.techName_) ? this.ready(function() {
this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", e) : this.techCall_("src", e.src),
this.changingSrc_ = !1
}, !0) : (this.changingSrc_ = !0,
this.loadTech_(n.tech, n.source),
this.tech_.ready(function() {
t.changingSrc_ = !1
})),
!1)
}
,
e.load = function() {
this.techCall_("load")
}
,
e.reset = function() {
var e = this
, t = this.options_.Promise || p.Promise;
this.paused() || !t ? this.doReset_() : At(this.play().then(function() {
return e.doReset_()
}))
}
,
e.doReset_ = function() {
this.tech_ && this.tech_.clearTracks("text"),
this.resetCache_(),
this.poster(""),
this.loadTech_(this.options_.techOrder[0], null),
this.techCall_("reset"),
this.resetControlBarUI_(),
Me(this) && this.trigger("playerreset")
}
,
e.resetControlBarUI_ = function() {
this.resetProgressBar_(),
this.resetPlaybackRate_(),
this.resetPlaybackQuality_(),
this.resetVolumeBar_()
}
,
e.resetProgressBar_ = function() {
this.currentTime(0);
var e = this.controlBar
, t = e.durationDisplay
, n = e.remainingTimeDisplay;
t && t.updateContent(),
n && n.updateContent()
}
,
e.resetPlaybackRate_ = function() {
this.playbackRate(this.defaultPlaybackRate()),
this.handleTechRateChange_()
}
,
e.resetPlaybackQuality_ = function() {
this.playbackQuality(this.defaultPlaybackQuality()),
this.handleTechQualityChange_()
}
,
e.resetVolumeBar_ = function() {
this.volume(1),
this.trigger("volumechange")
}
,
e.currentSources = function() {
var e = this.currentSource()
, t = [];
return 0 !== Object.keys(e).length && t.push(e),
this.cache_.sources || t
}
,
e.currentSource = function() {
return this.cache_.source || {}
}
,
e.currentSrc = function() {
return this.currentSource() && this.currentSource().src || ""
}
,
e.currentType = function() {
return this.currentSource() && this.currentSource().type || ""
}
,
e.preload = function(e) {
return void 0 !== e ? (this.techCall_("setPreload", e),
void (this.options_.preload = e)) : this.techGet_("preload")
}
,
e.autoplay = function(e) {
if (void 0 === e)
return this.options_.autoplay || !1;
var t;
"string" == typeof e && /(any|play|muted)/.test(e) ? (this.options_.autoplay = e,
this.manualAutoplay_(e),
t = !1) : this.options_.autoplay = !!e,
t = "undefined" == typeof t ? this.options_.autoplay : t,
this.tech_ && this.techCall_("setAutoplay", t)
}
,
e.playsinline = function(e) {
return void 0 !== e ? (this.techCall_("setPlaysinline", e),
this.options_.playsinline = e,
this) : this.techGet_("playsinline")
}
,
e.loop = function(e) {
return void 0 !== e && (this.techCall_("setLoop", e),
this.options_.loop !== e && (this.options_.loop = e,
this.trigger("loopchange"))),
this.techGet_("loop")
}
,
e.loop2 = function(e) {
return void 0 !== e && this.options_.loop2 !== e && (this.options_.loop2 = e,
this.trigger("loop2change")),
this.options_.loop2
}
,
e.autoNext = function(e) {
return void 0 !== e && this.options_.autoNext !== e && (this.options_.autoNext = e,
this.trigger("autonextchange")),
this.options_.autoNext
}
,
e.poster = function(e) {
if (void 0 === e)
return this.poster_;
(e = e || "") !== this.poster_ && (this.poster_ = e,
this.techCall_("setPoster", e),
this.isPosterFromTech_ = !1,
this.trigger("posterchange"))
}
,
e.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"))
}
}
,
e.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_()))
}
,
e.miniPlayer = function(e) {
if (void 0 === e)
return !!this.mini_;
e = !!e,
this.mini_ !== e && (this.mini_ = e,
this.mini_ ? (this.addClass("mini-controls"),
this.controls(!1)) : (this.removeClass("mini-controls"),
this.controls(!0)))
}
,
e.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")))
}
,
e.error = function(e) {
if (void 0 === e)
return this.error_ || null;
if (this.options_.suppressNotSupportedError && e && 4 === e.code) {
var t = function() {
this.error(e)
};
return this.options_.suppressNotSupportedError = !1,
this.any(["click", "touchstart"], t),
void this.one("loadstart", function() {
this.off(["click", "touchstart"], t)
})
}
if (null === e)
return this.error_ = e,
this.removeClass("vjs-error"),
void (this.errorDisplay && this.errorDisplay.close());
this.error_ = new Et(e),
this.addClass("vjs-error"),
m.error("(CODE:" + this.error_.code + " " + Et.errorTypes[this.error_.code] + ")", this.error_.message, this.error_),
this.trigger("error", this.error_)
}
,
e.reportUserActivity = function(e) {
this.userActivity_ = !0
}
,
e.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")
}
}
,
e.listenForUserActivity_ = function() {
function e(e) {
r(),
this.clearInterval(t)
}
var t, n, i, r = Te(this, this.reportUserActivity);
this.on("mousedown", function() {
r(),
this.clearInterval(t),
t = this.setInterval(r, 250)
}),
this.on("mousemove", function(e) {
e.screenX === n && e.screenY === i || (n = e.screenX,
i = e.screenY,
r())
}),
this.on("mouseup", e),
this.on("mouseleave", e);
var s, a = this.getChild("controlBar");
!a || ht || Je || (a.on("mouseenter", function(e) {
this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout,
this.player().options_.inactivityTimeout = 0
}),
a.on("mouseleave", function(e) {
this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout
}),
G(a.el())),
this.on("keydown", r),
this.on("keyup", r),
this.setInterval(function() {
if (this.userActivity_) {
this.userActivity_ = !1,
this.userActive(!0),
this.clearTimeout(s);
var e = this.options_.inactivityTimeout;
e <= 0 || (s = this.setTimeout(function() {
this.userActivity_ || this.userActive(!1)
}, e))
}
}, 250)
}
,
e.playbackRate = function(e) {
if (void 0 === e)
return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1;
this.techCall_("setPlaybackRate", e)
}
,
e.playbackQuality = function(e) {
if (void 0 === e)
return this.tech_ && this.tech_.featuresPlaybackQuality ? this.cache_.lastPlaybackQuality || this.techGet_("playbackQuality") : 1;
this.techCall_("setPlaybackQuality", e)
}
,
e.clearPlaybackQualityLevel = function() {
this.options_.playbackQualities.length = 0,
this.options_.playbackQualityIndex.length = 0
}
,
e.addPlaybackQualityLevel = function(e, t) {
var n;
"EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
1 === this.player_.options_.logicIndex ? (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
n = Na[3]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
n = Na[7]) : e.enabled = !1,
void 0 !== n ? (this.options_.playbackQualities.push(n),
this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
this.error(null))) : 0 === this.player_.options_.logicIndex && (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
n = Na[3]) : e.bitrate <= Oa[5] ? (e.enabled = !0,
n = Na[4]) : e.bitrate <= Oa[6] ? (e.enabled = !0,
n = Na[5]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
n = Na[7]) : e.enabled = !1,
void 0 !== n ? (this.options_.playbackQualities.push(n),
this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
this.error(null)))
}
,
e.initPlaybackQualityLevelDirect = function() {
if (this.options().debug && this.log("[player] initPlaybackQualityLevelDirect() "),
!!this.options_.qualityPermitMode) {
"EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
this.options().debug && this.log(this.options_.playbackQualities),
this.clearPlaybackQualityLevel();
for (var e = this.options_.customQualityList, t = this.options_.customDefaultQuality, n = 0; n < e.length; n++)
this.options_.playbackQualities.push(e[n].label),
this.options_.playbackQualityIndex.push(e[n].masterIndex),
e[n].label === t && e[n].enabled ? this.qualityLevels()[n].enabled = !0 : this.qualityLevels()[n].enabled = !1;
var i = this.options_.playbackQualities
, r = this.options_.playbackQualityIndex[i.lastIndexOf(t)];
this.options().debug && this.log("qualityLevels().selectedIndex:" + this.qualityLevels().selectedIndex),
this.trigger("qualitychange"),
this.trigger({
level: this.player_.qualityLevels()[r],
type: "changeHLSP2P"
}),
this.mainContentQuality_ = t
}
}
,
e.getMainContentQuality = function() {
return this.mainContentQuality_
}
,
e.getMainContentQuality = function() {
return this.mainContentQuality_
}
,
e.durationChange_ = function() {
this.log("durationChange_"),
this.log(this.ads.isInAdMode())
}
,
e.handleADSEnded_ = function() {
this.log("handleADSEnded_"),
this.log(this.ads.isInAdMode())
}
,
e.switchQuality = function(e, t) {
this.options().debug && this.log("[player]switchQuality()" + this.getCurentQuality() + " switchQuality to:" + e);
var n = this.options_.playbackQualities
, i = this.options_.playbackQualityIndex[n.indexOf(e)]
, r = this.player_.qualityLevels().length;
this.options().debug && this.log("[player] switchQuality to index:" + i);
for (var s = 0; s < r; s++)
i === s ? (this.player_.qualityLevels()[s].enabled = !0,
this.options().debug && this.log("[player] switchQuality() currentIndexInlevels i:" + s),
this.trigger({
level: this.player_.qualityLevels()[s],
type: "changeHLSP2P"
})) : this.player_.qualityLevels()[s].enabled = !1,
this.options().debug && this.log("[player]switchQuality() i:" + s + ":" + this.player_.qualityLevels()[s].enabled);
if (this.options().debug && this.log("enableQualityLock:" + this.options().enableQualityLock),
this.options().enableQualityLock || "undefined" == typeof this.options().enableQualityLock) {
if (!0 === t)
return;
this.options().debug && this.log("[player] hls-select-index-change :" + Na.indexOf(e)),
this.trigger({
type: "hls-select-index-change",
data: Na.indexOf(e)
})
}
this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
lastQuality: e,
lastVolume: this.volume()
})
}
,
e.switchQualityDirect = function(e) {
this.options().debug && this.log("[player]switchQualityDirect()" + this.getCurentQualityLabel() + " switchQuality to:" + e);
var t = this.options_.playbackQualities
, n = this.options_.playbackQualityIndex[t.lastIndexOf(e)];
this.options().debug && this.log("[player] switchQualityDirect() to lastLevelIndex:" + this.qualityLevels().selectedIndex + "to false"),
this.qualityLevels()[this.qualityLevels().selectedIndex].enabled = !1,
this.options().debug && this.log("[player] switchQualityDirect() to newLevelIndex:" + n + "to true"),
this.qualityLevels()[n].enabled = !0,
this.mainContentQuality_ = e,
this.trigger({
level: this.player_.qualityLevels()[n],
type: "changeHLSP2P"
}),
this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
lastQuality: e,
lastVolume: this.volume()
})
}
,
e.getCurentQuality = function() {
return (this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities)[(this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex).lastIndexOf(this.qualityLevels().selectedIndex)]
}
,
e.getCurentQualityLabel = function() {
return this.options_.playbackQualities[this.qualityLevels().selectedIndex]
}
,
e.selectedQuality = function(e) {
null !== (this.selectedQuality_ = e) && this.selectedQuality_ !== e && (this.selectedQuality_ = e,
this.trigger({
type: "qualityselected",
quality: e
}))
}
,
e.getSelectedQuality = function() {
return this.selectedQuality_
}
,
e.getCurentBitrate = function() {
var e = (this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex).indexOf(this.qualityLevels().selectedIndex);
return this.player_.qualityLevels()[e] ? this.player_.qualityLevels()[e].bitrate : null
}
,
e.getQualityLevels = function() {
return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
}
,
e.defaultPlaybackRate = function(e) {
return void 0 !== e ? this.techCall_("setDefaultPlaybackRate", e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1
}
,
e.defaultPlaybackQuality = function(e) {
return void 0 !== e ? this.techCall_("setDefaultPlaybackQuality", e) : this.tech_ && this.tech_.featuresPlaybackQuality ? this.techGet_("defaultPlaybackQuality") : 1
}
,
e.changeAudioMode = function(e) {
this.trigger({
type: "changeAudioMode",
audioMode: e
})
}
,
e.isAudio = function(e) {
if (void 0 === e)
return !!this.isAudio_;
this.isAudio_ = !!e
}
,
e.addTextTrack = function(e, t, n) {
if (this.tech_)
return this.tech_.addTextTrack(e, t, n)
}
,
e.addRemoteTextTrack = function(e, t) {
if (this.tech_)
return this.tech_.addRemoteTextTrack(e, t)
}
,
e.removeRemoteTextTrack = function(e) {
void 0 === e && (e = {});
var t = e.track;
if (t = t || e,
this.tech_)
return this.tech_.removeRemoteTextTrack(t)
}
,
e.getVideoPlaybackQuality = function() {
return this.techGet_("getVideoPlaybackQuality")
}
,
e.videoWidth = function() {
return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0
}
,
e.videoHeight = function() {
return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0
}
,
e.language = function(e) {
if (void 0 === e)
return this.language_;
this.language_ = String(e).toLowerCase()
}
,
e.languages = function() {
return Fe(d.prototype.options_.languages, this.languages_)
}
,
e.toJSON = function() {
var e = Fe(this.options_)
, t = e.tracks;
e.tracks = [];
for (var n = 0; n < t.length; n++) {
var i = t[n];
(i = Fe(i)).player = void 0,
e.tracks[n] = i
}
return e
}
,
e.createModal = function(e, t) {
var n = this;
(t = t || {}).content = e || "";
var i = new Ot(this,t);
return this.addChild(i),
i.on("dispose", function() {
n.removeChild(i)
}),
i.open(),
i
}
,
e.updateCurrentBreakpoint_ = function() {
if (this.responsive())
for (var e = this.currentBreakpoint(), t = this.currentWidth(), n = 0; n < Ia.length; n++) {
var i = Ia[n];
if (t <= this.breakpoints_[i]) {
if (e === i)
return;
e && this.removeClass(Ma[e]),
this.addClass(Ma[i]),
this.breakpoint_ = i;
break
}
}
}
,
e.removeCurrentBreakpoint_ = function() {
var e = this.currentBreakpointClass();
this.breakpoint_ = "",
e && this.removeClass(e)
}
,
e.breakpoints = function(e) {
return void 0 === e || (this.breakpoint_ = "",
this.breakpoints_ = b({}, ja, e),
this.updateCurrentBreakpoint_()),
b(this.breakpoints_)
}
,
e.responsive = function(e) {
return void 0 === e ? this.responsive_ : (e = Boolean(e)) !== this.responsive_ ? ((this.responsive_ = e) ? (this.on("playerresize", this.updateCurrentBreakpoint_),
this.updateCurrentBreakpoint_()) : (this.off("playerresize", this.updateCurrentBreakpoint_),
this.removeCurrentBreakpoint_()),
e) : void 0
}
,
e.currentBreakpoint = function() {
return this.breakpoint_
}
,
e.currentBreakpointClass = function() {
return Ma[this.breakpoint_] || ""
}
,
e.loadMedia = function(e, t) {
var n = this;
if (e && "object" == typeof e) {
this.reset(),
this.cache_.media = Fe(e);
var i = this.cache_.media
, r = i.artwork
, s = i.poster
, a = i.src
, o = i.textTracks;
!r && s && (this.cache_.media.artwork = [{
src: s,
type: Ei(s)
}]),
a && this.src(a),
s && this.poster(s),
Array.isArray(o) && o.forEach(function(e) {
return n.addRemoteTextTrack(e, !1)
}),
this.ready(t)
}
}
,
e.getMedia = function() {
if (this.cache_.media)
return Fe(this.cache_.media);
var e = this.poster()
, t = {
src: this.currentSources(),
textTracks: Array.prototype.map.call(this.remoteTextTracks(), function(e) {
return {
kind: e.kind,
label: e.label,
language: e.language,
src: e.src
}
})
};
return e && (t.poster = e,
t.artwork = [{
src: t.poster,
type: Ei(t.poster)
}]),
t
}
,
e.setAdsLabel = function(e, t, n) {
void 0 === e ? (this.getChild("adsOverLay").hide(),
this.changingToMainContent_ = !0) : (this.changingToMainContent_ = !1,
this.getChild("adsOverLay").show(),
this.getChild("adsOverLay").updateTextNode(e, t, n))
}
,
e.changingToMainContent = function() {
return this.changingToMainContent_
}
,
e.getSavedPosition = function(e) {
var t = 0
, n = cr.get("h5vodLastPostion")
, i = (new Date).getTime() / 1e3;
return void 0 !== n && e === n.videoid && n.timestamp < i && n.timestamp + 604800 > i && void 0 !== n.position && (t = n.position),
t
}
,
e.saveVideoPosition = function(e) {
if (!this.ads || !0 !== this.ads.isInAdMode()) {
var t = this.currentTime();
if (!(t < 5))
if (t < 30 || t + 30 > this.duration())
cr.remove("h5vodLastPostion");
else {
var n = (new Date).getTime() / 1e3;
cr.set("h5vodLastPostion", {
videoid: e,
timestamp: n,
position: t
})
}
}
}
,
d.getTagSettings = function(e) {
var t = {
sources: [],
tracks: []
}
, n = O(e)
, i = n["data-setup"];
if (P(e, "vjs-fill") && (n.fill = !0),
P(e, "vjs-fluid") && (n.fluid = !0),
null !== i) {
var r = wt(i || "{}")
, s = r[0]
, a = r[1];
s && m.error(s),
b(n, a)
}
if (b(t, n),
e.hasChildNodes())
for (var o = e.childNodes, l = 0, u = o.length; l < u; l++) {
var c = o[l]
, h = c.nodeName.toLowerCase();
"source" === h ? t.sources.push(O(c)) : "track" === h && t.tracks.push(O(c))
}
return t
}
,
e.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)
}
,
d
}(He);
Dn.names.forEach(function(e) {
var t = Dn[e];
Ra.prototype[t.getterName] = function() {
return this.tech_ ? this.tech_[t.getterName]() : (this[t.privateName] = this[t.privateName] || new t.ListClass,
this[t.privateName])
}
}),
Ra.prototype.crossorigin = Ra.prototype.crossOrigin,
Ra.players = {};
var Fa = p.navigator;
Ra.prototype.options_ = {
techOrder: pi.defaultTechOrder_,
html5: {},
flash: {},
inactivityTimeout: 1e3,
playbackRates: [],
liveui: !1,
children: ["mediaLoader", "adsOverLay", "pauseAdOverLay", "bannerAdOverLay", "posterImage", "VipSkipAdTip", "barrageLayer", "chooseVideoPanel", "loadingSpinner", "switchBezel", "playToggleMini", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "contextMenuButton", "resizeManager"],
language: Fa && (Fa.languages && Fa.languages[0] || Fa.userLanguage || Fa.language) || "en",
languages: {},
notSupportedMessage: "No compatible source was found for this media.",
fullscreen: {
options: {
navigationUI: "hide"
}
},
breakpoints: {},
responsive: !1
},
"pictureInPictureEnabled"in f && Ra.prototype.options_.children.push("pictureInPictureToggle"),
["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function(e) {
Ra.prototype[e] = function() {
return this.techGet_(e)
}
}),
Pa.forEach(function(e) {
Ra.prototype["handleTech" + Re(e) + "_"] = function() {
return this.trigger(e)
}
}),
He.registerComponent("Player", Ra);
var Ha = n(function(n) {
function i(e, t) {
return n.exports = i = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t,
e
}
,
i(e, t)
}
n.exports = i
});
function Va(e) {
return Ya.hasOwnProperty(e)
}
function Qa(e) {
return Va(e) ? Ya[e] : void 0
}
function Ua(e, t) {
e[Ga] = e[Ga] || {},
e[Ga][t] = !0
}
function qa(e, t, n) {
var i = (n ? "before" : "") + "pluginsetup";
e.trigger(i, t),
e.trigger(i + ":" + t.name, t)
}
function za(r, s) {
return s.prototype.name = r,
function() {
qa(this, {
name: r,
plugin: s,
instance: null
}, !0);
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
var i = Ka(s, [this].concat(t));
return this[r] = function() {
return i
}
,
qa(this, i.getEventHash()),
i
}
}
var Wa = function() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return !1;
if (Reflect.construct.sham)
return !1;
if ("function" == typeof Proxy)
return !0;
try {
return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})),
!0
} catch (e) {
return !1
}
}
, Ka = n(function(i) {
function r(e, t, n) {
return Wa() ? i.exports = r = Reflect.construct : i.exports = r = function(e, t, n) {
var i = [null];
i.push.apply(i, t);
var r = new (Function.bind.apply(e, i));
return n && Ha(r, n.prototype),
r
}
,
r.apply(null, arguments)
}
i.exports = r
})
, Xa = "plugin"
, Ga = "activePlugins_"
, Ya = {}
, $a = function() {
function n(e) {
if (this.constructor === n)
throw new Error("Plugin must be sub-classed; not directly instantiated.");
this.player = e,
Oe(this),
delete this.trigger,
De(this, this.constructor.defaultState),
Ua(e, this.name),
this.dispose = Te(this, this.dispose),
e.on("dispose", this.dispose)
}
var e = n.prototype;
return e.version = function() {
return this.constructor.VERSION
}
,
e.getEventHash = function(e) {
return void 0 === e && (e = {}),
e.name = this.name,
e.plugin = this.constructor,
e.instance = this,
e
}
,
e.trigger = function(e, t) {
return void 0 === t && (t = {}),
me(this.eventBusEl_, e, this.getEventHash(t))
}
,
e.handleStateChanged = function(e) {}
,
e.dispose = function() {
var e = this.name
, t = this.player;
this.trigger("dispose"),
this.off(),
t.off("dispose", this.dispose),
t[Ga][e] = !1,
this.player = this.state = null,
t[e] = za(e, Ya[e])
}
,
n.isBasic = function(e) {
var t = "string" == typeof e ? Qa(e) : e;
return "function" == typeof t && !n.prototype.isPrototypeOf(t.prototype)
}
,
n.registerPlugin = function(e, t) {
if ("string" != typeof e)
throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + typeof e + ".");
if (Va(e))
m.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!');
else if (Ra.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 ' + typeof t + ".");
return Ya[e] = t,
e !== Xa && (n.isBasic(t) ? Ra.prototype[e] = function(t, n) {
function i() {
qa(this, {
name: t,
plugin: n,
instance: null
}, !0);
var e = n.apply(this, arguments);
return Ua(this, t),
qa(this, {
name: t,
plugin: n,
instance: e
}),
e
}
return Object.keys(n).forEach(function(e) {
i[e] = n[e]
}),
i
}(e, t) : Ra.prototype[e] = za(e, t)),
t
}
,
n.deregisterPlugin = function(e) {
if (e === Xa)
throw new Error("Cannot de-register base plugin.");
Va(e) && (delete Ya[e],
delete Ra.prototype[e])
}
,
n.getPlugins = function(e) {
var n;
return void 0 === e && (e = Object.keys(Ya)),
e.forEach(function(e) {
var t = Qa(e);
t && ((n = n || {})[e] = t)
}),
n
}
,
n.getPluginVersion = function(e) {
var t = Qa(e);
return t && t.VERSION || ""
}
,
n
}();
$a.getPlugin = Qa,
$a.BASE_PLUGIN_NAME = Xa,
$a.registerPlugin(Xa, $a),
Ra.prototype.usingPlugin = function(e) {
return !!this[Ga] && !0 === this[Ga][e]
}
,
Ra.prototype.hasPlugin = function(e) {
return !!Va(e)
}
;
var Ja = function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}),
t && Ha(e, t)
};
/*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */
function Za() {
return (Za = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var i in n)
Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
}
return e
}
).apply(this, arguments)
}
function eo(e, t) {
e.prototype = Object.create(t.prototype),
(e.prototype.constructor = e).__proto__ = t
}
function to(e) {
for (var t, n = e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')), i = {}, r = n.length; r--; )
"" !== n[r] && ((t = /([^=]*)=(.*)/.exec(n[r]).slice(1))[0] = t[0].replace(/^\s+|\s+$/g, ""),
t[1] = t[1].replace(/^\s+|\s+$/g, ""),
t[1] = t[1].replace(/^['"](.*)['"]$/g, "$1"),
i[t[0]] = t[1]);
return i
}
var no = function() {
function e() {
this.listeners = {}
}
var t = e.prototype;
return t.on = function(e, t) {
this.listeners[e] || (this.listeners[e] = []),
this.listeners[e].push(t)
}
,
t.off = function(e, t) {
if (!this.listeners[e])
return !1;
var n = this.listeners[e].indexOf(t);
return this.listeners[e].splice(n, 1),
-1 < n
}
,
t.trigger = function(e, t) {
var n, i, r, s = this.listeners[e];
if (s)
if (2 === arguments.length)
for (i = s.length,
n = 0; n < i; ++n)
s[n].call(this, t);
else
for (r = Array.prototype.slice.call(arguments, 1),
i = s.length,
n = 0; n < i; ++n)
s[n].apply(this, r)
}
,
t.dispose = function() {
this.listeners = {}
}
,
t.pipe = function(t) {
this.on("data", function(e) {
t.push(e)
})
}
,
e
}()
, io = function(t) {
function e() {
var e;
return (e = t.call(this) || this).buffer = "",
e
}
return eo(e, t),
e.prototype.push = function(e) {
var t;
for (this.buffer += e,
t = this.buffer.indexOf("\n"); -1 < t; t = this.buffer.indexOf("\n"))
this.trigger("data", this.buffer.substring(0, t)),
this.buffer = this.buffer.substring(t + 1)
}
,
e
}(no)
, ro = function(t) {
function e() {
var e;
return (e = t.call(this) || this).customParsers = [],
e.tagMappers = [],
e
}
eo(e, t);
var n = e.prototype;
return n.push = function(i) {
var l, u, c = this;
0 !== (i = i.trim()).length && ("#" === i[0] ? this.tagMappers.reduce(function(e, t) {
var n = t(i);
return n === i ? e : e.concat([n])
}, [i]).forEach(function(e) {
for (var t = 0; t < c.customParsers.length; t++)
if (c.customParsers[t].call(c, e))
return;
if (0 === e.indexOf("#EXT"))
if (e = e.replace("\r", ""),
l = /^#EXTM3U/.exec(e))
c.trigger("data", {
type: "tag",
tagType: "m3u"
});
else {
if (l = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))
return u = {
type: "tag",
tagType: "inf"
},
l[1] && (u.duration = parseFloat(l[1])),
l[2] && (u.title = l[2]),
void c.trigger("data", u);
if (l = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "targetduration"
},
l[1] && (u.duration = parseInt(l[1], 10)),
void c.trigger("data", u);
if (l = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "totalduration"
},
l[1] && (u.duration = parseInt(l[1], 10)),
void c.trigger("data", u);
if (l = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "version"
},
l[1] && (u.version = parseInt(l[1], 10)),
void c.trigger("data", u);
if (l = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "media-sequence"
},
l[1] && (u.number = parseInt(l[1], 10)),
void c.trigger("data", u);
if (l = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "discontinuity-sequence"
},
l[1] && (u.number = parseInt(l[1], 10)),
void c.trigger("data", u);
if (l = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))
return u = {
type: "tag",
tagType: "playlist-type"
},
l[1] && (u.playlistType = l[1]),
void c.trigger("data", u);
if (l = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))
return u = {
type: "tag",
tagType: "byterange"
},
l[1] && (u.length = parseInt(l[1], 10)),
l[2] && (u.offset = parseInt(l[2], 10)),
void c.trigger("data", u);
if (l = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))
return u = {
type: "tag",
tagType: "allow-cache"
},
l[1] && (u.allowed = !/NO/.test(l[1])),
void c.trigger("data", u);
if (l = /^#EXT-X-MAP:?(.*)$/.exec(e)) {
if (u = {
type: "tag",
tagType: "map"
},
l[1]) {
var n = to(l[1]);
if (n.URI && (u.uri = n.URI),
n.BYTERANGE) {
var i = n.BYTERANGE.split("@")
, r = i[0]
, s = i[1];
u.byterange = {},
r && (u.byterange.length = parseInt(r, 10)),
s && (u.byterange.offset = parseInt(s, 10))
}
}
c.trigger("data", u)
} else if (l = /^#EXT-X-STREAM-INF:?(.*)$/.exec(e)) {
if (u = {
type: "tag",
tagType: "stream-inf"
},
l[1]) {
if (u.attributes = to(l[1]),
u.attributes.RESOLUTION) {
var a = u.attributes.RESOLUTION.split("x")
, o = {};
a[0] && (o.width = parseInt(a[0], 10)),
a[1] && (o.height = parseInt(a[1], 10)),
u.attributes.RESOLUTION = o
}
u.attributes.BANDWIDTH && (u.attributes.BANDWIDTH = parseInt(u.attributes.BANDWIDTH, 10)),
u.attributes["PROGRAM-ID"] && (u.attributes["PROGRAM-ID"] = parseInt(u.attributes["PROGRAM-ID"], 10))
}
c.trigger("data", u)
} else {
if (l = /^#EXT-X-MEDIA:?(.*)$/.exec(e))
return u = {
type: "tag",
tagType: "media"
},
l[1] && (u.attributes = to(l[1])),
void c.trigger("data", u);
if (l = /^#EXT-X-ENDLIST/.exec(e))
c.trigger("data", {
type: "tag",
tagType: "endlist"
});
else if (l = /^#EXT-X-DISCONTINUITY/.exec(e))
c.trigger("data", {
type: "tag",
tagType: "discontinuity"
});
else {
if (l = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))
return u = {
type: "tag",
tagType: "program-date-time"
},
l[1] && (u.dateTimeString = l[1],
u.dateTimeObject = new Date(l[1])),
void c.trigger("data", u);
if (l = /^#EXT-X-KEY:?(.*)$/.exec(e))
return u = {
type: "tag",
tagType: "key"
},
l[1] && (u.attributes = to(l[1]),
u.attributes.IV && ("0x" === u.attributes.IV.substring(0, 2).toLowerCase() && (u.attributes.IV = u.attributes.IV.substring(2)),
u.attributes.IV = u.attributes.IV.match(/.{8}/g),
u.attributes.IV[0] = parseInt(u.attributes.IV[0], 16),
u.attributes.IV[1] = parseInt(u.attributes.IV[1], 16),
u.attributes.IV[2] = parseInt(u.attributes.IV[2], 16),
u.attributes.IV[3] = parseInt(u.attributes.IV[3], 16),
u.attributes.IV = new Uint32Array(u.attributes.IV))),
void c.trigger("data", u);
if (l = /^#EXT-X-START:?(.*)$/.exec(e))
return u = {
type: "tag",
tagType: "start"
},
l[1] && (u.attributes = to(l[1]),
u.attributes["TIME-OFFSET"] = parseFloat(u.attributes["TIME-OFFSET"]),
u.attributes.PRECISE = /YES/.test(u.attributes.PRECISE)),
void c.trigger("data", u);
if (l = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))
return u = {
type: "tag",
tagType: "cue-out-cont"
},
l[1] ? u.data = l[1] : u.data = "",
void c.trigger("data", u);
if (l = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))
return u = {
type: "tag",
tagType: "cue-out"
},
l[1] ? u.data = l[1] : u.data = "",
void c.trigger("data", u);
if (l = /^#EXT-X-CUE-IN:?(.*)?$/.exec(e))
return u = {
type: "tag",
tagType: "cue-in"
},
l[1] ? u.data = l[1] : u.data = "",
void c.trigger("data", u);
c.trigger("data", {
type: "tag",
data: e.slice(4)
})
}
}
}
else
c.trigger("data", {
type: "comment",
text: e.slice(1)
})
}) : this.trigger("data", {
type: "uri",
uri: i
}))
}
,
n.addParser = function(e) {
var t = this
, n = e.expression
, i = e.customType
, r = e.dataParser
, s = e.segment;
"function" != typeof r && (r = function(e) {
return e
}
),
this.customParsers.push(function(e) {
if (n.exec(e))
return t.trigger("data", {
type: "custom",
data: r(e),
customType: i,
segment: s
}),
!0
})
}
,
n.addTagMapper = function(e) {
var t = e.expression
, n = e.map;
this.tagMappers.push(function(e) {
return t.test(e) ? n(e) : e
})
}
,
e
}(no);
var so = function(t) {
function e() {
var e;
(e = t.call(this) || this).lineStream = new io,
e.parseStream = new ro,
e.lineStream.pipe(e.parseStream);
var r, s, a = function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(e), o = [], l = {}, u = {
AUDIO: {},
VIDEO: {},
"CLOSED-CAPTIONS": {},
SUBTITLES: {}
}, c = 0;
return e.manifest = {
allowCache: !0,
discontinuityStarts: [],
segments: []
},
e.parseStream.on("data", function(t) {
var n, i;
({
tag: function() {
({
"allow-cache": function() {
this.manifest.allowCache = t.allowed,
"allowed"in t || (this.trigger("info", {
message: "defaulting allowCache to YES"
}),
this.manifest.allowCache = !0)
},
byterange: function() {
var e = {};
"length"in t && ((l.byterange = e).length = t.length,
"offset"in t || (this.trigger("info", {
message: "defaulting offset to zero"
}),
t.offset = 0)),
"offset"in t && ((l.byterange = e).offset = t.offset)
},
endlist: function() {
this.manifest.endList = !0
},
inf: function() {
"mediaSequence"in this.manifest || (this.manifest.mediaSequence = 0,
this.trigger("info", {
message: "defaulting media sequence to zero"
})),
"discontinuitySequence"in this.manifest || (this.manifest.discontinuitySequence = 0,
this.trigger("info", {
message: "defaulting discontinuity sequence to zero"
})),
0 < t.duration && (l.duration = t.duration),
0 === t.duration && (l.duration = .01,
this.trigger("info", {
message: "updating zero segment duration to a small value"
})),
this.manifest.segments = o
},
key: function() {
if (t.attributes)
if ("NONE" !== t.attributes.METHOD)
if (t.attributes.URI) {
if ("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" === t.attributes.KEYFORMAT) {
return -1 === ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD) ? void this.trigger("warn", {
message: "invalid key method provided for Widevine"
}) : ("SAMPLE-AES-CENC" === t.attributes.METHOD && this.trigger("warn", {
message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
}),
"data:text/plain;base64," !== t.attributes.URI.substring(0, 23) ? void this.trigger("warn", {
message: "invalid key URI provided for Widevine"
}) : t.attributes.KEYID && "0x" === t.attributes.KEYID.substring(0, 2) ? void (this.manifest.contentProtection = {
"com.widevine.alpha": {
attributes: {
schemeIdUri: t.attributes.KEYFORMAT,
keyId: t.attributes.KEYID.substring(2)
},
pssh: function(e) {
for (var t = p.atob(e || ""), n = new Uint8Array(t.length), i = 0; i < t.length; i++)
n[i] = t.charCodeAt(i);
return n
}(t.attributes.URI.split(",")[1])
}
}) : void this.trigger("warn", {
message: "invalid key ID provided for Widevine"
}))
}
t.attributes.METHOD || this.trigger("warn", {
message: "defaulting key method to AES-128"
}),
s = {
method: t.attributes.METHOD || "AES-128",
uri: t.attributes.URI
},
"undefined" != typeof t.attributes.IV && (s.iv = t.attributes.IV)
} else
this.trigger("warn", {
message: "ignoring key declaration without URI"
});
else
s = null;
else
this.trigger("warn", {
message: "ignoring key declaration without attribute list"
})
},
"media-sequence": function() {
isFinite(t.number) ? this.manifest.mediaSequence = t.number : this.trigger("warn", {
message: "ignoring invalid media sequence: " + t.number
})
},
"discontinuity-sequence": function() {
isFinite(t.number) ? (this.manifest.discontinuitySequence = t.number,
c = t.number) : this.trigger("warn", {
message: "ignoring invalid discontinuity sequence: " + t.number
})
},
"playlist-type": function() {
/VOD|EVENT/.test(t.playlistType) ? this.manifest.playlistType = t.playlistType : this.trigger("warn", {
message: "ignoring unknown playlist type: " + t.playlist
})
},
map: function() {
r = {},
t.uri && (r.uri = t.uri),
t.byterange && (r.byterange = t.byterange)
},
"stream-inf": function() {
this.manifest.playlists = o,
this.manifest.mediaGroups = this.manifest.mediaGroups || u,
t.attributes ? (l.attributes || (l.attributes = {}),
Za(l.attributes, t.attributes)) : this.trigger("warn", {
message: "ignoring empty stream-inf attributes"
})
},
media: function() {
if (this.manifest.mediaGroups = this.manifest.mediaGroups || u,
t.attributes && t.attributes.TYPE && t.attributes["GROUP-ID"] && t.attributes.NAME) {
var e = this.manifest.mediaGroups[t.attributes.TYPE];
e[t.attributes["GROUP-ID"]] = e[t.attributes["GROUP-ID"]] || {},
n = e[t.attributes["GROUP-ID"]],
(i = {
default: /yes/i.test(t.attributes.DEFAULT)
}).default ? i.autoselect = !0 : i.autoselect = /yes/i.test(t.attributes.AUTOSELECT),
t.attributes.LANGUAGE && (i.language = t.attributes.LANGUAGE),
t.attributes.URI && (i.uri = t.attributes.URI),
t.attributes["INSTREAM-ID"] && (i.instreamId = t.attributes["INSTREAM-ID"]),
t.attributes.CHARACTERISTICS && (i.characteristics = t.attributes.CHARACTERISTICS),
t.attributes.FORCED && (i.forced = /yes/i.test(t.attributes.FORCED)),
n[t.attributes.NAME] = i
} else
this.trigger("warn", {
message: "ignoring incomplete or missing media group"
})
},
discontinuity: function() {
c += 1,
l.discontinuity = !0,
this.manifest.discontinuityStarts.push(o.length)
},
"program-date-time": function() {
"undefined" == typeof this.manifest.dateTimeString && (this.manifest.dateTimeString = t.dateTimeString,
this.manifest.dateTimeObject = t.dateTimeObject),
l.dateTimeString = t.dateTimeString,
l.dateTimeObject = t.dateTimeObject
},
targetduration: function() {
!isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
message: "ignoring invalid target duration: " + t.duration
}) : this.manifest.targetDuration = t.duration
},
totalduration: function() {
!isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
message: "ignoring invalid total duration: " + t.duration
}) : this.manifest.totalDuration = t.duration
},
start: function() {
t.attributes && !isNaN(t.attributes["TIME-OFFSET"]) ? this.manifest.start = {
timeOffset: t.attributes["TIME-OFFSET"],
precise: t.attributes.PRECISE
} : this.trigger("warn", {
message: "ignoring start declaration without appropriate attribute list"
})
},
"cue-out": function() {
l.cueOut = t.data
},
"cue-out-cont": function() {
l.cueOutCont = t.data
},
"cue-in": function() {
l.cueIn = t.data
}
}[t.tagType] || function() {}
).call(a)
},
uri: function() {
l.uri = t.uri,
o.push(l),
!this.manifest.targetDuration || "duration"in l || (this.trigger("warn", {
message: "defaulting segment duration to the target duration"
}),
l.duration = this.manifest.targetDuration),
s && (l.key = s),
l.timeline = c,
r && (l.map = r),
l = {}
},
comment: function() {},
custom: function() {
t.segment ? (l.custom = l.custom || {},
l.custom[t.customType] = t.data) : (this.manifest.custom = this.manifest.custom || {},
this.manifest.custom[t.customType] = t.data)
}
})[t.type].call(a)
}),
e
}
eo(e, t);
var n = e.prototype;
return n.push = function(e) {
this.lineStream.push(e)
}
,
n.end = function() {
this.lineStream.push("\n")
}
,
n.addParser = function(e) {
this.parseStream.addParser(e)
}
,
n.addTagMapper = function(e) {
this.parseStream.addTagMapper(e)
}
,
e
}(no)
, ao = function(e) {
return 0 === e.indexOf("#") ? e.slice(1) : e
};
function oo(e, n, t) {
var i = oo.getPlayer(e);
if (i)
return n && m.warn('Player "' + e + '" is already initialised. Options will not be applied.'),
t && i.ready(t),
i;
var r = "string" == typeof e ? $("#" + ao(e)) : e;
if (!k(r))
throw new TypeError("The element or ID supplied is not valid. (videojs)");
r.ownerDocument.defaultView && r.ownerDocument.body.contains(r) || m.warn("The element supplied is not included in the DOM"),
n = n || {},
oo.hooks("beforesetup").forEach(function(e) {
var t = e(r, Fe(n));
l(t) && !Array.isArray(t) ? n = Fe(n, t) : m.error("please return an object in beforesetup hooks")
});
var s = He.getComponent("Player");
return i = new s(r,n,t),
oo.hooks("setup").forEach(function(e) {
return e(i)
}),
!0 === n.debug && (i.log("ads plugin init, version:" + i.ads.VERSION),
i.log("qualityLevel plugin init, version:"),
i.log(i.qualityLevels())),
i.ads({
debug: !!n.debug,
timeout: 6e3
}),
i
}
if (oo.hooks_ = {},
oo.hooks = function(e, t) {
return oo.hooks_[e] = oo.hooks_[e] || [],
t && (oo.hooks_[e] = oo.hooks_[e].concat(t)),
oo.hooks_[e]
}
,
oo.hook = function(e, t) {
oo.hooks(e, t)
}
,
oo.hookOnce = function(n, e) {
oo.hooks(n, [].concat(e).map(function(t) {
return function e() {
return oo.removeHook(n, e),
t.apply(void 0, arguments)
}
}))
}
,
oo.removeHook = function(e, t) {
var n = oo.hooks(e).indexOf(t);
return !(n <= -1) && (oo.hooks_[e] = oo.hooks_[e].slice(),
oo.hooks_[e].splice(n, 1),
!0)
}
,
!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE && C()) {
var lo = $(".vjs-styles-defaults");
if (!lo) {
lo = re("vjs-styles-defaults");
var uo = $("head");
uo && uo.insertBefore(lo, uo.firstChild),
se(lo, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")
}
}
ne(1, oo),
oo.VERSION = y,
oo.PLAYER_VERSION = v,
oo.UPDATE_DATE = g,
oo.options = Ra.prototype.options_,
oo.getPlayers = function() {
return Ra.players
}
,
oo.getPlayer = function(e) {
var t, n = Ra.players;
if ("string" == typeof e) {
var i = ao(e)
, r = n[i];
if (r)
return r;
t = $("#" + i)
} else
t = e;
if (k(t)) {
var s = t
, a = s.player
, o = s.playerId;
if (a || n[o])
return a || n[o]
}
}
,
oo.getAllPlayers = function() {
return Object.keys(Ra.players).map(function(e) {
return Ra.players[e]
}).filter(Boolean)
}
,
oo.players = Ra.players,
oo.getComponent = He.getComponent,
oo.registerComponent = function(e, t) {
pi.isTech(t) && m.warn("The " + e + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),
He.registerComponent.call(He, e, t)
}
,
oo.getTech = pi.getTech,
oo.registerTech = pi.registerTech,
oo.use = function(e, t) {
fi[e] = fi[e] || [],
fi[e].push(t)
}
,
Object.defineProperty(oo, "middleware", {
value: {},
writeable: !1,
enumerable: !0
}),
Object.defineProperty(oo.middleware, "TERMINATOR", {
value: gi,
writeable: !1,
enumerable: !0
}),
oo.browser = pt,
oo.TOUCH_ENABLED = lt,
oo.extend = function(e, t) {
void 0 === t && (t = {});
var n = function() {
e.apply(this, arguments)
}
, i = {};
for (var r in "object" == typeof t ? (t.constructor !== Object.prototype.constructor && (n = t.constructor),
i = t) : "function" == typeof t && (n = t),
Ja(n, e),
e && (n.super_ = e),
i)
i.hasOwnProperty(r) && (n.prototype[r] = i[r]);
return n
}
,
oo.mergeOptions = Fe,
oo.bind = Te,
oo.registerPlugin = $a.registerPlugin,
oo.deregisterPlugin = $a.deregisterPlugin,
oo.plugin = function(e, t) {
return m.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),
$a.registerPlugin(e, t)
}
,
oo.getPlugins = $a.getPlugins,
oo.getPlugin = $a.getPlugin,
oo.getPluginVersion = $a.getPluginVersion,
oo.addLanguage = function(e, t) {
var n;
return e = ("" + e).toLowerCase(),
oo.options.languages = Fe(oo.options.languages, ((n = {})[e] = t,
n)),
oo.options.languages[e]
}
,
oo.log = m,
oo.createLogger = _,
oo.createTimeRange = oo.createTimeRanges = gt,
oo.formatTime = Bt,
oo.setFormatTime = function(e) {
Dt = e
}
,
oo.resetFormatTime = function() {
Dt = Nt
}
,
oo.parseUrl = sn,
oo.isCrossOrigin = ln,
oo.EventTarget = ke,
oo.on = ge,
oo.one = _e,
oo.off = ye,
oo.trigger = me,
oo.xhr = Zt,
oo.TextTrack = Ln,
oo.AudioTrack = In,
oo.VideoTrack = Mn,
oo.storePub = cr,
oo.M3u8Parser = so,
["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(e) {
oo[e] = function() {
return m.warn("videojs." + e + "() is deprecated; use videojs.dom." + e + "() instead"),
Z[e].apply(null, arguments)
}
}),
oo.computedStyle = h,
oo.dom = Z,
oo.url = un,
oo.defineLazyProperty = Ea;
function co(e, t) {
t.isImmediatePropagationStopped = function() {
return !0
}
,
t.cancelBubble = !0,
t.isPropagationStopped = function() {
return !0
}
}
function ho(e, t, n) {
co(0, n),
e.trigger({
type: t + n.type,
originalEvent: n
})
}
function po(e) {
"playing" === e.type ? function(e, t) {
e.ads.isInAdMode() && (e.ads.isContentResuming() ? e.ads._contentEnding && ho(e, "content", t) : ho(e, "ad", t))
}(this, e) : "ended" === e.type ? function(e, t) {
e.ads.isInAdMode() ? e.ads.isContentResuming() ? (co(0, t),
e.trigger("resumeended")) : ho(e, "ad", t) : e.ads._contentHasEnded || e.ads.stitchedAds() || (ho(e, "content", t),
e.trigger("readyforpostroll"))
}(this, e) : "loadstart" === e.type || "loadeddata" === e.type || "loadedmetadata" === e.type ? function(e, t) {
if (!("loadstart" === t.type && !e.ads._hasThereBeenALoadStartDuringPlayerLife || "loadeddata" === t.type && !e.ads._hasThereBeenALoadedData || "loadedmetadata" === t.type && !e.ads._hasThereBeenALoadedMetaData))
if (e.ads.inAdBreak())
ho(e, "ad", t);
else {
if (e.currentSrc() !== e.ads.contentSrc)
return;
ho(e, "content", t)
}
}(this, e) : "play" === e.type ? function(e, t) {
e.ads.inAdBreak() ? ho(e, "ad", t) : e.ads.isContentResuming() && ho(e, "content", t)
}(this, e) : this.ads.isInAdMode() && (this.ads.isContentResuming() ? ho(this, "content", e) : ho(this, "ad", e))
}
function fo() {
!function() {
if (oo.dom.isInFrame() && "function" != typeof p.__tcfapi) {
for (var a, e = p, o = {}; e; ) {
try {
if (e.frames.__tcfapiLocator) {
a = e;
break
}
} catch (e) {}
if (e === p.top)
break;
e = e.parent
}
if (!a)
return;
p.__tcfapi = function(e, t, n, i) {
var r = Math.random() + ""
, s = {
__tcfapiCall: {
command: e,
parameter: i,
version: t,
callId: r
}
};
o[r] = n,
a.postMessage(s, "*")
}
,
p.addEventListener("message", function(e) {
var t = {};
try {
t = "string" == typeof e.data ? JSON.parse(e.data) : e.data
} catch (e) {}
var n = t.__tcfapiReturn;
n && "function" == typeof o[n.callId] && (o[n.callId](n.returnValue, n.success),
o[n.callId] = null)
}, !1)
}
}(),
"function" == typeof p.__tcfapi && p.__tcfapi("addEventListener", 2, function(e, t) {
t && (yo = e)
})
}
function vo(e, t) {
return t ? encodeURIComponent(e) : e
}
function go(e, t, n) {
if (e && e[n])
for (var i = e[n], r = Object.keys(i), s = 0; s < r.length; s++) {
t["{mediainfo." + n + "." + r[s] + "}"] = i[r[s]]
}
}
var yo = {};
var mo = {
processMetadataTracks: function(t, n) {
for (var e = t.textTracks(), i = function(e) {
"metadata" === e.kind && (t.ads.cueTextTracks.setMetadataTrackMode(e),
n(t, e))
}, r = 0; r < e.length; r++)
i(e[r]);
e.addEventListener("addtrack", function(e) {
i(e.track)
})
},
setMetadataTrackMode: function(e) {},
getSupportedAdCue: function(e, t) {
return t
},
isSupportedAdCue: function(e, t) {
return !0
},
getCueId: function(e, t) {
return t.id
}
};
function _o() {
!1 !== this.ads._shouldBlockPlay && (this.paused() || (this.ads.debug("Playback was canceled by cancelContentPlay"),
this.pause()),
this.ads._cancelledPlay = !0)
}
mo.processAdTrack = function(e, t, n, i) {
e.ads.includedCues = {};
for (var r = 0; r < t.length; r++) {
var s = t[r]
, a = this.getSupportedAdCue(e, s);
if (!this.isSupportedAdCue(e, s))
return void oo.log.warn("Skipping as this is not a supported ad cue.", s);
var o = this.getCueId(e, s)
, l = s.startTime;
if (h = e,
void 0 !== (d = o) && h.ads.includedCues[d])
return void oo.log("Skipping ad already seen with ID " + o);
i && i(e, a, o, l),
n(e, a, o, l),
u = e,
void 0 !== (c = o) && "" !== c && (u.ads.includedCues[c] = !0)
}
var u, c, h, d
}
;
var bo = {}
, To = oo;
bo.isMiddlewareMediatorSupported = function() {
return !To.browser.IS_IOS && !To.browser.IS_ANDROID && !!(To.use && To.middleware && To.middleware.TERMINATOR)
}
,
bo.playMiddleware = function(n) {
return {
setSource: function(e, t) {
t(null, e)
},
callPlay: function() {
if (n.ads && !0 === n.ads._shouldBlockPlay)
return n.ads.debug("Using playMiddleware to block content playback"),
n.ads._playBlocked = !0,
To.middleware.TERMINATOR
},
play: function(e, t) {
n.ads && n.ads._playBlocked && e ? (n.ads.debug("Play call to Tech was terminated."),
n.trigger("play"),
n.addClass("vjs-has-started"),
n.ads._playBlocked = !1) : t && t.catch && t.catch(function(e) {
"NotAllowedError" !== e.name || oo.browser.IS_SAFARI || n.trigger("pause")
})
}
}
}
,
bo.testHook = function(e) {
To = e
}
;
var Co = bo.playMiddleware
, ko = bo.isMiddlewareMediatorSupported;
var Eo = function() {
function n() {}
return n.getState = function(e) {
if (e)
return n.states_ && n.states_[e] ? n.states_[e] : void 0
}
,
n.registerState = function(e, t) {
if ("string" != typeof e || !e)
throw new Error('Illegal state name, "' + e + '"; must be a non-empty string.');
return n.states_ || (n.states_ = {}),
n.states_[e] = t
}
,
n
}()
, So = function() {
function e(e) {
this.player = e
}
e._getName = function() {
return "Anonymous State"
}
;
var t = e.prototype;
return t.transitionTo = function(e) {
var t = this.player;
this.cleanup(t);
var n = new e(t);
t.ads._state = n,
t.ads.debug(this.constructor._getName() + " -> " + n.constructor._getName());
for (var i = arguments.length, r = new Array(1 < i ? i - 1 : 0), s = 1; s < i; s++)
r[s - 1] = arguments[s];
n.init.apply(n, [t].concat(r))
}
,
t.init = function() {}
,
t.cleanup = function() {}
,
t.onPlay = function() {}
,
t.onPlaying = function() {}
,
t.onEnded = function() {}
,
t.onAdEnded = function() {}
,
t.onAdsReady = function() {
oo.log.warn("Unexpected adsready event")
}
,
t.onAdsError = function() {}
,
t.onAdsCanceled = function() {}
,
t.onAdTimeout = function() {}
,
t.onAdStarted = function() {}
,
t.onContentChanged = function() {}
,
t.onContentResumed = function() {}
,
t.onReadyForPostroll = function() {
oo.log.warn("Unexpected readyforpostroll event")
}
,
t.onNoPreroll = function() {}
,
t.onNoPostroll = function() {}
,
t.startLinearAdMode = function() {
oo.log.warn("Unexpected startLinearAdMode invocation (State via " + this.constructor._getName() + ")")
}
,
t.endLinearAdMode = function() {
oo.log.warn("Unexpected endLinearAdMode invocation (State via " + this.constructor._getName() + ")")
}
,
t.skipLinearAdMode = function() {
oo.log.warn("Unexpected skipLinearAdMode invocation (State via " + this.constructor._getName() + ")")
}
,
t.isAdState = function() {
throw new Error("isAdState unimplemented for " + this.constructor._getName())
}
,
t.isWaitingForAdBreak = function() {
return !1
}
,
t.isContentResuming = function() {
return !1
}
,
t.inAdBreak = function() {
return !1
}
,
t.handleEvent = function(e) {
var t = this.player;
"play" === e ? this.onPlay(t) : "adsready" === e ? this.onAdsReady(t) : "adserror" === e ? this.onAdsError(t) : "adscanceled" === e ? this.onAdsCanceled(t) : "adtimeout" === e ? this.onAdTimeout(t) : "ads-ad-started" === e ? this.onAdStarted(t) : "contentchanged" === e ? this.onContentChanged(t) : "contentresumed" === e ? this.onContentResumed(t) : "readyforpostroll" === e ? this.onReadyForPostroll(t) : "playing" === e ? this.onPlaying(t) : "ended" === e ? this.onEnded(t) : "nopreroll" === e ? this.onNoPreroll(t) : "nopostroll" === e ? this.onNoPostroll(t) : "adended" === e && this.onAdEnded(t)
}
,
e
}();
function wo(e, t) {
e.prototype = Object.create(t.prototype),
(e.prototype.constructor = e).__proto__ = t
}
Eo.registerState("State", So);
var xo = function(n) {
function e(e) {
var t;
return (t = n.call(this, e) || this).contentResuming = !1,
t.waitingForAdBreak = !1,
t
}
wo(e, n);
var t = e.prototype;
return t.isAdState = function() {
return !0
}
,
t.onPlaying = function() {
var e = Eo.getState("ContentPlayback");
this.contentResuming && this.transitionTo(e)
}
,
t.onContentResumed = function() {
var e = Eo.getState("ContentPlayback");
this.contentResuming && this.transitionTo(e)
}
,
t.isWaitingForAdBreak = function() {
return this.waitingForAdBreak
}
,
t.isContentResuming = function() {
return this.contentResuming
}
,
t.inAdBreak = function() {
return !0 === this.player.ads._inLinearAdMode
}
,
e
}(So);
Eo.registerState("AdState", xo);
var Ao = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e);
var n = t.prototype;
return n.isAdState = function() {
return !1
}
,
n.onContentChanged = function(e) {
var t = Eo.getState("BeforePreroll")
, n = Eo.getState("Preroll");
e.ads.debug("Received contentchanged event (ContentState)"),
e.paused() ? this.transitionTo(t) : (this.transitionTo(n, !1),
e.pause(),
e.ads._pausedOnContentupdate = !0)
}
,
t
}(So);
Eo.registerState("ContentState", Ao);
var Po, Lo = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "AdsDone"
}
;
var n = t.prototype;
return n.init = function(e) {
e.ads._contentHasEnded = !0,
e.trigger("ended")
}
,
n.startLinearAdMode = function() {
oo.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")
}
,
t
}(Eo.getState("ContentState"));
Eo.registerState("AdsDone", Lo);
var Io = {
start: function(e) {
e.ads.debug("Starting ad break"),
e.ads._inLinearAdMode = !0,
e.trigger("adstart"),
e.ads.shouldTakeSnapshots() && (e.ads.snapshot = function(e) {
var t;
t = oo.browser.IS_IOS && e.ads.isLive(e) && 0 < e.seekable().length ? e.currentTime() - e.seekable().end(0) : e.currentTime();
var n = e.$(".vjs-tech")
, i = e.textTracks ? e.textTracks() : []
, r = []
, s = {
ended: e.ended(),
currentSrc: e.currentSrc(),
sources: e.currentSources(),
src: e.tech_.src(),
currentTime: t,
type: e.currentType()
};
n && (s.style = n.getAttribute("style"));
for (var a = 0; a < i.length; a++) {
var o = i[a];
r.push({
track: o,
mode: o.mode
}),
o.mode = "disabled"
}
return s.suppressedTracks = r,
s
}(e)),
e.ads.shouldPlayContentBehindAd(e) && (e.ads.preAdVolume_ = e.volume(),
e.volume(0)),
e.addClass("vjs-ad-playing"),
e.hasClass("vjs-live") && e.removeClass("vjs-live"),
e.ads.removeNativePoster()
},
end: function(e, t) {
e.ads.debug("Ending ad break"),
void 0 === t && (t = function() {}
),
e.ads.adType = null,
e.ads._inLinearAdMode = !1,
e.trigger("adend"),
e.removeClass("vjs-ad-playing"),
e.ads.isLive(e) && e.addClass("vjs-live"),
e.ads.shouldTakeSnapshots() ? function(i, e) {
var r = i.ads.snapshot;
if (void 0 === e && (e = function() {}
),
!0 === i.ads.disableNextSnapshotRestore)
return i.ads.disableNextSnapshotRestore = !1,
delete i.ads.snapshot,
e();
function t() {
for (var e = 0; e < u.length; e++)
(a = u[e]).track.mode = a.mode
}
function n() {
var e;
if (oo.browser.IS_IOS && i.ads.isLive(i)) {
if (r.currentTime < 0 && (e = 0 < i.seekable().length ? i.seekable().end(0) + r.currentTime : i.currentTime(),
i.currentTime(e)),
i.paused()) {
var t = i.play();
t && t.catch && t.catch(function(e) {
oo.log.warn("Play promise rejected in IOS snapshot resume", e)
})
}
} else if (r.ended)
i.currentTime(i.duration());
else {
i.currentTime(r.currentTime);
var n = i.play();
n && n.catch && n.catch(function(e) {
oo.log.warn("Play promise rejected in snapshot resume", e)
})
}
i.ads.shouldRemoveAutoplay_ && (i.autoplay(!1),
i.ads.shouldRemoveAutoplay_ = !1)
}
function s() {
if (i.off("contentcanplay", s),
Po && i.clearTimeout(Po),
1 < (o = i.el().querySelector(".vjs-tech")).readyState)
return n();
if (void 0 === o.seekable)
return n();
if (0 < o.seekable.length)
return n();
if (l--)
i.setTimeout(s, 50);
else
try {
n()
} catch (e) {
oo.log.warn("Failed to resume the content after an advertisement", e)
}
}
var a, o = i.$(".vjs-tech"), l = 20, u = r.suppressedTracks;
if ("style"in r && o.setAttribute("style", r.style || ""),
i.ads.videoElementRecycled())
i.one("resumeended", function() {
delete i.ads.snapshot,
e()
}),
i.one("contentloadedmetadata", t),
oo.browser.IS_IOS && !i.autoplay() && (i.autoplay(!0),
i.ads.shouldRemoveAutoplay_ = !0),
i.src(r.sources),
i.one("contentcanplay", s),
Po = i.setTimeout(s, 2e3);
else {
if (t(),
!i.ended()) {
var c = i.play();
c && c.catch && c.catch(function(e) {
oo.log.warn("Play promise rejected in snapshot restore", e)
})
}
delete i.ads.snapshot,
e()
}
}(e, t) : (e.volume(e.ads.preAdVolume_),
t())
}
}
, Mo = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "Preroll"
}
;
var n = t.prototype;
return n.init = function(e, t, n) {
if (this.waitingForAdBreak = !0,
e.addClass("vjs-ad-loading"),
n || e.ads.nopreroll_)
return this.resumeAfterNoPreroll(e);
var i = e.ads.settings.timeout;
"number" == typeof e.ads.settings.prerollTimeout && (i = e.ads.settings.prerollTimeout),
this._timeout = e.setTimeout(function() {
e.trigger("adtimeout")
}, i),
t ? this.handleAdsReady() : this.adsReady = !1
}
,
n.onAdsReady = function(e) {
e.ads.inAdBreak() ? oo.log.warn("Unexpected adsready event (Preroll)") : (e.ads.debug("Received adsready event (Preroll)"),
this.handleAdsReady())
}
,
n.handleAdsReady = function() {
this.adsReady = !0,
this.readyForPreroll()
}
,
n.afterLoadStart = function(e) {
var t = this.player;
t.ads._hasThereBeenALoadStartDuringPlayerLife ? e() : (t.ads.debug("Waiting for loadstart..."),
t.one("loadstart", function() {
t.ads.debug("Received loadstart event"),
e()
}))
}
,
n.noPreroll = function() {
var e = this;
this.afterLoadStart(function() {
e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),
e.resumeAfterNoPreroll(e.player)
})
}
,
n.readyForPreroll = function() {
var e = this.player;
this.afterLoadStart(function() {
e.ads.debug("Triggered readyforpreroll event (Preroll)"),
e.trigger("readyforpreroll")
})
}
,
n.onAdsCanceled = function(e) {
var t = this;
e.ads.debug("adscanceled (Preroll)"),
this.afterLoadStart(function() {
t.resumeAfterNoPreroll(e)
})
}
,
n.onAdsError = function(e) {
var t = this;
oo.log("adserror (Preroll)"),
this.inAdBreak() ? e.ads.endLinearAdMode() : this.afterLoadStart(function() {
t.resumeAfterNoPreroll(e)
})
}
,
n.startLinearAdMode = function() {
var e = this.player;
!this.adsReady || e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Preroll)") : (this.clearTimeout(e),
e.ads.adType = "preroll",
this.waitingForAdBreak = !1,
Io.start(e),
e.ads._shouldBlockPlay = !1)
}
,
n.onAdStarted = function(e) {
e.removeClass("vjs-ad-loading")
}
,
n.endLinearAdMode = function() {
var e = this.player;
this.inAdBreak() && (e.removeClass("vjs-ad-loading"),
e.addClass("vjs-ad-content-resuming"),
this.contentResuming = !0,
Io.end(e))
}
,
n.skipLinearAdMode = function() {
var e = this
, t = this.player;
t.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : this.afterLoadStart(function() {
t.trigger("adskip"),
t.ads.debug("skipLinearAdMode (Preroll)"),
e.resumeAfterNoPreroll(t)
})
}
,
n.onAdTimeout = function(e) {
var t = this;
this.afterLoadStart(function() {
e.ads.debug("adtimeout (Preroll)"),
t.resumeAfterNoPreroll(e)
})
}
,
n.onNoPreroll = function(e) {
e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected nopreroll event (Preroll)") : this.noPreroll()
}
,
n.resumeAfterNoPreroll = function(e) {
if (this.contentResuming = !0,
e.ads._shouldBlockPlay = !1,
this.cleanupPartial(e),
e.ads._playRequested || e.ads._pausedOnContentupdate)
if (e.paused()) {
e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");
var t = e.play();
t && t.then && t.then(null, function(e) {})
} else
e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),
e.trigger("play"),
e.trigger("playing")
}
,
n.cleanup = function(e) {
e.ads._hasThereBeenALoadStartDuringPlayerLife || oo.log.warn("Leaving Preroll state before loadstart event can cause issues."),
this.cleanupPartial(e)
}
,
n.cleanupPartial = function(e) {
e.removeClass("vjs-ad-loading"),
e.removeClass("vjs-ad-content-resuming"),
this.clearTimeout(e)
}
,
n.clearTimeout = function(e) {
e.clearTimeout(this._timeout),
this._timeout = null
}
,
t
}(Eo.getState("AdState"));
Eo.registerState("Preroll", Mo);
var jo = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "BeforePreroll"
}
;
var n = t.prototype;
return n.init = function(e) {
this.adsReady = !1,
this.shouldResumeToContent = !1,
e.ads._shouldBlockPlay = !e.ads.settings.allowVjsAutoplay || !e.autoplay()
}
,
n.onAdsReady = function(e) {
e.ads.debug("Received adsready event (BeforePreroll)"),
this.adsReady = !0
}
,
n.onPlay = function(e) {
var t = Eo.getState("Preroll");
e.ads.debug("Received play event (BeforePreroll)"),
this.transitionTo(t, this.adsReady, this.shouldResumeToContent)
}
,
n.onAdsCanceled = function(e) {
e.ads.debug("adscanceled (BeforePreroll)"),
this.shouldResumeToContent = !0
}
,
n.onAdsError = function() {
this.player.ads.debug("adserror (BeforePreroll)"),
this.shouldResumeToContent = !0
}
,
n.onNoPreroll = function() {
this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),
this.shouldResumeToContent = !0
}
,
n.skipLinearAdMode = function() {
var e = this.player;
e.trigger("adskip"),
e.ads.debug("skipLinearAdMode (BeforePreroll)"),
this.shouldResumeToContent = !0
}
,
n.onContentChanged = function() {
this.init(this.player)
}
,
t
}(Eo.getState("ContentState"));
Eo.registerState("BeforePreroll", jo);
var Oo = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "Midroll"
}
;
var n = t.prototype;
return n.init = function(e) {
e.ads.adType = "midroll",
Io.start(e),
e.addClass("vjs-ad-loading")
}
,
n.onAdStarted = function(e) {
e.removeClass("vjs-ad-loading")
}
,
n.endLinearAdMode = function() {
var e = this.player;
this.inAdBreak() && (this.contentResuming = !0,
e.addClass("vjs-ad-content-resuming"),
e.removeClass("vjs-ad-loading"),
Io.end(e))
}
,
n.onAdsError = function(e) {
this.inAdBreak() && e.ads.endLinearAdMode()
}
,
n.cleanup = function(e) {
e.removeClass("vjs-ad-loading"),
e.removeClass("vjs-ad-content-resuming")
}
,
t
}(Eo.getState("AdState"));
Eo.registerState("Midroll", Oo);
var No = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "Postroll"
}
;
var n = t.prototype;
return n.init = function(e) {
if (this.waitingForAdBreak = !0,
e.ads._contentEnding = !0,
e.ads.nopostroll_) {
this.resumeContent(e);
var t = Eo.getState("AdsDone");
this.transitionTo(t)
} else {
e.addClass("vjs-ad-loading");
var n = e.ads.settings.timeout;
"number" == typeof e.ads.settings.postrollTimeout && (n = e.ads.settings.postrollTimeout),
this._postrollTimeout = e.setTimeout(function() {
e.trigger("adtimeout")
}, n)
}
}
,
n.startLinearAdMode = function() {
var e = this.player;
e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Postroll)") : (e.ads.adType = "postroll",
e.clearTimeout(this._postrollTimeout),
this.waitingForAdBreak = !1,
Io.start(e))
}
,
n.onAdStarted = function(e) {
e.removeClass("vjs-ad-loading")
}
,
n.endLinearAdMode = function() {
var e = this
, t = this.player
, n = Eo.getState("AdsDone");
this.inAdBreak() && (t.removeClass("vjs-ad-loading"),
this.resumeContent(t),
Io.end(t, function() {
e.transitionTo(n)
}))
}
,
n.skipLinearAdMode = function() {
var e = this.player;
e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : (e.ads.debug("Postroll abort (skipLinearAdMode)"),
e.trigger("adskip"),
this.abort(e))
}
,
n.onAdTimeout = function(e) {
e.ads.debug("Postroll abort (adtimeout)"),
this.abort(e)
}
,
n.onAdsError = function(e) {
e.ads.debug("Postroll abort (adserror)"),
e.ads.inAdBreak() ? e.ads.endLinearAdMode() : this.abort(e)
}
,
n.onContentChanged = function(e) {
if (this.isContentResuming()) {
var t = Eo.getState("BeforePreroll");
this.transitionTo(t)
} else if (!this.inAdBreak()) {
var n = Eo.getState("Preroll");
this.transitionTo(n)
}
}
,
n.onNoPostroll = function(e) {
this.isContentResuming() || this.inAdBreak() ? oo.log.warn("Unexpected nopostroll event (Postroll)") : this.abort(e)
}
,
n.resumeContent = function(e) {
this.contentResuming = !0,
e.addClass("vjs-ad-content-resuming")
}
,
n.abort = function(e) {
var t = Eo.getState("AdsDone");
this.resumeContent(e),
e.removeClass("vjs-ad-loading"),
this.transitionTo(t)
}
,
n.cleanup = function(e) {
e.removeClass("vjs-ad-content-resuming"),
e.clearTimeout(this._postrollTimeout),
e.ads._contentEnding = !1
}
,
t
}(Eo.getState("AdState"));
Eo.registerState("Postroll", No);
var Do = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "ContentPlayback"
}
;
var n = t.prototype;
return n.init = function(e) {
e.ads._shouldBlockPlay = !1
}
,
n.onAdsReady = function(e) {
e.ads.debug("Received adsready event (ContentPlayback)"),
e.ads.nopreroll_ || (e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),
e.trigger("readyforpreroll"))
}
,
n.onReadyForPostroll = function(e) {
var t = Eo.getState("Postroll");
e.ads.debug("Received readyforpostroll event"),
this.transitionTo(t)
}
,
n.startLinearAdMode = function() {
var e = Eo.getState("Midroll");
this.transitionTo(e)
}
,
t
}(Eo.getState("ContentState"));
Eo.registerState("ContentPlayback", Do);
var Bo = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "StitchedContentPlayback"
}
;
var n = t.prototype;
return n.init = function() {
this.player.ads._shouldBlockPlay = !1
}
,
n.onContentChanged = function() {
this.player.ads.debug("Received contentchanged event (" + this.constructor._getName() + ")")
}
,
n.startLinearAdMode = function() {
var e = Eo.getState("StitchedAdRoll");
this.transitionTo(e)
}
,
t
}(Eo.getState("ContentState"));
Eo.registerState("StitchedContentPlayback", Bo);
var Ro = function(e) {
function t() {
return e.apply(this, arguments) || this
}
wo(t, e),
t._getName = function() {
return "StitchedAdRoll"
}
;
var n = t.prototype;
return n.init = function() {
this.waitingForAdBreak = !1,
this.contentResuming = !1,
this.player.ads.adType = "stitched",
Io.start(this.player)
}
,
n.onPlaying = function() {}
,
n.onContentResumed = function() {}
,
n.onAdEnded = function() {
this.endLinearAdMode(),
this.player.trigger("ended")
}
,
n.endLinearAdMode = function() {
var e = Eo.getState("StitchedContentPlayback");
Io.end(this.player),
this.transitionTo(e)
}
,
t
}(Eo.getState("AdState"));
Eo.registerState("StitchedAdRoll", Ro);
function Fo(e) {
var i = this
, t = oo.mergeOptions(Uo, e)
, n = [];
function r() {
var e = i.textTracks();
if (!i.ads.shouldPlayContentBehindAd(i) && i.ads.inAdBreak() && i.tech_.featuresNativeTextTracks && oo.browser.IS_IOS && !Array.isArray(i.textTracks()))
for (var t = 0; t < e.length; t++) {
var n = e[t];
"showing" === n.mode && (n.mode = "disabled")
}
}
Qo.concat(["firstplay", "loadedalldata"]).forEach(function(e) {
-1 === n.indexOf(e) && n.push(e)
}),
i.on(n, po),
Vo() || function(e, t) {
t && oo.log("Using cancelContentPlay to block content playback"),
e.on("play", _o)
}(i, t.debug),
i.setTimeout(function() {
i.ads._hasThereBeenALoadStartDuringPlayerLife || "" === i.src() || oo.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")
}, 5e3),
i.on("ended", function() {
i.hasClass("vjs-has-started") || i.addClass("vjs-has-started")
}),
i.on("contenttimeupdate", function() {
i.removeClass("vjs-waiting")
}),
i.on(["addurationchange", "adcanplay"], function() {
if (!i.ads.settings.stitchedAds && !i.hasStarted() && (!i.ads.snapshot || i.currentSrc() !== i.ads.snapshot.currentSrc) && i.ads.inAdBreak()) {
var e = i.play();
e && e.catch && e.catch(function(e) {
oo.log.warn("Play promise rejected when playing ad", e)
})
}
}),
i.on("nopreroll", function() {
i.ads.debug("Received nopreroll event"),
i.ads.nopreroll_ = !0
}),
i.on("nopostroll", function() {
i.ads.debug("Received nopostroll event"),
i.ads.nopostroll_ = !0
}),
i.on("playing", function() {
i.ads._cancelledPlay = !1,
i.ads._pausedOnContentupdate = !1
}),
i.on("play", function() {
i.ads._playRequested = !0
}),
i.one("loadstart", function() {
i.ads._hasThereBeenALoadStartDuringPlayerLife = !0
}),
i.on("loadeddata", function() {
i.ads._hasThereBeenALoadedData = !0
}),
i.on("loadedmetadata", function() {
i.ads._hasThereBeenALoadedMetaData = !0
}),
i.ads = function(n) {
return {
disableNextSnapshotRestore: !1,
_contentEnding: !1,
_contentHasEnded: !1,
_hasThereBeenALoadStartDuringPlayerLife: !1,
_hasThereBeenALoadedData: !1,
_hasThereBeenALoadedMetaData: !1,
_inLinearAdMode: !1,
_shouldBlockPlay: !1,
_playBlocked: !1,
_playRequested: !1,
adType: null,
VERSION: "6.9.0",
reset: function() {
n.ads.disableNextSnapshotRestore = !1,
n.ads._contentEnding = !1,
n.ads._contentHasEnded = !1,
n.ads.snapshot = null,
n.ads.adType = null,
n.ads._hasThereBeenALoadedData = !1,
n.ads._hasThereBeenALoadedMetaData = !1,
n.ads._cancelledPlay = !1,
n.ads._shouldBlockPlay = !1,
n.ads._playBlocked = !1,
n.ads.nopreroll_ = !1,
n.ads.nopostroll_ = !1,
n.ads._playRequested = !1
},
startLinearAdMode: function() {
n.ads._state.startLinearAdMode()
},
endLinearAdMode: function() {
n.ads._state.endLinearAdMode()
},
skipLinearAdMode: function() {
n.ads._state.skipLinearAdMode()
},
stitchedAds: function(e) {
return void 0 !== e && (oo.log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),
this.settings.stitchedAds = !!e),
this.settings.stitchedAds
},
videoElementRecycled: function() {
if (n.ads.shouldPlayContentBehindAd(n))
return !1;
if (!this.snapshot)
throw new Error("You cannot use videoElementRecycled while there is no snapshot.");
var e = n.tech_.src() !== this.snapshot.src
, t = n.currentSrc() !== this.snapshot.currentSrc;
return e || t
},
isLive: function(e) {
return void 0 === e && (e = n),
"boolean" == typeof e.ads.settings.contentIsLive ? e.ads.settings.contentIsLive : e.duration() === 1 / 0 || "8" === oo.browser.IOS_VERSION && 0 === e.duration()
},
shouldPlayContentBehindAd: function(e) {
if (void 0 === e && (e = n),
e)
return !!e.ads.settings.liveCuePoints && (!oo.browser.IS_IOS && !oo.browser.IS_ANDROID && e.duration() === 1 / 0);
throw new Error("shouldPlayContentBehindAd requires a player as a param")
},
shouldTakeSnapshots: function(e) {
return void 0 === e && (e = n),
!this.shouldPlayContentBehindAd(e) && !this.stitchedAds()
},
isInAdMode: function() {
return this._state.isAdState()
},
isWaitingForAdBreak: function() {
return this._state.isWaitingForAdBreak()
},
isContentResuming: function() {
return this._state.isContentResuming()
},
isAdPlaying: function() {
return this._state.inAdBreak()
},
inAdBreak: function() {
return this._state.inAdBreak()
},
removeNativePoster: function() {
var e = n.$(".vjs-tech");
e && e.removeAttribute("poster")
},
debug: function() {
if (this.settings.debug) {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
1 === t.length && "string" == typeof t[0] ? oo.log("ADS: " + t[0]) : oo.log.apply(oo, ["ADS:"].concat(t))
}
}
}
}(i),
(i.ads.settings = t).stitchedAds = !!t.stitchedAds,
t.stitchedAds ? i.ads._state = new (Eo.getState("StitchedContentPlayback"))(i) : i.ads._state = new (Eo.getState("BeforePreroll"))(i),
i.ads._state.init(i),
i.ads.cueTextTracks = mo,
i.ads.adMacroReplacement = function(e, o, t) {
var n = this
, l = {};
e = e.replace(/{([^}=]+)=([^}]+)}/g, function(e, t, n) {
return l["{" + t + "}"] = n,
"{" + t + "}"
}),
void 0 === o && (o = !1);
var i = {};
for (var r in void 0 !== t && (i = t),
i["{player.id}"] = this.options_["data-player"] || this.id_,
i["{player.height}"] = this.currentHeight(),
i["{player.width}"] = this.currentWidth(),
i["{mediainfo.id}"] = this.mediainfo ? this.mediainfo.id : "",
i["{mediainfo.name}"] = this.mediainfo ? this.mediainfo.name : "",
i["{mediainfo.duration}"] = this.mediainfo ? this.mediainfo.duration : "",
i["{player.duration}"] = this.duration(),
i["{player.pageUrl}"] = oo.dom.isInFrame() ? f.referrer : p.location.href,
i["{playlistinfo.id}"] = this.playlistinfo ? this.playlistinfo.id : "",
i["{playlistinfo.name}"] = this.playlistinfo ? this.playlistinfo.name : "",
i["{timestamp}"] = (new Date).getTime(),
i["{document.referrer}"] = f.referrer,
i["{window.location.href}"] = p.location.href,
i["{random}"] = Math.floor(1e12 * Math.random()),
["description", "tags", "reference_id", "ad_keys"].forEach(function(e) {
n.mediainfo && n.mediainfo[e] ? i["{mediainfo." + e + "}"] = n.mediainfo[e] : l["{mediainfo." + e + "}"] ? i["{mediainfo." + e + "}"] = l["{mediainfo." + e + "}"] : i["{mediainfo." + e + "}"] = ""
}),
go(this.mediainfo, i, "custom_fields"),
go(this.mediainfo, i, "customFields"),
Object.keys(yo).forEach(function(e) {
i["{tcf." + e + "}"] = yo[e]
}),
i["{tcf.gdprAppliesInt}"] = yo.gdprApplies ? 1 : 0,
i)
e = e.split(r).join(vo(i[r], o));
for (var s in e = e.replace(/{pageVariable\.([^}]+)}/g, function(e, t) {
for (var n, i = p, r = t.split("."), s = 0; s < r.length; s++)
s === r.length - 1 ? n = i[r[s]] : i = i[r[s]];
var a = typeof n;
return null === n ? "null" : void 0 === n ? l["{pageVariable." + t + "}"] ? l["{pageVariable." + t + "}"] : (oo.log.warn('Page variable "' + t + '" not found'),
"") : "string" != a && "number" != a && "boolean" != a ? (oo.log.warn('Page variable "' + t + '" is not a supported type'),
"") : vo(String(n), o)
}),
l)
e = e.replace(s, l[s]);
return e
}
.bind(i),
function(t) {
t.ads.contentSrc = t.currentSrc(),
t.ads._seenInitialLoadstart = !1,
t.on("loadstart", function() {
if (!t.ads.inAdBreak()) {
var e = t.currentSrc();
e !== t.ads.contentSrc && (t.ads._seenInitialLoadstart && t.trigger({
type: "contentchanged"
}),
t.trigger({
type: "contentupdate",
oldValue: t.ads.contentSrc,
newValue: e
}),
t.ads.contentSrc = e),
t.ads._seenInitialLoadstart = !0
}
})
}(i),
i.on("contentchanged", i.ads.reset),
i.ready(function() {
i.textTracks().addEventListener("change", r)
}),
i.on(["play", "playing", "ended", "adsready", "adscanceled", "adskip", "adserror", "adtimeout", "adended", "ads-ad-started", "contentchanged", "dispose", "contentresumed", "readyforpostroll", "nopreroll", "nopostroll"], function(e) {
i.ads._state.handleEvent(e.type)
}),
i.on("dispose", function() {
i.ads.reset(),
i.textTracks().removeEventListener("change", r)
}),
fo(),
i.ads.listenToTcf = fo
}
var Ho, Vo = bo.isMiddlewareMediatorSupported, Qo = oo.getTech("Html5").Events, Uo = {
timeout: 5e3,
prerollTimeout: void 0,
postrollTimeout: void 0,
debug: !1,
stitchedAds: !1,
contentIsLive: void 0,
liveCuePoints: !0,
allowVjsAutoplay: oo.options.normalizeAutoplay || !1
};
function qo(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
Fo.VERSION = "6.9.0",
Ho = Fo,
function() {
if (oo.getPlugin)
return Boolean(oo.getPlugin("ads"));
var e = oo.getComponent("Player");
return Boolean(e && e.prototype.ads)
}() || ((oo.registerPlugin || oo.plugin)("ads", Ho),
ko() && !oo.usingContribAdsMiddleware_ && (oo.use("*", Co),
oo.usingContribAdsMiddleware_ = !0,
oo.log.debug("Play middleware has been registered with videojs")));
function zo(e) {
var t = this;
if (oo.browser.IS_IE8)
for (var n in t = f.createElement("custom"),
zo.prototype)
"constructor" !== n && (t[n] = zo.prototype[n]);
return t.id = e.id,
t.label = t.id,
t.width = e.width,
t.height = e.height,
t.bitrate = e.bandwidth,
t.enabled_ = e.enabled,
Object.defineProperty(t, "enabled", {
get: function() {
return t.enabled_()
},
set: function(e) {
t.enabled_(e)
}
}),
t
}
var Wo = function(i) {
function r() {
var e, t = qo(qo(e = i.call(this) || this));
if (oo.browser.IS_IE8)
for (var n in t = f.createElement("custom"),
r.prototype)
"constructor" !== n && (t[n] = r.prototype[n]);
return t.levels_ = [],
t.selectedIndex_ = -1,
Object.defineProperty(t, "selectedIndex", {
get: function() {
return t.selectedIndex_
}
}),
Object.defineProperty(t, "length", {
get: function() {
return t.levels_.length
}
}),
t || qo(e)
}
!/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */
function(e, t) {
e.prototype = Object.create(t.prototype),
(e.prototype.constructor = e).__proto__ = t
}(r, i);
var e = r.prototype;
return e.addQualityLevel = function(e) {
var t = this.getQualityLevelById(e.id);
if (t)
return t;
var n = this.levels_.length;
return t = new zo(e),
"" + n in this || Object.defineProperty(this, n, {
get: function() {
return this.levels_[n]
}
}),
this.levels_.push(t),
this.trigger({
qualityLevel: t,
type: "addqualitylevel"
}),
t
}
,
e.removeQualityLevel = function(e) {
for (var t = null, n = 0, i = this.length; n < i; n++)
if (this[n] === e) {
t = this.levels_.splice(n, 1)[0],
this.selectedIndex_ === n ? this.selectedIndex_ = -1 : this.selectedIndex_ > n && this.selectedIndex_--;
break
}
return t && this.trigger({
qualityLevel: e,
type: "removequalitylevel"
}),
t
}
,
e.getQualityLevelById = function(e) {
for (var t = 0, n = this.length; t < n; t++) {
var i = this[t];
if (i.id === e)
return i
}
return null
}
,
e.dispose = function() {
this.selectedIndex_ = -1,
this.levels_.length = 0
}
,
r
}(oo.EventTarget);
for (var Ko in Wo.prototype.allowedEvents_ = {
change: "change",
addqualitylevel: "addqualitylevel",
removequalitylevel: "removequalitylevel"
},
Wo.prototype.allowedEvents_)
Wo.prototype["on" + Ko] = null;
function Xo(e) {
return function(t) {
var n = t.qualityLevels
, i = new Wo;
return t.on("dispose", function e() {
i.dispose(),
t.qualityLevels = n,
t.off("dispose", e)
}),
t.qualityLevels = function() {
return i
}
,
t.qualityLevels.VERSION = "2.1.0",
i
}(this, oo.mergeOptions({}, e))
}
return (oo.registerPlugin || oo.plugin)("qualityLevels", Xo),
Xo.VERSION = "2.1.0",
oo
});