Files
sdk4_demo/sdk/3rdparty/video.min.js

25 lines
206 KiB
JavaScript
Raw Normal View History

2025-07-03 15:12:58 +08:00
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.videojs = e() }(this, function () {
function t(t, e) { return e = { exports: {} }, t(e, e.exports), e.exports } function e(t, e) { Ve(t).forEach(function (n) { return e(t[n], n) }) } function n(t, e) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; return Ve(t).reduce(function (n, r) { return e(n, t[r], r) }, n) } function r(t) { for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)r[i - 1] = arguments[i]; return Object.assign ? Object.assign.apply(Object, [t].concat(r)) : (r.forEach(function (n) { n && e(n, function (e, n) { t[n] = e }) }), t) } function i(t) { return !!t && "object" === (void 0 === t ? "undefined" : Ie(t)) } function o(t) { return i(t) && "[object Object]" === Fe.call(t) && t.constructor === Object } function s(t) { return t.replace(/\n\r?\s*/g, "") } function a(t, e) { if (!t || !e) return ""; if ("function" == typeof oe.getComputedStyle) { var n = oe.getComputedStyle(t); return n ? n[e] : "" } return t.currentStyle[e] || "" } function l(t) { return "string" == typeof t && /\S/.test(t) } function c(t) { if (/\s/.test(t)) throw new Error("class has illegal whitespace characters") } function u(t) { return new RegExp("(^|\\s)" + t + "($|\\s)") } function h() { return ue === oe.document && void 0 !== ue.createElement } function p(t) { return i(t) && 1 === t.nodeType } function d() { try { return oe.parent !== oe.self } catch (t) { return !0 } } function f(t) { return function (e, n) { if (!l(e)) return ue[t](null); l(n) && (n = ue.querySelector(n)); var r = p(n) ? n : ue; return r[t] && r[t](e) } } function v() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div", e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r = arguments[3], i = ue.createElement(t); return Object.getOwnPropertyNames(e).forEach(function (t) { var n = e[t]; -1 !== t.indexOf("aria-") || "role" === t || "type" === t ? (Xe.warn(qe(Ke, t, n)), i.setAttribute(t, n)) : "textContent" === t ? y(i, n) : i[t] = n }), Object.getOwnPropertyNames(n).forEach(function (t) { i.setAttribute(t, n[t]) }), r && D(i, r), i } function y(t, e) { return void 0 === t.textContent ? t.innerText = e : t.textContent = e, t } function g(t, e) { e.firstChild ? e.insertBefore(t, e.firstChild) : e.appendChild(t) } function m(t, e) { return c(e), t.classList ? t.classList.contains(e) : u(e).test(t.className) } function _(t, e) { return t.classList ? t.classList.add(e) : m(t, e) || (t.className = (t.className + " " + e).trim()), t } function b(t, e) { return t.classList ? t.classList.remove(e) : (c(e), t.className = t.className.split(/\s+/).filter(function (t) { return t !== e }).join(" ")), t } function T(t, e, n) { var r = m(t, e); if ("function" == typeof n && (n = n(t, e)), "boolean" != typeof n && (n = !r), n !== r) return n ? _(t, e) : b(t, e), t } function C(t, e) { Object.getOwnPropertyNames(e).forEach(function (n) { var r = e[n]; null === r || void 0 === r || !1 === r ? t.removeAttribute(n) : t.setAttribute(n, !0 === r ? "" : r) }) } function k(t) { var e = {}; if (t && t.attributes && t.attributes.length > 0) for (var n = t.attributes, r = n.length - 1; r >= 0; r--) { var i = n[r].name, o = n[r].value; "boolean" != typeof t[i] && -1 === ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf("," + i + ",") || (o = null !== o), e[i] = o } return e } function w(t, e) { return t.getAttribute(e) } function E(t, e, n) { t.setAttribute(e, n) } function S(t, e) { t.removeAttribute(e) } function x() { ue.body.focus(), ue.onselectstart = function () { return !1 } } function j() { ue.onselectstart = function () { return !0 } } function A(t) { if (t && t.getBoundingClientRect && t.parentNode) { var e = t.getBoundingClientRect(), n = {}; return ["bottom", "height", "left", "right", "top", "width"].forEach(function (t) { void 0 !== e[t] && (n[t] = e[t]) }), n.height || (n.height = parseFloat(a(t, "height"))), n.width || (n.width = parseFloat(a(t, "width"))), n } } function P(t) { var e = void 0; if (t.getBoun
if (h()) {
var t = ue.getElementsByTagName("video"), e = ue.getElementsByTagName("audio"), n = []; if (t && t.length > 0) for (var r = 0, i = t.length; r < i; r++)n.push(t[r]); if (e && e.length > 0) for (var o = 0, s = e.length; o < s; o++)n.push(e[o])
; if (n && n.length > 0) for (var a = 0, l = n.length; a < l; a++) { var c = n[a]; if (!c || !c.getAttribute) { Y(1); break } if (void 0 === c.player) { var u = c.getAttribute("data-setup"); null !== u && on(c) } } else rn || Y(1)
}
}; h() && "complete" === ue.readyState ? rn = !0 : K(oe, "load", function () { rn = !0 }); var an = function (t) { var e = ue.createElement("style"); return e.className = t, e }, ln = function (t, e) { t.styleSheet ? t.styleSheet.cssText = e : t.textContent = e }, cn = function (t, e, n) { e.guid || (e.guid = R()); var r = function () { return e.apply(t, arguments) }; return r.guid = n ? n + "_" + e.guid : e.guid, r }, un = function (t, e) { var n = Date.now(); return function () { var r = Date.now(); r - n >= e && (t.apply(void 0, arguments), n = r) } }, hn = function () { }; hn.prototype.allowedEvents_ = {}, hn.prototype.on = function (t, e) { var n = this.addEventListener; this.addEventListener = function () { }, z(this, t, e), this.addEventListener = n }, hn.prototype.addEventListener = hn.prototype.on, hn.prototype.off = function (t, e) { X(this, t, e) }, hn.prototype.removeEventListener = hn.prototype.off, hn.prototype.one = function (t, e) { var n = this.addEventListener; this.addEventListener = function () { }, K(this, t, e), this.addEventListener = n }, hn.prototype.trigger = function (t) { var e = t.type || t; "string" == typeof t && (t = { type: e }), t = U(t), this.allowedEvents_[e] && this["on" + e] && this["on" + e](t), q(this, t) }, hn.prototype.dispatchEvent = hn.prototype.trigger; var pn = function (t) { return t instanceof hn || !!t.eventBusEl_ && ["on", "one", "off", "trigger"].every(function (e) { return "function" == typeof t[e] }) }, dn = function (t) { return "string" == typeof t && /\S/.test(t) || Array.isArray(t) && !!t.length }, fn = function (t) { if (!t.nodeName && !pn(t)) throw new Error("Invalid target; must be a DOM node or evented object.") }, vn = function (t) { if (!dn(t)) throw new Error("Invalid event type; must be a non-empty string or array.") }, yn = function (t) { if ("function" != typeof t) throw new Error("Invalid listener; must be a function.") }, gn = function (t, e) { var n = e.length < 3 || e[0] === t || e[0] === t.eventBusEl_, r = void 0, i = void 0, o = void 0; return n ? (r = t.eventBusEl_, e.length >= 3 && e.shift(), i = e[0], o = e[1]) : (r = e[0], i = e[1], o = e[2]), fn(r), vn(i), yn(o), o = cn(t, o), { isTargetingSelf: n, target: r, type: i, listener: o } }, mn = function (t, e, n, r) { fn(t), t.nodeName ? nn[e](t, n, r) : t[e](n, r) }, _n = { on: function () { for (var t = this, e = arguments.length, n = Array(e), r = 0; r < e; r++)n[r] = arguments[r]; var i = gn(this, n), o = i.isTargetingSelf, s = i.target, a = i.type, l = i.listener; if (mn(s, "on", a, l), !o) { var c = function () { return t.off(s, a, l) }; c.guid = l.guid; var u = function () { return t.off("dispose", c) }; u.guid = l.guid, mn(this, "on", "dispose", c), mn(s, "on", "dispose", u) } }, one: function () { for (var t = this, e = arguments.length, n = Array(e), r = 0; r < e; r++)n[r] = arguments[r]; var i = gn(this, n), o = i.isTargetingSelf, s = i.target, a = i.type, l = i.listener; if (o) mn(s, "one", a, l); else { var c = function e() { for (var n = arguments.length, r = Array(n), i = 0; i < n; i++)r[i] = arguments[i]; t.off(s, a, e), l.apply(null, r) }; c.guid = l.guid, mn(s, "one", a, c) } }, off: function (t, e, n) { if (!t || dn(t)) X(this.eventBusEl_, t, e); else { var r = t, i = e; fn(r), vn(i), yn(n), n = cn(this, n), this.off("dispose", n), r.nodeName ? (X(r, i, n), X(r, "dispose", n)) : pn(r) && (r.off(i, n), r.off("dispose", n)) } }, trigger: function (t, e) { return q(this.eventBusEl_, t, e) } }, bn = { state: {}, setState: function (t) { var n = this; "function" == typeof t && (t = t()); var r = void 0; return e(t, function (t, e) { n.state[e] !== t && (r = r || {}, r[e] = { from: n.state[e], to: t }), n.state[e] = t }), r && pn(this) && this.trigger({ changes: r, type: "statechanged" }), r } }, Tn = function () { function t(e, n, r) { if (De(this, t), !e && this.play ? this.player_ = e = this : this.player_ = e, this.options_ = Z({}, this.options_), n = this.options_ = Z(this.options_, n), this.id_ = n.id || n.el && n.el.id, !this.id_) { var i = e && e.id && e.id() || "no_player"
function e() {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; De(this, e); var r = Re(this, t.call(this)), i = void 0, o = r; if (xe) {
o = ue.createElement("custom"); for (var s in e.prototype) "constructor" !== s && (o[s] = e.prototype[s])
} var a = new fr(n); if (o.kind = a.kind, o.src = a.src, o.srclang = a.language, o.label = a.label, o.default = a.default, Object.defineProperty(o, "readyState", { get: function () { return i } }), Object.defineProperty(o, "track", { get: function () { return a } }), i = gr, a.addEventListener("loadeddata", function () { i = mr, o.trigger({ type: "load", target: o }) }), xe) { var l; return l = o, Re(r, l) } return r
} return Le(e, t), e
}(hn); _r.prototype.allowedEvents_ = { load: "load" }, _r.NONE = gr, _r.LOADING = 1, _r.LOADED = mr, _r.ERROR = 3; var br = { audio: { ListClass: Fn, TrackClass: vr, capitalName: "Audio" }, video: { ListClass: Hn, TrackClass: yr, capitalName: "Video" }, text: { ListClass: Wn, TrackClass: fr, capitalName: "Text" } }; Object.keys(br).forEach(function (t) { br[t].getterName = t + "Tracks", br[t].privateName = t + "Tracks_" }); var Tr = { remoteText: { ListClass: Wn, TrackClass: fr, capitalName: "RemoteText", getterName: "remoteTextTracks", privateName: "remoteTextTracks_" }, remoteTextEl: { ListClass: Un, TrackClass: _r, capitalName: "RemoteTextTrackEls", getterName: "remoteTextTrackEls", privateName: "remoteTextTrackEls_" } }, Cr = Z(br, Tr); Tr.names = Object.keys(Tr), br.names = Object.keys(br), Cr.names = [].concat(Tr.names).concat(br.names); var kr = Object.create || function () { function t() { } return function (e) { if (1 !== arguments.length) throw new Error("Object.create shim only accepts one parameter."); return t.prototype = e, new t } }(); _t.prototype = kr(Error.prototype), _t.prototype.constructor = _t, _t.Errors = { BadSignature: { code: 0, message: "Malformed WebVTT signature." }, BadTimeStamp: { code: 1, message: "Malformed time stamp." } }, Tt.prototype = { set: function (t, e) { this.get(t) || "" === e || (this.values[t] = e) }, get: function (t, e, n) { return n ? this.has(t) ? this.values[t] : e[n] : this.has(t) ? this.values[t] : e }, has: function (t) { return t in this.values }, alt: function (t, e, n) { for (var r = 0; r < n.length; ++r)if (e === n[r]) { this.set(t, e); break } }, integer: function (t, e) { /^-?\d+$/.test(e) && this.set(t, parseInt(e, 10)) }, percent: function (t, e) { return !!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/) && (e = parseFloat(e)) >= 0 && e <= 100) && (this.set(t, e), !0) } }; var wr = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&lrm;": "", "&rlm;": "", "&nbsp;": " " }, Er = { c: "span", i: "i", b: "b", u: "u", ruby: "ruby", rt: "rt", v: "span", lang: "span" }, Sr = { v: "title", lang: "lang" }, xr = { rt: "ruby" }, jr = [[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]]; jt.prototype.applyStyles = function (t, e) { e = e || this.div; for (var n in t) t.hasOwnProperty(n) && (e.style[n] = t[n]) }, jt.prototype.formatStyle = function (t, e) { return 0 === t ? 0 : t + e }, At.prototype = kr(jt.prototype), At.prototype.constructor = At, Pt.prototype.move = function (
function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.on(n, "ended", i.handleEnded), i } return Le(e, t), e.prototype.buildCSSClass = function () { return "vjs-current-time" }, e.prototype.updateContent = function (t) { var e = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); this.updateFormattedTime_(e) }, e.prototype.handleEnded = function (t) {
this.player_.duration() && this.updateFormattedTime_(this.player_.duration())
}, e
}(Qr); Zr.prototype.controlText_ = "Current Time", Tn.registerComponent("CurrentTimeDisplay", Zr); var ti = function (t) { function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.on(n, ["durationchange", "loadedmetadata"], i.throttledUpdateContent), i } return Le(e, t), e.prototype.buildCSSClass = function () { return "vjs-duration" }, e.prototype.updateContent = function (t) { var e = this.player_.duration(); e && this.duration_ !== e && (this.duration_ = e, this.updateFormattedTime_(e)) }, e }(Qr); ti.prototype.controlText_ = "Duration Time", Tn.registerComponent("DurationDisplay", ti); var ei = function (t) { function e() { return De(this, e), Re(this, t.apply(this, arguments)) } return Le(e, t), e.prototype.createEl = function () { return t.prototype.createEl.call(this, "div", { className: "vjs-time-control vjs-time-divider", innerHTML: "<div><span>/</span></div>" }) }, e }(Tn); Tn.registerComponent("TimeDivider", ei); var ni = function (t) { function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.on(n, "durationchange", i.throttledUpdateContent), i.on(n, "ended", i.handleEnded), i } return Le(e, t), e.prototype.buildCSSClass = function () { return "vjs-remaining-time" }, e.prototype.formatTime_ = function (e) { return "-" + t.prototype.formatTime_.call(this, e) }, e.prototype.updateContent = function (t) { this.player_.duration() && (this.player_.remainingTimeDisplay ? this.updateFormattedTime_(this.player_.remainingTimeDisplay()) : this.updateFormattedTime_(this.player_.remainingTime())) }, e.prototype.handleEnded = function (t) { this.player_.duration() && this.updateFormattedTime_(0) }, e }(Qr); ni.prototype.controlText_ = "Remaining Time", Tn.registerComponent("RemainingTimeDisplay", ni); var ri = function (t) { function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.updateShowing(), i.on(i.player(), "durationchange", i.updateShowing), i } return Le(e, t), e.prototype.createEl = function () { var e = t.prototype.createEl.call(this, "div", { className: "vjs-live-control vjs-control" }); return this.contentEl_ = v("div", { className: "vjs-live-display", innerHTML: '<span class="vjs-control-text">' + this.localize("Stream Type") + "</span>" + this.localize("LIVE") }, { "aria-live": "off" }), e.appendChild(this.contentEl_), e }, e.prototype.updateShowing = function (t) { this.player().duration() === 1 / 0 ? this.show() : this.hide() }, e }(Tn); Tn.registerComponent("LiveDisplay", ri); var ii = function (t) { function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.bar = i.getChild(i.options_.barName), i.vertical(!!i.options_.vertical), i.on("mousedown", i.handleMouseDown), i.on("touchstart", i.handleMouseDown), i.on("focus", i.handleFocus), i.on("blur", i.handleBlur), i.on("click", i.handleClick), i.on(n, "controlsvisible", i.update), i.playerEvent && i.on(n, i.playerEvent, i.update), i } return Le(e, t), e.prototype.createEl = function (e) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; return n.className = n.className + " vjs-slider", n = r({ tabIndex: 0 }, n), i = r({ role: "slider", "aria-valuenow": 0, "aria-valuemin": 0, "aria-valuemax": 100, tabIndex: 0 }, i), t.prototype.createEl.call(this, e, n, i) }, e.prototype.handleMouseDown = function (t) { var e = this.bar.el_.ownerDocument; t.preventDefault(), x(), this.addClass("vjs-sliding"), this.trigger("slideractive"), this.on(e, "mousemove", this.handleMouseMove), this.on(e, "mouseup", this.handleMouseUp), this.on(e, "touchmove", this.handleMouseMove), this.on(e, "touchend", this.handleMouseUp), this.handleMouseMove(t) }, e.prototype.handleMouseMove = function (t) { }, e.prototype.handleMouseUp = function () { var t = this.bar.el_.ownerDocument; j(), this.removeClass("vjs-sliding"), this.trigger("sliderinactive"), this.off(t, "mousemove", this.handleMouseMove), this.off(t, "mouseup", this.handleMouseUp), this.off(t, "touchmove", this.handleMouseMove), this.off(t, "t
function e(n) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; De(this, e); var i = Re(this, t.call(this, n, r)); return i.label_ = "subtitles", ["en", "en-us", "en-ca", "fr-ca"].indexOf(i.player_.language_) > -1 && (i.label_ = "captions"), i.menuButton_.controlText(J(i.label_)), i } return Le(e, t), e.prototype.buildCSSClass = function () { return "vjs-subs-caps-button " + t.prototype.buildCSSClass.call(this) }, e.prototype.buildWrapperCSSClass = function () { return "vjs-subs-caps-button " + t.prototype.buildWrapperCSSClass.call(this) }, e.prototype.createItems = function () { var e = []; return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || (e.push(new Ai(this.player_, { kind: this.label_ })), this.hideThreshold_ += 1), e = t.prototype.createItems.call(this, e, Ni) }, e
}(wi); Oi.prototype.kinds_ = ["captions", "subtitles"], Oi.prototype.controlText_ = "Subtitles", Tn.registerComponent("SubsCapsButton", Oi); var Mi = function (t) { function e(n, r) { De(this, e); var i = r.track, o = n.audioTracks(); r.label = i.label || i.language || "Unknown", r.selected = i.enabled; var s = Re(this, t.call(this, n, r)); s.track = i; var a = cn(s, s.handleTracksChange); return o.addEventListener("change", a), s.on("dispose", function () { o.removeEventListener("change", a) }), s } return Le(e, t), e.prototype.handleClick = function (e) { var n = this.player_.audioTracks(); t.prototype.handleClick.call(this, e); for (var r = 0; r < n.length; r++) { var i = n[r]; i.enabled = i === this.track } }, e.prototype.handleTracksChange = function (t) { this.selected(this.track.enabled) }, e }(Ti); Tn.registerComponent("AudioTrackMenuItem", Mi); var Ii = function (t) { function e(n) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return De(this, e), r.tracks = n.audioTracks(), Re(this, t.call(this, n, r)) } return Le(e, t), e.prototype.buildCSSClass = function () { return "vjs-audio-button " + t.prototype.buildCSSClass.call(this) }, e.prototype.buildWrapperCSSClass = function () { return "vjs-audio-button " + t.prototype.buildWrapperCSSClass.call(this) }, e.prototype.createItems = function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; this.hideThreshold_ = 1; for (var e = this.player_.audioTracks(), n = 0; n < e.length; n++) { var r = e[n]; t.push(new Mi(this.player_, { track: r, selectable: !0 })) } return t }, e }(bi); Ii.prototype.controlText_ = "Audio Track", Tn.registerComponent("AudioTrackButton", Ii); var Di = function (t) { function e(n, r) { De(this, e); var i = r.rate, o = parseFloat(i, 10); r.label = i, r.selected = 1 === o, r.selectable = !0; var s = Re(this, t.call(this, n, r)); return s.label = i, s.rate = o, s.on(n, "ratechange", s.update), s } return Le(e, t), e.prototype.handleClick = function (e) { t.prototype.handleClick.call(this), this.player().playbackRate(this.rate) }, e.prototype.update = function (t) { this.selected(this.player().playbackRate() === this.rate) }, e }(Ti); Di.prototype.contentElType = "button", Tn.registerComponent("PlaybackRateMenuItem", Di); var Li = function (t) { function e(n, r) { De(this, e); var i = Re(this, t.call(this, n, r)); return i.updateVisibility(), i.updateLabel(), i.on(n, "loadstart", i.updateVisibility), i.on(n, "ratechange", i.updateLabel), i } return Le(e, t), e.prototype.createEl = function () { var e = t.prototype.createEl.call(this); return this.labelEl_ = v("div", { className: "vjs-playback-rate-value", innerHTML: "1x" }), e.appendChild(this.labelEl_), e }, e.prototype.buildCSSClass = function () { return "vjs-playback-rate " + t.prototype.buildCSSClass.call(this) }, e.prototype.buildWrapperCSSClass = function () { return "vjs-playback-rate " + t.prototype.buildWrapperCSSClass.call(this) }, e.prototype.createMenu = function () { var t = new mi(this.player()), e = this.playbackRates(); if (e) for (var n = e.length - 1; n >= 0; n--)t.addChild(new Di(this.player(), { rate: e[n] + "x" })); return t }, e.prototype.updateARIAAttributes = function () { this.el().setAttribute("aria-valuenow", this.player().playbackRate()) }, e.prototype.handleClick = function (t) { for (var e = this.player().playbackRate(), n = this.playbackRates(), r = n[0], i = 0; i < n.length; i++)if (n[i] > e) { r = n[i]; break } this.player().playbackRate(r) }, e.prototype.playbackRates = function () { return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates }, e.prototype.playbackRateSupported = function () { return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0 }, e.prototype.updateVisibility = function (t) { this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden") }, e.prototype.updateLabel = function (t) { this.playbackRateSupported() && (this.labelE
function e(n, i, o) { if (De(this, e), n.id = n.id || "vjs_video_" + R(), i = r(e.getTagSettings(n), i), i.initChildren = !1, i.createEl = !1, i.reportTouchActivity = !1, !i.language) if ("function" == typeof n.closest) { var s = n.closest("[lang]"); s && (i.language = s.getAttribute("lang")) } else for (var a = n; a && 1 === a.nodeType;) { if (k(a).hasOwnProperty("lang")) { i.language = a.getAttribute("lang"); break } a = a.parentNode } var l = Re(this, t.call(this, null, i, o)); if (l.isReady_ = !1, !l.options_ || !l.options_.techOrder || !l.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 (l.tag = n, l.tagAttributes = n && k(n), l.language(l.options_.language), i.languages) { var c = {}; Object.getOwnPropertyNames(i.languages).forEach(function (t) { c[t.toLowerCase()] = i.languages[t] }), l.languages_ = c } else l.languages_ = e.prototype.options_.languages; l.cache_ = {}, l.poster_ = i.poster || "", l.controls_ = !!i.controls, l.cache_.lastVolume = 1, n.controls = !1, l.scrubbing_ = !1, l.el_ = l.createEl(), G(l, { eventBusKey: "el_" }); var u = Z(l.options_); if (i.plugins) { var h = i.plugins; Object.keys(h).forEach(function (t) { if ("function" != typeof this[t]) throw new Error('plugin "' + t + '" does not exist'); this[t](h[t]) }, l) } l.options_.playerOptions = u, l.middleware_ = [], l.initChildren(), l.isAudio("audio" === n.nodeName.toLowerCase()), l.controls() ? l.addClass("vjs-controls-enabled") : l.addClass("vjs-controls-disabled"), l.el_.setAttribute("role", "region"), l.isAudio() ? l.el_.setAttribute("aria-label", l.localize("Audio Player")) : l.el_.setAttribute("aria-label", l.localize("Video Player")), l.isAudio() && l.addClass("vjs-audio"), l.flexNotSupported_() && l.addClass("vjs-no-flex"), ge || l.addClass("vjs-workinghover"), e.players[l.id_] = l; var p = ne.split(".")[0]; return l.addClass("vjs-v" + p), l.userActive(!0), l.reportUserActivity(), l.listenForUserActivity_(), l.on("fullscreenchange", l.handleFullscreenChange_), l.on("stageclick", l.handleStageClick_), l.changingSrc_ = !1, l } return Le(e, t), e.prototype.dispose = function () { this.trigger("dispose"), this.off("dispose"), this.styleEl_ && this.styleEl_.parentNode && this.styleEl_.parentNode.removeChild(this.styleEl_), e.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(), t.prototype.dispose.call(this) }, e.prototype.createEl = function () { var e = this.tag, n = void 0, r = this.playerElIngest_ = e.parentNode && e.parentNode.hasAttribute && e.parentNode.hasAttribute("data-vjs-player"); n = this.el_ = r ? e.parentNode : t.prototype.createEl.call(this, "div"), e.setAttribute("tabindex", "-1"), e.removeAttribute("width"), e.removeAttribute("height"); var i = k(e); if (Object.getOwnPropertyNames(i).forEach(function (t) { "class" === t ? n.className += " " + i[t] : n.setAttribute(t, i[t]) }), e.playerId = e.id, e.id += "_html5_api", e.className = "vjs-tech", e.player = n.player = this, this.addClass("vjs-paused"), !0 !== oe.VIDEOJS_NO_DYNAMIC_STYLE) { this.styleEl_ = an("vjs-styles-dimensions"); var o = Ye(".vjs-styles-defaults"), s = Ye("head"); s.insertBefore(this.styleEl_, o ? o.nextSibling : s.firstChild) } this.width(this.options_.width), this.height(this.options_.height), this.fluid(this.options_.fluid), this.aspectRatio(this.options_.aspectRatio); for (var a = e.getElementsByTagName("a"), l = 0; l < a.length; l++) { var c = a.item(l); _(c, "vjs-hidden"), c.setAttribute("hidden", "hidden") } return e.initNetworkState_ = e.networkState, e.parentNode && !r && e.parentNode.insertBefore(n, e), g(e, n), this.children_.unshift(e), this.el_.setAttribute("lang", this.language_), this.el_ = n, n }, e.prototype.width = function (t) { return this.dimension("width", t) }, e.prototype.height = function (t) { return this.dimension("height", t) }, e.prototype.dimension = function (t, e) { var n = t
var n = this; this.tech_ && this.unloadTech_(); var i = J(t), o = t.charAt(0).toLowerCase() + t.slice(1); "Html5" !== i && this.tag && (Rr.getTech("Html5").disposeMediaElement(this.tag), this.tag.player = null, this.tag = null), this.techName_ = i, this.isReady_ = !1; var s = { source: e, nativeControlsForTouch: this.options_.nativeControlsForTouch, playerId: this.id(), techId: this.id() + "_" + i + "_api", autoplay: this.options_.autoplay, playsinline: this.options_.playsinline, preload: this.options_.preload, loop: this.options_.loop, muted: this.options_.muted, poster: this.poster(), language: this.language(), playerElIngest: this.playerElIngest_ || !1, "vtt.js": this.options_["vtt.js"] }; Cr.names.forEach(function (t) { var e = Cr[t]; s[e.getterName] = n[e.privateName] }), r(s, this.options_[i]), r(s, this.options_[o]), r(s, this.options_[t.toLowerCase()]), this.tag && (s.tag = this.tag), e && e.src === this.cache_.src && this.cache_.currentTime > 0 && (s.startTime = this.cache_.currentTime); var a = Rr.getTech(t); 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(cn(this, this.handleTechReady_), !0), Mn.jsonToTextTracks(this.textTracksJson_ || [], this.tech_), ao.forEach(function (t) { n.on(n.tech_, t, n["handleTech" + J(t) + "_"]) }), this.on(this.tech_, "loadstart", this.handleTechLoadStart_), this.on(this.tech_, "waiting", this.handleTechWaiting_), this.on(this.tech_, "canplay", this.handleTechCanPlay_), this.on(this.tech_, "canplaythrough", this.handleTechCanPlayThrough_),
this.on(this.tech_, "playing", this.handleTechPlaying_), this.on(this.tech_, "ended", this.handleTechEnded_), this.on(this.tech_, "seeking", this.handleTechSeeking_), this.on(this.tech_, "seeked", this.handleTechSeeked_), this.on(this.tech_, "play", this.handleTechPlay_), this.on(this.tech_, "firstplay", this.handleTechFirstPlay_), this.on(this.tech_, "pause", this.handleTechPause_), this.on(this.tech_, "durationchange", this.handleTechDurationChange_), this.on(this.tech_, "fullscreenchange", this.handleTechFullscreenChange_), this.on(this.tech_, "error", this.handleTechError_), this.on(this.tech_, "loadedmetadata", this.updateStyleEl_), this.on(this.tech_, "posterchange", this.handleTechPosterChange_), this.on(this.tech_, "textdata", this.handleTechTextData_), this.usingNativeControls(this.techGet_("controls")), this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(), this.tech_.el().parentNode === this.el() || "Html5" === i && this.tag || g(this.tech_.el(), this.el()), this.tag && (this.tag.player = null, this.tag = null)
}, e.prototype.unloadTech_ = function () { var t = this; Cr.names.forEach(function (e) { var n = Cr[e]; t[n.privateName] = t[n.getterName]() }), this.textTracksJson_ = Mn.textTracksToJson(this.tech_), this.isReady_ = !1, this.tech_.dispose(), this.tech_ = !1 }, e.prototype.tech = function (t) { return void 0 === t && Xe.warn(qe(so)), this.tech_ }, e.prototype.addTechControlsListeners_ = function () { this.removeTechControlsListeners_(), this.on(this.tech_, "mousedown", this.handleTechClick_), this.on(this.tech_, "touchstart", this.handleTechTouchStart_), this.on(this.tech_, "touchmove", this.handleTechTouchMove_), this.on(this.tech_, "touchend", this.handleTechTouchEnd_), this.on(this.tech_, "tap", this.handleTechTap_) }, e.prototype.removeTechControlsListeners_ = function () { this.off(this.tech_, "tap", this.handleTechTap_), this.off(this.tech_, "touchstart", this.handleTechTouchStart_), this.off(this.tech_, "touchmove", this.handleTechTouchMove_), this.off(this.tech_, "touchend", this.handleTechTouchEnd_), this.off(this.tech_, "mousedown", this.handleTechClick_) }, e.prototype.handleTechReady_ = function () { if (this.triggerReady(), this.cache_.volume && this.techCall_("setVolume", this.cache_.volume), this.handleTechPosterChange_(), this.handleTechDurationChange_(), (this.src() || this.currentSrc()) && this.tag && this.options_.autoplay && this.paused()) try { delete this.tag.poster } catch (t) { Xe("deleting tag.poster throws in some browsers", t) } }, e.prototype.handleTechLoadStart_ = function () { this.removeClass("vjs-ended"), this.removeClass("vjs-seeking"), this.error(null), this.paused() ? (this.hasStarted(!1), this.trigger("loadstart")) : (this.trigger("loadstart"), this.trigger("firstplay")) }, e.prototype.hasStarted = function (t) { return void 0 !== t ? void (this.hasStarted_ !== t && (this.hasStarted_ = t, t ? (this.addClass("vjs-has-started"), this.trigger("firstplay")) : this.removeClass("vjs-has-started"))) : !!this.hasStarted_ }, e.prototype.handleTechPlay_ = function () { this.removeClass("vjs-ended"), this.removeClass("vjs-paused"), this.addClass("vjs-playing"), this.hasStarted(!0), this.trigger("play") }, e.prototype.handleTechWaiting_ = function () { var t = this; this.addClass("vjs-waiting"), this.trigger("waiting"), this.one("timeupdate", function () { return t.removeClass("vjs-waiting") }) }, e.prototype.handleTechCanPlay_ = function () { this.removeClass("vjs-waiting"), this.trigger("canplay") }, e.prototype.handleTechCanPlayThrough_ = function () { this.removeClass("vjs-waiting"), this.trigger("canplaythrough") }, e.prototype.handleTechPlaying_ = function () { this.removeClass("vjs-waiting"), this.trigger("playing") }, e.prototype.handleTechSeeking_ = function () { this.addClass("vjs-seeking"), this.trigger("seeking") }, e.prototype.handleTechSeeked_ = function () { this.removeClass("vjs-seeking"), this.trigger("seeked") }, e.prototype.handleTechFirstPlay_ = function () { this.options_.starttime && (Xe.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.prototype.handleTechPause_ = function () { this.removeClass("vjs-playing"), this.addClass("vjs-paused"), this.trigger("pause") }, e.prototype.handleTechEnded_ = function () { this.addClass("vjs-ended"), this.options_.loop ? (this.currentTime(0), this.play()) : this.paused() || this.pause(), this.trigger("ended") }, e.prototype.handleTechDurationChange_ = function () { this.duration(this.techGet_("duration")) }, e.prototype.handleTechClick_ = function (t) { 0 === t.button && this.controls() && (this.paused() ? this.play() : this.pause()) }, e.prototype.handleTechTap_ = function () { this.userActive(!this.userActive()) }, e.prototype.handleTechTouchStart_ = function () { this.userWasActive = this.userActive() }, e.prototype.handleTechTouchMove_ = function () { this.userWasActive && this.reportUserActivity() }, e.prototype.handleTechTouchEnd_ = function (t) { t.preventDefault() }, e.prototype.handleFu
}(Tn); Cr.names.forEach(function (t) { var e = Cr[t]; lo.prototype[e.getterName] = function () { return this.tech_ ? this.tech_[e.getterName]() : (this[e.privateName] = this[e.privateName] || new e.ListClass, this[e.privateName]) } }), lo.players = {}; var co = oe.navigator; lo.prototype.options_ = { techOrder: Rr.defaultTechOrder_, html5: {}, flash: {}, inactivityTimeout: 2e3, playbackRates: [], children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "controlBar", "errorDisplay", "textTrackSettings"], language: co && (co.languages && co.languages[0] || co.userLanguage || co.language) || "en", languages: {}, notSupportedMessage: "No compatible source was found for this media." }, ["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function (t) { lo.prototype[t] = function () { return this.techGet_(t) } }), ao.forEach(function (t) { lo.prototype["handleTech" + J(t) + "_"] = function () { return this.trigger(t) } }), Tn.registerComponent("Player", lo); var uo = {}, ho = function (t) { return uo.hasOwnProperty(t) }, po = function (t) { return ho(t) ? uo[t] : void 0 }, fo = function (t, e) { t.activePlugins_ = t.activePlugins_ || {}, t.activePlugins_[e] = !0 }, vo = function (t, e, n) { var r = (n ? "before" : "") + "pluginsetup"; t.trigger(r, e), t.trigger(r + ":" + e.name, e) }, yo = function (t, e) { var n = function () { vo(this, { name: t, plugin: e, instance: null }, !0); var n = e.apply(this, arguments); return fo(this, t), vo(this, { name: t, plugin: e, instance: n }), n }; return Object.keys(e).forEach(function (t) { n[t] = e[t] }), n }, go = function (t, e) { return e.prototype.name = t, function () { vo(this, { name: t, plugin: e, instance: null }, !0); for (var n = arguments.length, r = Array(n), i = 0; i < n; i++)r[i] = arguments[i]; var o = new (Function.prototype.bind.apply(e, [null].concat([this].concat(r)))); return this[t] = function () { return o }, vo(this, o.getEventHash()), o } }, mo = function () { function t(e) { if (De(this, t), this.constructor === t) throw new Error("Plugin must be sub-classed; not directly instantiated."); this.player = e, G(this), delete this.trigger, $(this, this.constructor.defaultState), fo(e, this.name), this.dispose = cn(this, this.dispose), e.on("dispose", this.dispose) } return t.prototype.getEventHash = function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return t.name = this.name, t.plugin = this.constructor, t.instance = this, t }, t.prototype.trigger = function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return q(this.eventBusEl_, t, this.getEventHash(e)) }, t.prototype.handleStateChanged = function (t) { }, t.prototype.dispose = function () { var t = this.name, e = this.player; this.trigger("dispose"), this.off(), e.off("dispose", this.dispose), e.activePlugins_[t] = !1, this.player = this.state = null, e[t] = go(t, uo[t]) }, t.isBasic = function (e) { var n = "string" == typeof e ? po(e) : e; return "function" == typeof n && !t.prototype.isPrototypeOf(n.prototype) }, t.registerPlugin = function (e, n) { if ("string" != typeof e) throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + (void 0 === e ? "undefined" : Ie(e)) + "."); if (ho(e)) Xe.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!'); else if (lo.prototype.hasOwnProperty(e)) throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!'); if ("function" != typeof n) throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + (void 0 === n ? "undefined" : Ie(n)) + "."); return uo[e] = n, "plugin" !== e && (t.isBasic(n) ? lo.prototype[e] = yo(e, n) : lo.prototype[e] = go(e, n)), n }, t.deregisterPlugin = function (t) { if ("plugin" === t) throw new Error("Cannot de-register base plugin."); ho(t) && (delete uo[t], delete lo.prototype[t]) }, t.getPlugins = function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Object.key
});