layui.define(function (exports) {
var Player = function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var a = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(a.exports, a, a.exports, n), a.l = !0, a.exports
}
return n.m = e, n.c = t, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: r})
}, n.r = function (e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
}, n.t = function (e, t) {
if (1 & t && (e = n(e)), 8 & t) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var r = Object.create(null);
if (n.r(r), Object.defineProperty(r, "default", {
enumerable: !0,
value: e
}), 2 & t && "string" != typeof e) for (var a in e) n.d(r, a, function (t) {
return e[t]
}.bind(null, a));
return r
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 7)
}([function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = f(n(9)), i = f(n(2)), o = f(n(26)), l = f(n(5)), s = f(n(3)), u = f(n(27)), c = n(32), p = f(n(33)),
d = n(4);
function f(e) {
return e && e.__esModule ? e : {default: e}
}
function g(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
var h = function (e) {
function t(e) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t);
var n = g(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
if (n.config = i.default.deepCopy({
width: 600,
height: 337.5,
ignores: [],
whitelist: [],
lang: (document.documentElement.getAttribute("lang") || navigator.language || "zh-cn").toLocaleLowerCase(),
inactive: 3e3,
volume: .6,
controls: !0,
controlsList: ["nodownload"]
}, e), n.version = d.version, n.userTimer = null, n.waitTimer = null, n.database = new o.default, n.history = [], n.isProgressMoving = !1, n.root = i.default.findDom(document, "#" + n.config.id), n.controls = i.default.createDom("xg-controls", "", {
unselectable: "on",
onselectstart: "return false"
}, "xgplayer-controls"), !n.root) {
var r = n.config.el;
if (!r || 1 !== r.nodeType) return n.emit("error", new s.default("use", n.config.vid, {
line: 32,
handle: "Constructor",
msg: "container id can't be empty"
})), !1, g(n, !1);
n.root = r
}
if (i.default.addClass(n.root, "xgplayer xgplayer-" + l.default.device + " xgplayer-nostart " + (n.config.controls ? "" : "no-controls")), n.root.appendChild(n.controls), n.config.fluid ? (n.root.style["max-width"] = "100%", n.root.style.width = "100%", n.root.style.height = "0", n.root.style["padding-top"] = 100 * n.config.height / n.config.width + "%", n.video.style.position = "absolute", n.video.style.top = "0", n.video.style.left = "0") : (n.config.width && ("number" != typeof n.config.width ? n.root.style.width = n.config.width : n.root.style.width = n.config.width + "px"), n.config.height && ("number" != typeof n.config.height ? n.root.style.height = n.config.height : n.root.style.height = n.config.height + "px")), n.config.execBeforePluginsCall && n.config.execBeforePluginsCall.forEach(function (e) {
e.call(n, n)
}), n.config.controlStyle && "String" === i.default.typeOf(n.config.controlStyle)) {
var a = n;
fetch(a.config.controlStyle, {
method: "GET",
headers: {Accept: "application/json"}
}).then(function (e) {
e.ok && e.json().then(function (e) {
for (var t in e) e.hasOwnProperty(t) && (a.config[t] = e[t]);
a.pluginsCall()
})
}).catch(function (e) {
console.log("Fetch错误:" + e)
})
} else n.pluginsCall();
n.ev.forEach(function (e) {
var t = Object.keys(e)[0], r = n[e[t]];
r && n.on(t, r)
}), ["focus", "blur"].forEach(function (e) {
n.on(e, n["on" + e.charAt(0).toUpperCase() + e.slice(1)])
});
var u = n;
return n.mousemoveFunc = function () {
u.emit("focus"), u.config.closeFocusVideoFocus || u.video.focus()
}, n.root.addEventListener("mousemove", n.mousemoveFunc), n.playFunc = function () {
u.emit("focus"), u.config.closePlayVideoFocus || u.video.focus()
}, u.once("play", n.playFunc), setTimeout(function () {
n.emit("ready")
}, 0), n.config.keyShortcut && "on" !== n.config.keyShortcut || ["video", "controls"].forEach(function (e) {
u[e].addEventListener("keydown", function (e) {
u.onKeydown(e, u)
})
}), n.config.videoInit && i.default.hasClass(n.root, "xgplayer-nostart") && n.start(), u.config.rotate && (u.on("requestFullscreen", n.updateRotateDeg), u.on("exitFullscreen", n.updateRotateDeg)), u.once("destroy", function e() {
u.root.removeEventListener("mousemove", u.mousemoveFunc), u.off("destroy", e)
}), n
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, a.default), r(t, [{
key: "start", value: function () {
var e = this, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.config.url,
r = this.root, a = this;
n && "" !== n || this.emit("urlNull"), this.logParams.playSrc = n, this.canPlayFunc = function () {
var e = a.video.play();
void 0 !== e && e && e.then(function () {
a.emit("autoplay started")
}).catch(function () {
a.emit("autoplay was prevented"), t.util.addClass(a.root, "xgplayer-is-autoplay")
}), a.off("canplay", a.canPlayFunc)
}, "String" === i.default.typeOf(n) ? this.video.src = n : n.forEach(function (t) {
e.video.appendChild(i.default.createDom("source", "", {
src: "" + t.src,
type: "" + (t.type || "")
}))
}), this.logParams.pt = (new Date).getTime(), this.logParams.vt = this.logParams.pt, this.loadeddataFunc = function () {
a.logParams.vt = (new Date).getTime(), a.logParams.pt > a.logParams.vt && (a.logParams.pt = a.logParams.vt), a.logParams.vd = a.video.duration
}, this.once("loadeddata", this.loadeddataFunc), this.config.autoplay && this.on("canplay", this.canPlayFunc), r.insertBefore(this.video, r.firstChild), setTimeout(function () {
e.emit("complete")
}, 1)
}
}, {
key: "reload", value: function () {
this.video.load(), this.reloadFunc = function () {
this.play()
}, this.once("loadeddata", this.reloadFunc)
}
}, {
key: "destroy", value: function () {
var e = this, n = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], r = this;
this.root.parentNode;
for (var a in clearInterval(this.bulletResizeTimer), this._interval) clearInterval(this._interval[a]), this._interval[a] = null;
function i() {
for (var e in this.emit("destroy"), this.video.removeAttribute("src"), this.video.load(), n && (this.root.innerHTML = "", this.root.className = ""), this) delete this[e];
this.off("pause", i)
}
this.ev.forEach(function (t) {
var n = Object.keys(t)[0], r = e[t[n]];
r && e.off(n, r)
}), this.loadeddataFunc && this.off("loadeddata", this.loadeddataFunc), this.reloadFunc && this.off("loadeddata", this.reloadFunc), this.replayFunc && this.off("play", this.replayFunc), this.playFunc && this.off("play", this.playFunc), ["focus", "blur"].forEach(function (t) {
e.off(t, e["on" + t.charAt(0).toUpperCase() + t.slice(1)])
}), this.config.keyShortcut && "on" !== this.config.keyShortcut || ["video", "controls"].forEach(function (t) {
e[t] && e[t].removeEventListener("keydown", function (e) {
r.onKeydown(e, r)
})
}), this.paused ? i.call(this) : (this.pause(), this.once("pause", i)), function e(t, n, r) {
null === t && (t = Function.prototype);
var a = Object.getOwnPropertyDescriptor(t, n);
if (void 0 === a) {
var i = Object.getPrototypeOf(t);
return null === i ? void 0 : e(i, n, r)
}
if ("value" in a) return a.value;
var o = a.get;
return void 0 !== o ? o.call(r) : void 0
}(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "destroy", this).call(this)
}
}, {
key: "replay", value: function () {
var e = this, t = this._replay;
i.default.removeClass(this.root, "xgplayer-ended"), this.logParams = {
bc: 0,
bu_acu_t: 0,
played: [],
pt: (new Date).getTime(),
vt: (new Date).getTime(),
vd: 0
}, this.logParams.pt = (new Date).getTime(), this.logParams.vt = this.logParams.pt, this.replayFunc = function () {
e.logParams.vt = (new Date).getTime(), e.logParams.pt > e.logParams.vt && (e.logParams.pt = e.logParams.vt), e.logParams.vd = e.video.duration
}, this.once("play", this.replayFunc), this.logParams.playSrc = this.video.currentSrc, t && t instanceof Function ? t() : (this.currentTime = 0, this.play())
}
}, {
key: "getFullscreen", value: function (e) {
e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : player.video.webkitSupportsFullscreen ? player.video.webkitEnterFullscreen() : e.msRequestFullscreen ? e.msRequestFullscreen() : i.default.addClass(e, "xgplayer-is-cssfullscreen")
}
}, {
key: "exitFullscreen", value: function (e) {
document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), i.default.removeClass(e, "xgplayer-is-cssfullscreen")
}
}, {
key: "download", value: function () {
var e = (0, c.getAbsoluteURL)(player.config.url);
console.log(e), (0, p.default)(e)
}
}, {
key: "pluginsCall", value: function () {
var e = this, n = this;
if (t.plugins) {
var r = this.config.ignores;
Object.keys(t.plugins).forEach(function (a) {
var i = t.plugins[a];
r.some(function (e) {
return a === e || a === "s_" + e
}) || (["pc", "tablet", "mobile"].some(function (e) {
return e === a
}) ? a === l.default.device && setTimeout(function () {
i.call(n, n)
}, 0) : i.call(e, e))
})
}
}
}, {
key: "getPIP", value: function () {
var e = i.default.createDom("xg-pip-lay", "
", {}, "xgplayer-pip-lay");
this.root.appendChild(e);
var t = i.default.createDom("xg-pip-drag", '点击按住可拖动视频
', {tabindex: 9}, "xgplayer-pip-drag");
this.root.appendChild(t);
new u.default(".xgplayer", {handle: ".drag-handle"});
i.default.addClass(this.root, "xgplayer-pip-active"), this.root.style.right = 0, this.root.style.bottom = "200px", this.root.style.top = "", this.root.style.left = "", this.root.style.width = "320px", this.root.style.height = "180px", this.config.pipConfig && (void 0 !== this.config.pipConfig.top && (this.root.style.top = this.config.pipConfig.top + "px", this.root.style.bottom = ""), void 0 !== this.config.pipConfig.bottom && (this.root.style.bottom = this.config.pipConfig.bottom + "px"), void 0 !== this.config.pipConfig.left && (this.root.style.left = this.config.pipConfig.left + "px", this.root.style.right = ""), void 0 !== this.config.pipConfig.right && (this.root.style.right = this.config.pipConfig.right + "px"), void 0 !== this.config.pipConfig.width && (this.root.style.width = this.config.pipConfig.width + "px"), void 0 !== this.config.pipConfig.height && (this.root.style.height = this.config.pipConfig.height + "px")), this.config.fluid && (this.root.style["padding-top"] = "");
var n = this;
["click", "touchend"].forEach(function (t) {
e.addEventListener(t, function (e) {
e.preventDefault(), e.stopPropagation(), n.exitPIP()
})
})
}
}, {
key: "exitPIP", value: function () {
i.default.removeClass(this.root, "xgplayer-pip-active"), this.root.style.right = "", this.root.style.bottom = "", this.root.style.top = "", this.root.style.left = "", this.config.fluid ? (this.root.style.width = "100%", this.root.style.height = "0", this.root.style["padding-top"] = 100 * this.config.height / this.config.width + "%") : (this.config.width && ("number" != typeof this.config.width ? this.root.style.width = this.config.width : this.root.style.width = this.config.width + "px"), this.config.height && ("number" != typeof this.config.height ? this.root.style.height = this.config.height : this.root.style.height = this.config.height + "px"));
var e = i.default.findDom(this.root, ".xgplayer-pip-lay");
e && e.parentNode && e.parentNode.removeChild(e);
var t = i.default.findDom(this.root, ".xgplayer-pip-drag");
t && t.parentNode && t.parentNode.removeChild(t)
}
}, {
key: "updateRotateDeg", value: function () {
player.rotateDeg || (player.rotateDeg = 0);
var e = player.root.offsetWidth, t = player.root.offsetHeight, n = player.video.videoWidth,
r = player.video.videoHeight;
player.config.rotate.innerRotate || (player.root.style.width = t + "px", player.root.style.height = e + "px");
var a = void 0;
if (.25 === player.rotateDeg || .75 === player.rotateDeg) {
if (player.config.rotate.innerRotate) if (n / r > t / e) {
a = (r / n > t / e ? t * n / r : e) > t ? t > e ? e / t : t / e : t > e ? t / e : e / t
} else {
a = (r / n > t / e ? t : e * r / n) > e ? t > e ? e / t : t / e : t > e ? t / e : e / t
} else a = e >= t ? (e / t).toFixed(2) : (t / e).toFixed(2);
a = parseFloat(a.toFixed(5))
} else a = 1;
player.video.style.transformOrigin = "center center", player.video.style.transform = "rotate(" + player.rotateDeg + "turn) scale(" + a + ")", player.video.style.webKitTransform = "rotate(" + player.rotateDeg + "turn) scale(" + a + ")"
}
}, {
key: "rotate", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
t = (!(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1);
player.rotateDeg || (player.rotateDeg = 0);
var n = e ? 1 : -1;
player.rotateDeg = (player.rotateDeg + 1 + .25 * n * t) % 1, this.updateRotateDeg(), player.emit("rotate", 360 * player.rotateDeg)
}
}, {
key: "onFocus", value: function () {
var e = this;
i.default.removeClass(this.root, "xgplayer-inactive"), e.userTimer && clearTimeout(e.userTimer), e.userTimer = setTimeout(function () {
e.emit("blur")
}, e.config.inactive)
}
}, {
key: "onBlur", value: function () {
this.paused || this.ended || i.default.addClass(this.root, "xgplayer-inactive")
}
}, {
key: "onPlay", value: function () {
i.default.addClass(this.root, "xgplayer-playing"), i.default.removeClass(this.root, "xgplayer-pause")
}
}, {
key: "onPause", value: function () {
i.default.addClass(this.root, "xgplayer-pause"), this.userTimer && clearTimeout(this.userTimer), this.emit("focus")
}
}, {
key: "onEnded", value: function () {
i.default.addClass(this.root, "xgplayer-ended"), i.default.removeClass(this.root, "xgplayer-playing")
}
}, {
key: "onSeeking", value: function () {
}
}, {
key: "onSeeked", value: function () {
this.waitTimer && clearTimeout(this.waitTimer), i.default.removeClass(this.root, "xgplayer-isloading")
}
}, {
key: "onWaiting", value: function () {
var e = this;
e.waitTimer && clearTimeout(e.waitTimer), e.waitTimer = setTimeout(function () {
i.default.addClass(e.root, "xgplayer-isloading")
}, 500)
}
}, {
key: "onPlaying", value: function () {
this.waitTimer && clearTimeout(this.waitTimer), i.default.removeClass(this.root, "xgplayer-isloading xgplayer-nostart xgplayer-pause xgplayer-ended xgplayer-is-error xgplayer-replay"), i.default.addClass(this.root, "xgplayer-playing")
}
}, {
key: "onKeydown", value: function (e, t) {
var n = e || window.event;
if (!n || 37 !== n.keyCode && 38 !== n.keyCode && 39 !== n.keyCode && 40 !== n.keyCode && 32 !== n.keyCode || t.emit("focus"), !n || 40 !== n.keyCode && 38 !== n.keyCode) n && 39 === n.keyCode ? t.currentTime + 10 <= t.duration ? t.currentTime += 10 : t.currentTime = t.duration - 1 : n && 37 === n.keyCode ? t.currentTime - 10 >= 0 ? t.currentTime -= 10 : t.currentTime = 0 : n && 32 === n.keyCode && (t.paused ? t.play() : t.pause()); else {
if (t.controls) {
var r = t.controls.querySelector(".xgplayer-slider");
r && (i.default.hasClass(r, "xgplayer-none") && i.default.removeClass(r, "xgplayer-none"), t.sliderTimer && clearTimeout(t.sliderTimer), t.sliderTimer = setTimeout(function () {
i.default.addClass(r, "xgplayer-none")
}, t.config.inactive))
}
n && 40 === n.keyCode ? t.volume - .1 >= 0 ? t.volume -= .1 : t.volume = 0 : n && 38 === n.keyCode && (t.volume + .1 <= 1 ? t.volume += .1 : t.volume = 1)
}
}
}], [{
key: "install", value: function (e, n) {
t.plugins || (t.plugins = {}), t.plugins[e] || (t.plugins[e] = n)
}
}, {
key: "use", value: function (e, n) {
t.plugins || (t.plugins = {}), t.plugins[e] = n
}
}]), t
}();
h.util = i.default, h.sniffer = l.default, h.Errors = s.default, t.default = h, e.exports = t.default
}, function (e, t, n) {
"use strict";
var r = n(18)();
e.exports = function (e) {
return e !== r && null !== e
}
}, function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {value: !0});
var util = {
createDom: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div",
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "",
a = document.createElement(e);
return a.className = r, a.innerHTML = t, Object.keys(n).forEach(function (t) {
var r = t, i = n[t];
"video" === e || "audio" === e ? i && a.setAttribute(r, i) : a.setAttribute(r, i)
}), a
}, hasClass: function (e, t) {
return e.classList ? Array.prototype.some.call(e.classList, function (e) {
return e === t
}) : !!e.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"))
}, addClass: function (e, t) {
e.classList ? t.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function (t) {
t && e.classList.add(t)
}) : util.hasClass(e, t) || (e.className += " " + t)
}, removeClass: function (e, t) {
e.classList ? t.split(/\s+/g).forEach(function (t) {
e.classList.remove(t)
}) : util.hasClass(e, t) && t.split(/\s+/g).forEach(function (t) {
var n = new RegExp("(\\s|^)" + t + "(\\s|$)");
e.className = e.className.replace(n, " ")
})
}, toggleClass: function (e, t) {
t.split(/\s+/g).forEach(function (t) {
util.hasClass(e, t) ? util.removeClass(e, t) : util.addClass(e, t)
})
}, findDom: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document, t = arguments[1],
n = void 0;
try {
n = e.querySelector(t)
} catch (r) {
t.startsWith("#") && (n = e.getElementById(t.slice(1)))
}
return n
}, padStart: function (e, t, n) {
for (var r = String(n), a = t >> 0, i = Math.ceil(a / r.length), o = [], l = String(e); i--;) o.push(r);
return o.join("").substring(0, a - l.length) + l
}, format: function (e) {
if (window.isNaN(e)) return "";
var t = util.padStart(Math.floor(e / 3600), 2, 0),
n = util.padStart(Math.floor((e - 3600 * t) / 60), 2, 0),
r = util.padStart(Math.floor(e - 3600 * t - 60 * n), 2, 0);
return ("00" === t ? [n, r] : [t, n, r]).join(":")
}, event: function (e) {
if (e.touches) {
var t = e.touches[0] || e.changedTouches[0];
e.clientX = t.clientX || 0, e.clientY = t.clientY || 0, e.offsetX = t.pageX - t.target.offsetLeft, e.offsetY = t.pageY - t.target.offsetTop
}
e._target = e.target || e.srcElement
}, typeOf: function (e) {
return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]
}, deepCopy: function (e, t) {
if ("Object" === util.typeOf(t) && "Object" === util.typeOf(e)) return Object.keys(t).forEach(function (n) {
"Object" !== util.typeOf(t[n]) || t[n] instanceof Node ? "Array" === util.typeOf(t[n]) ? e[n] = "Array" === util.typeOf(e[n]) ? e[n].concat(t[n]) : t[n] : e[n] = t[n] : e[n] ? util.deepCopy(e[n], t[n]) : e[n] = t[n]
}), e
}, getBgImage: function (e) {
var t = (e.currentStyle || window.getComputedStyle(e, null)).backgroundImage;
if (!t || "none" === t) return "";
var n = document.createElement("a");
return n.href = t.replace(/url\("|"\)/g, ""), n.href
}, copyDom: function (e) {
if (e && 1 === e.nodeType) {
var t = document.createElement(e.tagName);
return Array.prototype.forEach.call(e.attributes, function (e) {
t.setAttribute(e.name, e.value)
}), e.innerHTML && (t.innerHTML = e.innerHTML), t
}
return ""
}, setInterval: function (e, t, n, r) {
e._interval[t] || (e._interval[t] = setInterval(n.bind(e), r))
}, clearInterval: function (e, t) {
clearInterval(e._interval[t]), e._interval[t] = null
}, createImgBtn: function (e, t, n, r) {
var a = util.createDom("xg-" + e, "", {}, "xgplayer-" + e + "-img");
if (a.style.backgroundImage = 'url("' + t + '")', n && r) {
var i = void 0, o = void 0, l = void 0;
["px", "rem", "em", "pt", "dp", "vw", "vh", "vm", "%"].every(function (e) {
return !(n.indexOf(e) > -1 && r.indexOf(e) > -1) || (i = parseFloat(n.slice(0, n.indexOf(e)).trim()), o = parseFloat(r.slice(0, r.indexOf(e)).trim()), l = e, !1)
}), a.style.width = "" + i + l, a.style.height = "" + o + l, a.style.backgroundSize = "" + i + l + " " + o + l, a.style.margin = "start" === e ? "-" + o / 2 + l + " auto auto -" + i / 2 + l : "auto 5px auto 5px"
}
return a
}, Hex2RGBA: function (hex, alpha) {
var rgb = [];
if (/^\#[0-9A-F]{3}$/i.test(hex)) {
var sixHex = "#";
hex.replace(/[0-9A-F]/gi, function (e) {
sixHex += e + e
}), hex = sixHex
}
return /^#[0-9A-F]{6}$/i.test(hex) ? (hex.replace(/[0-9A-F]{2}/gi, function (kw) {
rgb.push(eval("0x" + kw))
}), "rgba(" + rgb.join(",") + ", " + alpha + ")") : "rgba(255, 255, 255, 0.1)"
}
};
exports.default = util, module.exports = exports.default
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = n(4);
var a = {
network: {code: 1, msg: "视频下载错误", remark: "只要视频下载错误就使用此类型,无论是video本身的超时还是xhr的分段请求超时或者资源不存在"},
mse: {code: 2, msg: "流追加错误", remark: "追加流的时候如果类型不对、无法被正确解码则会触发此类错误"},
parse: {code: 3, msg: "解析错误", remark: "mp4、hls、flv我们都是使用js进行格式解析,如果解析失败则会触发此类错误"},
format: {code: 4, msg: "格式错误", remark: "如果浏览器不支持的格式导致播放错误"},
decoder: {code: 5, msg: "解码错误", remark: "浏览器解码异常会抛出此类型错误"},
runtime: {code: 6, msg: "语法错误", remark: "播放器语法错误"},
timeout: {code: 7, msg: "播放超时", remark: "播放过程中无法正常请求下一个分段导致播放中断"},
other: {code: 8, msg: "其他错误", remark: "不可知的错误或被忽略的错误类型"}
};
t.default = function e(t, n, i, o, l, s, u, c) {
var p = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : {
line: "",
handle: "",
msg: "",
version: ""
};
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e);
var d = {};
return d.playerVersion = r.version, d.errorType = t, d.domain = document.domain, d.duration = i, d.currentTime = n, d.networkState = o, d.readyState = l, d.currentSrc = u, d.src = s, d.ended = c, d.errd = p, d.ex = (a[t] || {}).msg, d
}, e.exports = t.default
}, function (e) {
e.exports = {
name: "xgplayer",
version: "2.1.2",
description: "video player",
main: "./dist/index.js",
bin: {xgplayer: "bin/xgplayer.js"},
scripts: {
prepare: "npm run build",
build: "webpack --progress --display-chunks -p",
watch: "webpack --progress --display-chunks -p --watch --mode development"
},
keywords: ["video", "player"],
babel: {presets: ["es2015"], plugins: ["add-module-exports", "babel-plugin-bulk-import"]},
repository: {type: "git", url: "git+https://github.com/bytedance/xgplayer.git"},
author: "yinguohui@bytedance.com",
license: "MIT",
dependencies: {
chalk: "^2.3.2",
commander: "^2.15.1",
"danmu.js": "0.1.0",
deepmerge: "^1.5.0",
downloadjs: "1.4.7",
draggabilly: "^2.2.0",
"event-emitter": "^0.3.5",
"fs-extra": "^5.0.0",
pasition: "^1.0.1",
"request-frame": "^1.5.3"
},
browserslist: ["> 5%", "IE 9", "iOS 7", "Firefox > 20"],
devDependencies: {
autoprefixer: "^9.1.5",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-bulk-import": "^1.0.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
chai: "^4.1.2",
"core-js": "^2.5.4",
"css-loader": "^0.28.11",
"json-loader": "^0.5.7",
"node-sass": "^4.8.3",
"postcss-cssnext": "^3.1.0",
"postcss-loader": "^2.1.5",
"raw-loader": "^2.0.0",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
sugarss: "^1.0.1",
webpack: "^4.11.0",
"webpack-cli": "^3.0.2",
zlib: "^1.0.5"
}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = {
get device() {
return r.os.isPc ? "pc" : "mobile"
}, get browser() {
var e = navigator.userAgent.toLowerCase(), t = {
ie: /rv:([\d.]+)\) like gecko/,
firfox: /firefox\/([\d.]+)/,
chrome: /chrome\/([\d.]+)/,
opera: /opera.([\d.]+)/,
safari: /version\/([\d.]+).*safari/
};
return [].concat(Object.keys(t).filter(function (n) {
return t[n].test(e)
}))[0]
}, get os() {
var e = navigator.userAgent, t = /(?:Windows Phone)/.test(e), n = /(?:SymbianOS)/.test(e) || t,
r = /(?:Android)/.test(e), a = /(?:Firefox)/.test(e),
i = /(?:iPad|PlayBook)/.test(e) || r && !/(?:Mobile)/.test(e) || a && /(?:Tablet)/.test(e),
o = /(?:iPhone)/.test(e) && !i;
return {
isTablet: i,
isPhone: o,
isAndroid: r,
isPc: !(o || r || n || i),
isSymbian: n,
isWindowsPhone: t,
isFireFox: a
}
}
};
t.default = r, e.exports = t.default
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
};
var i = void 0, o = function e() {
var t = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.set = function (e, n) {
var r = e, a = n;
if (null === a) return !1;
var i = "";
if (r.indexOf(".") > -1) {
var o = r.split(".");
i = o[0], r = o[1]
}
"os_version" === r && (a = "" + a), i ? "user" === i || "header" === i ? t.envInfo[i][r] = a : "headers" === i ? t.envInfo.header.headers[r] = a : t.envInfo.header.headers.custom[r] = a : t.envInfo.user.hasOwnProperty(r) ? ["user_type", "device_id", "ip_addr_id"].indexOf(r) > -1 ? t.envInfo.user[r] = Number(a) : ["user_id", "web_id", "user_unique_id", "ssid"].indexOf(r) > -1 ? t.envInfo.user[r] = String(a) : ["user_is_auth", "user_is_login"].indexOf(r) > -1 && (t.envInfo.user[r] = Boolean(a)) : t.envInfo.header.hasOwnProperty(r) ? t.envInfo.header[r] = a : t.envInfo.header.headers.hasOwnProperty(r) ? t.envInfo.header.headers[r] = a : t.envInfo.header.headers.custom[r] = a
}, this.get = function () {
var e = {user: {}, header: {headers: {custom: {}}}}, n = t.envInfo, r = n.user, o = Object.keys(r),
l = Array.isArray(o), s = 0;
for (o = l ? o : o[Symbol.iterator](); ;) {
var u;
if (l) {
if (s >= o.length) break;
u = o[s++]
} else {
if ((s = o.next()).done) break;
u = s.value
}
var c = u;
r[c] !== i && (e.user[c] = r[c])
}
var p = n.header, d = Object.keys(p), f = Array.isArray(d), g = 0;
for (d = f ? d : d[Symbol.iterator](); ;) {
var h;
if (f) {
if (g >= d.length) break;
h = d[g++]
} else {
if ((g = d.next()).done) break;
h = g.value
}
var y = h;
p[y] !== i && "headers" !== y && (e.header[y] = p[y])
}
var x = n.header.headers, m = Object.keys(x), v = Array.isArray(m), b = 0;
for (m = v ? m : m[Symbol.iterator](); ;) {
var k;
if (v) {
if (b >= m.length) break;
k = m[b++]
} else {
if ((b = m.next()).done) break;
k = b.value
}
var w = k;
"custom" !== w && x[w] !== i && (e.header.headers[w] = x[w])
}
var _ = n.header.headers.custom, E = Object.keys(_);
if (E.length) {
var C = E, S = Array.isArray(C), P = 0;
for (C = S ? C : C[Symbol.iterator](); ;) {
var T;
if (S) {
if (P >= C.length) break;
T = C[P++]
} else {
if ((P = C.next()).done) break;
T = P.value
}
var O = T;
e.header.headers.custom[O] = _[O]
}
}
return {user: e.user, header: a({}, e.header, {headers: e.header.headers})}
}, this.envInfo = {
user: {
user_unique_id: i,
user_type: i,
user_id: i,
user_is_auth: i,
user_is_login: i,
device_id: i,
web_id: i,
ip_addr_id: i,
ssid: i
},
header: {
app_id: i,
app_name: i,
app_install_id: i,
app_package: i,
app_channel: i,
app_version: i,
os_name: i,
os_version: i,
device_model: i,
ab_client: i,
ab_version: i,
traffic_type: i,
utm_source: i,
utm_medium: i,
utm_campaign: i,
client_ip: i,
device_brand: i,
os_api: i,
access: i,
language: i,
region: i,
app_language: i,
app_region: i,
creative_id: i,
ad_id: i,
campaign_id: i,
log_type: i,
rnd: i,
platform: i,
sdk_version: i,
province: i,
city: i,
timezone: i,
tz_offset: i,
tz_name: i,
sim_region: i,
carrier: i,
resolution: i,
browser: i,
browser_version: i,
referrer: i,
referrer_host: i,
headers: {utm_term: i, utm_content: i, custom: {}}
}
}
}, l = function (e) {
var t = document.createElement("a");
return t.href = e, t
}, s = screen.width || 0, u = screen.height || 0, c = s + " x " + u, p = navigator.appVersion,
d = navigator.userAgent, f = navigator.language, g = document.referrer, h = l(g).hostname,
y = function (e) {
var t = l(e).search;
t = t.slice(1);
var n = {};
return t.split("&").forEach(function (e) {
var t = e.split("="), r = t[0], a = t[1];
n[r] = decodeURIComponent(void 0 === a ? "" : a)
}), n
}(location.href), x = "", m = "", v = "", b = "" + parseFloat(p), k = void 0, w = void 0;
-1 !== (k = d.indexOf("Opera")) && (v = "Opera", b = d.substring(k + 6), -1 !== (k = d.indexOf("Version")) && (b = d.substring(k + 8))), -1 !== (k = d.indexOf("Edge")) ? (v = "Microsoft Edge", b = d.substring(k + 5)) : -1 !== (k = d.indexOf("MSIE")) ? (v = "Microsoft Internet Explorer", b = d.substring(k + 5)) : -1 !== (k = d.indexOf("Chrome")) ? (v = "Chrome", b = d.substring(k + 7)) : -1 !== (k = d.indexOf("Safari")) ? (v = "Safari", b = d.substring(k + 7), -1 !== (k = d.indexOf("Version")) && (b = d.substring(k + 8))) : -1 !== (k = d.indexOf("Firefox")) && (v = "Firefox", b = d.substring(k + 8)), -1 !== (w = b.indexOf(";")) && (b = b.substring(0, w)), -1 !== (w = b.indexOf(" ")) && (b = b.substring(0, w)), -1 !== (w = b.indexOf(")")) && (b = b.substring(0, w));
for (var _, E, C = /Mobile|htc|mini|Android|iP(ad|od|hone)/.test(p) ? "wap" : "web", S = [{
s: "Windows 10",
r: /(Windows 10.0|Windows NT 10.0)/
}, {s: "Windows 8.1", r: /(Windows 8.1|Windows NT 6.3)/}, {
s: "Windows 8",
r: /(Windows 8|Windows NT 6.2)/
}, {s: "Windows 7", r: /(Windows 7|Windows NT 6.1)/}, {s: "Android", r: /Android/}, {
s: "Sun OS",
r: /SunOS/
}, {s: "Linux", r: /(Linux|X11)/}, {s: "iOS", r: /(iPhone|iPad|iPod)/}, {
s: "Mac OS X",
r: /Mac OS X/
}, {s: "Mac OS", r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}], P = 0; P < S.length; P++) {
var T = S[P];
if (T.r.test(d)) {
x = T.s;
break
}
}
function O(e, t) {
var n = e.exec(t);
return n && n[1] ? n[1] : ""
}
switch (/Windows/.test(x) && (m = O(/Windows (.*)/, x), x = "windows"), x) {
case"Mac OS X":
m = O(/Mac OS X (10[\.\_\d]+)/, d), x = "mac";
break;
case"Android":
(E = O(/Android ([\.\_\d]+)/, _ = d)) || (E = O(/Android\/([\.\_\d]+)/, _)), m = E, x = "android";
break;
case"iOS":
m = (m = /OS (\d+)_(\d+)_?(\d+)?/.exec(p)) ? m[1] + "." + m[2] + "." + (0 | m[3]) : "", x = "ios"
}
var L = {
screen_size: c,
browser: v,
browser_version: b,
platform: C,
os_name: x,
os_version: m,
userAgent: d,
screen_width: s,
screen_height: u,
device_model: x,
language: f,
referrer: g,
referrer_host: h,
utm_source: y.utm_source,
utm_medium: y.utm_medium,
utm_campaign: y.utm_campaign,
utm_term: y.utm_term,
utm_content: y.utm_content
}, D = {
get: function (e) {
var t = localStorage.getItem(e), n = t;
try {
t && "string" == typeof t && (n = JSON.parse(t))
} catch (e) {
}
return n
}, set: function (e, t) {
try {
var n = "string" == typeof t ? t : JSON.stringify(t);
localStorage.setItem(e, n)
} catch (e) {
}
}
}, M = "__tea_cache_", R = 4001, z = 4e3, A = 4002, j = 4003, I = 500, B = 5001,
N = "function" == typeof Symbol && "symbol" === r(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : r(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : r(e)
};
var q = function e() {
var t = this, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.init = function (e) {
t.isLog = e
}, this.info = function (e) {
for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++) r[a - 1] = arguments[a];
var i;
t.isLog && (i = console).log.apply(i, [t.prefix + e].concat(r))
}, this.warn = function (e) {
for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++) r[a - 1] = arguments[a];
var i;
t.isLog && (i = console).warn.apply(i, [t.prefix + e].concat(r))
}, this.error = function (e) {
for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++) r[a - 1] = arguments[a];
var i;
t.isLog && (i = console).error.apply(i, [t.prefix + e].concat(r))
}, this.dir = function () {
var e;
t.isLog && (e = console).dir.apply(e, arguments)
}, this.table = function (e) {
t.isLog && console.table(e)
}, this.logJSON = function (e) {
"object" === (void 0 === e ? "undefined" : N(e)) && t.isLog && t.info("", JSON.stringify(e, null, 2))
}, this.deprecated = function (e) {
for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++) r[a - 1] = arguments[a];
t.warn.apply(t, ["[DEPRECATED]" + e].concat(r))
}, this.throw = function (e) {
throw t.error(t.prefix), new Error(e)
};
var r = n ? "[" + n + "]" : "";
this.prefix = "[tea-sdk]" + r
}, F = new q, U = function (e, t, n, r) {
var a = new XMLHttpRequest;
a.open("POST", e, !0), a.setRequestHeader("Content-Type", "application/json; charset=utf-8"), a.onload = function () {
try {
var e = JSON.parse(a.responseText);
n && n(e)
} catch (e) {
r && r()
}
}, a.onerror = function () {
r && r()
}, a.send(JSON.stringify(t))
};
var H = (new Date).getTimezoneOffset(), W = parseInt(-H / 60, 10), Y = 60 * H, V = void 0;
try {
V = "3.2.7"
} catch (_) {
V = "2.x"
}
var K = new (function (e) {
function t() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t);
var n = function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== (void 0 === t ? "undefined" : r(t)) && "function" != typeof t ? e : t
}(this, e.call(this));
return n.initClientEnv = function () {
n.set("os_name", L.os_name), n.set("os_version", L.os_version), n.set("device_model", L.device_model), n.set("platform", L.platform), n.set("sdk_version", V), n.set("browser", L.browser), n.set("browser_version", L.browser_version), n.set("language", L.language), n.set("timezone", W), n.set("tz_offset", Y), n.set("resolution", L.screen_width + "x" + L.screen_height), n.set("screen_width", L.screen_width), n.set("screen_height", L.screen_height), n.set("referrer", L.referrer), n.set("referrer_host", L.referrer_host), n.set("utm_source", L.utm_source), n.set("utm_medium", L.utm_medium), n.set("utm_campaign", L.utm_campaign), n.set("utm_term", L.utm_term), n.set("utm_content", L.utm_content)
}, n.initClientEnv(), n
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : r(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, e), t
}(o));
var X = new (function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e)
}
return e.prototype.isString = function (e) {
return "String" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isNumber = function (e) {
return "Number" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isBoolean = function (e) {
return "Boolean" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isFunction = function (e) {
return "Function" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isNull = function (e) {
return "Null" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isUndefined = function (e) {
return "Undefined" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isObj = function (e) {
return "Object" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isArray = function (e) {
return "Array" === Object.prototype.toString.call(e).slice(8, -1)
}, e.prototype.isFalse = function (e) {
return "" === e || null == e || "null" === e || "undefined" === e || 0 === e || !1 === e || NaN === e
}, e.prototype.isTrue = function (e) {
return !this.isFalse(e)
}, e.prototype.isLowIE = function () {
return window.XDomainRequest
}, e
}());
var J = function (e) {
return function (e, t, n) {
if ("string" == typeof e && "number" == typeof t && "number" == typeof n) {
var r, a = [];
n = n <= 25 ? n : n % 25;
var i = String.fromCharCode(n + 97);
r = e.split(i);
for (var o = 0; o < r.length; o++) {
var l = parseInt(r[o], n);
l = 1 * l ^ t;
var s = String.fromCharCode(l);
a.push(s)
}
return a.join("")
}
}(e, 64, 25)
};
function $(e) {
return e ? (e ^ 16 * Math.random() >> e / 4).toString(10) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, $)
}
var Q = function () {
return $().replace(/-/g, "").slice(0, 19)
}, G = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
};
var Z = {
cn: "1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az21z1lz21z21z1bz1iz4az1az1mz1k",
sg: "1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",
va: "1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"
}, ee = function (e) {
try {
var t = document.cookie.match(new RegExp("(?:^|;)\\s*" + e + "=([^;]+)"));
return decodeURIComponent(t ? t[1] : "")
} catch (e) {
return ""
}
}, te = function (e) {
function t() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t);
var n = function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== (void 0 === t ? "undefined" : r(t)) && "function" != typeof t ? e : t
}(this, e.call(this));
return n.init = function (e) {
var t = e.app_id, r = e.channel, a = e.log, i = e.channel_domain, o = e.name;
if ("number" != typeof t) throw new Error("app_id 必须是一个数字,注意检查是否是以`string`的方式传入的?");
n.logger = new q(o), n.logger.init(a), n.initConfigs(e), n.initUrls(r, i), n.setEnv("app_id", t)
}, n.initConfigs = function (e) {
var t = e.app_id, r = e.disable_ssid, a = e.disable_webid, i = e.disable_sdk_monitor;
n.app_id = t, n.evtDataCacheKey = M + "events_" + t, r && (n.logger.info("ssid已禁用,设置user_unique_id不会请求ssid接口。"), n.isSsidDisabled = !0), a && (n.logger.info("webid服务已禁用,ssid同时被禁用。将本地生成webid。"), n.isWebidDisabled = !0, n.isSsidDisabled = !0), i && (n.logger.info("SDK监控已禁用。"), n.isSdkMonitorDisabled = !0)
}, n.initUrls = function (e, t) {
if ("internal" === e && (n.logger.warn("channel 的值 internal 已被废弃,已自动改为 cn。"), e = "cn"), !t && !Z[e]) throw new Error("channel 变量只能是 `cn`, `sg`,`va`");
var r = t || J(Z[e]);
r = r.replace(/\/+$/, ""), n.reportUrl = r + "/v1/list", n.userTokensPrefix = "" + r
}, n.setEnv = function (e, t) {
if ("app_id" === e && n.checkUserToken(t), "user_unique_id" === e) {
if (n.blackUuid.some(function (e) {
return e === String(t)
})) return void n.logger.warn('设置了无效的值 {user_unique_id:"%s"}。该操作已忽略。', t);
n.verifyTokens(t)
}
if ("web_id" === e) {
if (!t) return;
(!n.envInfo.user.user_unique_id || n.envInfo.user.user_unique_id && n.envInfo.user.user_unique_id === n.envInfo.user.web_id) && n.set("user_unique_id", t)
}
n.set(e, t)
}, n.transferFromCookie = function () {
var e = n.tokensCacheKey, t = ee("tt_webid"), r = ee("__tea_sdk__ssid"),
a = ee("__tea_sdk__user_unique_id");
if (X.isLowIE()) {
if (t) {
var i = {web_id: t, ssid: t, user_unique_id: t};
D.set(e, JSON.stringify(i))
}
return !1
}
if (t && r && a) {
var o = {web_id: t, ssid: r, user_unique_id: a};
D.set(e, JSON.stringify(o))
}
}, n.purifyBlackUuid = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
if (n.blackUuid.some(function (t) {
return t === e.user_unique_id
})) {
var t = {};
return n.setUserTokens(t), n.logger.warn('检测到无效的用户标识,已重置用户状态。{user_unique_id: "%s"}', e.user_unique_id), t
}
return e
}, n.getUserTokens = function () {
return D.get(n.tokensCacheKey) || {}
}, n.setUserTokens = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return D.set(n.tokensCacheKey, e)
}, n.checkUserToken = function (e) {
var t = M + "tokens_" + e;
n.tokensCacheKey = t, n.transferFromCookie();
var r = n.purifyBlackUuid(n.getUserTokens());
r.user_unique_id && r.web_id ? (n.envInfo.user.user_unique_id = r.user_unique_id, n.envInfo.user.web_id = r.web_id, n.envInfo.user.ssid = r.ssid || "", n.logger.info("初始化已经检测到了 webid user_unique_id,一般情况下不需要再次验证 id 了"), n.unlock()) : n.requestWebId(e)
}, n.saveTokenToStorage = function (e) {
var t = e.web_id, r = e.ssid, a = e.user_unique_id;
n.setUserTokens({web_id: t, ssid: r, user_unique_id: a})
}, n.requestWebId = function () {
n.isRequestWebId = !0;
var e = function (e) {
var t = n.envInfo.user.web_id || e.web_id, r = e.ssid;
n.isRequestWebId = !1, n.envInfo.user.ssid = r, n.envInfo.user.web_id = t, n.envInfo.user.user_unique_id = t, n.saveTokenToStorage({
web_id: t,
ssid: r,
user_unique_id: t
}), n.waitForVerifyTokens ? (n.lock(), n.verifyTokens(n.realUuid)) : (n.unlock(), n.callback && n.callback())
};
n.isWebidDisabled ? e({web_id: Q(), ssid: ""}) : function () {
var t = n.userTokensPrefix + "/v1/user/webid";
U(t, {
app_id: n.app_id,
url: location.href,
user_agent: L.userAgent,
referer: L.referrer,
user_unique_id: ""
}, function (t) {
0 !== t.e ? n.logger.error("请求 webid 失败。请联系管理员。") : e(t)
}, function () {
n.isRequestWebId = !1, n.logger.error("获取 webid 失败,数据将不会被上报")
})
}()
}, n.verifyTokens = function (e) {
var t = n.tokensCacheKey;
if (n.waitForVerifyTokens = !1, n.realUuid = "" + e, n.isRequestWebId) return n.waitForVerifyTokens = !0, n.logger.info("正在请求 webid,requestSsid 将会在前者请求完毕之后被调用"), !1;
var r = n.getUserTokens();
if (r.user_unique_id === n.realUuid && r.ssid && r.web_id) n.logger.info("传入的 user_id/user_unique_id 与 缓存中的完全一致,无需再次请求"), n.unlock(); else {
n.lock(), n.envInfo.user.user_unique_id = n.realUuid;
var a = G({}, n.getUserTokens(), {user_unique_id: n.realUuid});
if (D.set(t, JSON.stringify(a)), X.isLowIE()) return n.unlock(), !1;
n.isSsidDisabled ? (n.unlock(), n.callback && n.callback()) : n.requestSsid()
}
}, n.requestSsid = function () {
var e = n.getUserTokens(), t = n.userTokensPrefix + "/v1/user/ssid";
U(t, {app_id: n.app_id, web_id: e.web_id, user_unique_id: "" + e.user_unique_id}, function (t) {
if (n.unlock(), 0 !== t.e) n.logger.error("请求 ssid 失败~"); else {
n.envInfo.user.ssid = t.ssid;
var r = G({}, e, {ssid: t.ssid});
n.setUserTokens(r), n.logger.info("根据 user_unique_id 更新 ssid 成功!注意:在这之前不应该有数据被发出去"), n.callback && n.callback()
}
}, function () {
n.unlock(), n.logger.error("根据 user_unique_id 获取新 ssid 失败")
})
}, n.setEvtParams = function (e) {
var t = G({}, e);
Object.keys(t).forEach(function (e) {
n.evtParams[e] = t[e]
})
}, n.mergeEnvToEvents = function (e) {
var t = n.mergeEnv(), r = [], a = 0, i = void 0;
return e.forEach(function (e) {
var t = !!e.params.__disable_storage__;
void 0 === i ? i = t : (t !== i || r[a].length >= 5) && (a += 1, i = !i), r[a] = r[a] || [], r[a].push(e)
}), r.map(function (e) {
return {
events: e.map(function (e) {
var t = G({}, n.evtParams, e.params);
return delete t.__disable_storage__, G({}, e, {params: JSON.stringify(t)})
}),
user: t.user,
header: t.header,
verbose: n.debugMode ? 1 : void 0,
__disable_storage__: e[0].params.__disable_storage__
}
})
}, n.mergeEnv = function () {
var e = n.get(), t = K.get(), r = G({}, e.user),
a = G({}, t.header.headers.custom, e.header.headers.custom),
i = G({}, t.header.headers, e.header.headers, {custom: a}), o = G({}, t.header, e.header);
return {user: r, header: G({}, o, {headers: JSON.stringify(i)})}
}, n.evtParams = {}, n.reportUrl = "", n.userTokensPrefix = "", n.isSsidDisabled = !1, n.isWebidDisabled = !1, n.isSdkMonitorDisabled = !1, n.debugMode = !1, n.blackUuid = ["null", "undefined", "0", "", "None"], n.logger = function () {
}, n
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : r(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, e), t.prototype.lock = function () {
this.isUserTokensReady = !1
}, t.prototype.unlock = function () {
this.isUserTokensReady = !0
}, t.prototype.enableDebugMode = function (e) {
this.debugMode = e
}, t
}(o);
var ne = function e() {
var t = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.set = function (e, n) {
t.cache[e] = n
}, this.get = function (e) {
return t.cache[e]
}, this.clean = function (e) {
t.cache[e] = void 0
}, this.cache = {}
}, re = new ne;
var ae = function () {
function e(t) {
var n = t.disable_storage, r = void 0 !== n && n;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this._isPersistent = !r, this._storage = this._isPersistent ? D : new ne, this._storageKey = "", this._data = void 0
}
return e.prototype.setStorageKey = function (e) {
this._storageKey = e
}, e.prototype.getAllEvents = function () {
var e = this.getData();
Object.keys(e).reduce(function (t, n) {
return t.concat(e[n] || [])
}, [])
}, e.prototype.getData = function () {
return this._checkIsDataInit(), this._data
}, e.prototype.add = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
this._checkIsDataInit(), 0 !== t.length && (this._data[e] = t, this._save())
}, e.prototype.delete = function (e) {
this._checkIsDataInit(), this._data[e] && (delete this._data[e], this._save())
}, e.prototype._checkIsDataInit = function () {
if (void 0 === this._data) try {
var e, t = this._getDataFromStorage();
if (X.isArray(t)) this._data = ((e = {})[Q()] = t, e), this._save(); else this._data = t
} catch (e) {
this._data = {}
}
}, e.prototype._checkStorageKey = function () {
if (!this._storageKey) throw new Error("must call setStorageKey('xxx') first")
}, e.prototype._getDataFromStorage = function () {
return this._checkStorageKey(), this._storage.get(this._storageKey) || {}
}, e.prototype._save = function () {
this._checkStorageKey(), this._storage.set(this._storageKey, this._data)
}, e
}(), ie = function (e, t) {
try {
var n = e.split("v1")[0];
t.forEach(function (e) {
var t = function (e) {
var t = "";
for (var n in e) e.hasOwnProperty(n) && (t += "&" + n + "=" + encodeURIComponent(JSON.stringify(e[n])));
return t = "&" === t[0] ? t.slice(1) : t
}(e), r = new Image(1, 1);
r.onload = function () {
r = null
}, r.onerror = function () {
r = null
}, r.src = n + "/v1/gif?" + t
})
} catch (e) {
}
}, oe = function (e, t) {
if (window.XDomainRequest) return ie(e, t);
var n = new XMLHttpRequest;
n.open("POST", e + "?rdn=" + Math.random(), !0), n.onload = function () {
}, n.onerror = function () {
n.abort()
}, n.send(JSON.stringify(t))
}, le = function e(t, n, r, a) {
try {
var i = t.split("v1")[0];
if (!i) return void a(t, n, R);
n.forEach(function (e) {
var o = function (e) {
var t = "";
for (var n in e) e.hasOwnProperty(n) && (t += "&" + n + "=" + encodeURIComponent(JSON.stringify(e[n])));
return t = "&" === t[0] ? t.slice(1) : t
}(e), l = new Image(1, 1);
l.onload = function () {
l = null, r()
}, l.onerror = function () {
l = null, a(t, n, z)
}, l.src = i + "/v1/gif?" + o
})
} catch (e) {
a(t, n, A, e.message)
}
};
var se = function e(t) {
var n = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.send = function (e) {
var t = e.url, r = e.data, a = e.success, i = e.fail, o = e.eventError;
if (function (e) {
var t = e.url, n = e.data, r = e.success, a = e.fail, i = e.notSure, o = e.isUnload, l = n;
if (window.XDomainRequest) le(t, l, r, a); else {
if (o) return window.navigator && window.navigator.sendBeacon ? (i(), void(window.navigator.sendBeacon(t, JSON.stringify(l)) ? r() : a(t, n, j))) : void le(t, l, r, a);
var s = new XMLHttpRequest;
s.open("POST", t + "?rdn=" + Math.random(), !0), s.onload = function () {
r(t, l, s.responseText)
}, s.onerror = function () {
s.abort(), a(t, l, I)
}, s.send(JSON.stringify(l))
}
}({
url: t, data: r, success: function (e, t, r) {
a();
try {
var i = JSON.parse(r).e;
if (0 !== i) {
var l = "未知错误";
-2 === i && (l = "事件格式错误!请检查字段类型是否正确。"), n.logger.error("数据上报失败!", "错误码:" + i + "。错误信息:" + l), o(t, i), ce(e, t, i)
}
} catch (n) {
ce(e, t, B)
}
}, fail: function (e, t, r) {
n.logger.error("数据上报失败!", "错误码:" + r), i(t, r), ce(e, t, r)
}, notSure: e.notSure, isUnload: e.isUnload
}), !n.isSdkMonitorDisabled && !n.isSdkOnLoadEventReady) {
n.isSdkOnLoadEventReady = !0;
try {
var l = r[0].header, s = r[0].user;
ue(t, {app_id: l.app_id, app_name: l.app_name, sdk_version: l.sdk_version, web_id: s.web_id})
} catch (e) {
}
}
}, this.logger = t.logger || F, this.isSdkOnLoadEventReady = !1, this.isSdkMonitorDisabled = !1
}, ue = function (e, t) {
try {
var n = {
events: [{
event: "onload",
params: JSON.stringify({
app_id: t.app_id,
app_name: t.app_name || "",
sdk_version: t.sdk_version
}),
local_time_ms: Date.now()
}], user: {user_unique_id: t.web_id}, header: {app_id: 1338}
};
setTimeout(function () {
oe(e, [n])
}, 16)
} catch (e) {
}
}, ce = function (e, t, n) {
try {
var r = t[0].user, a = t[0].header, i = [];
t.forEach(function (e) {
e.events.forEach(function (e) {
i.push(e)
})
});
var o = {
events: i.map(function (e) {
return {
event: "on_error",
params: JSON.stringify({
error_code: n,
app_id: a.app_id,
app_name: a.app_name || "",
error_event: e.event,
local_time_ms: e.local_time_ms,
tea_event_index: Date.now(),
params: e.params,
header: JSON.stringify(a),
user: JSON.stringify(r)
}),
local_time_ms: Date.now()
}
}), user: {user_unique_id: r.user_unique_id}, header: {app_id: 1338}
};
setTimeout(function () {
oe(e, [o])
}, 16)
} catch (e) {
}
};
var pe = function (e) {
function t(n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t);
var a = function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== (void 0 === t ? "undefined" : r(t)) && "function" != typeof t ? e : t
}(this, e.call(this));
a.addListener = function () {
window.addEventListener("unload", function () {
a.report(!0)
}, !1), window.addEventListener("beforeunload", function () {
a.report(!0)
}, !1), document.addEventListener("visibilitychange", function () {
"hidden" === document.visibilityState && a.report(!0)
}, !1)
}, a.setReady = function (e) {
a.isReady = e, a.eventSender.isSdkMonitorDisabled = a.isSdkMonitorDisabled, a.checkAndSendCachedStorageEvents(), a.report()
}, a.eventReportTimer = null, a.event = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
n = re.get(a.evtDataCacheKey) || [], r = t ? [].concat(e, n) : [].concat(n, e);
re.set(a.evtDataCacheKey, r), r.length >= 5 ? a.report() : (a.eventReportTimer && clearTimeout(a.eventReportTimer), a.eventReportTimer = setTimeout(function () {
a.report(), a.eventReportTimer = null
}, a.waitForBatchTime))
}, a.report = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (!a.isUserTokensReady) return !1;
if (!a.isReady) return !1;
var t = re.get(a.evtDataCacheKey) || [];
re.clean(a.evtDataCacheKey);
var n = a.mergeEnvToEvents(t);
a.sendData(n, e)
}, a.sendData = function (e, t) {
var n = [], r = 0, i = void 0;
e.forEach(function (e) {
var t = !!e.__disable_storage__;
void 0 === i ? i = t : (t !== i || n[r].length >= 5) && (r += 1, i = !i), n[r] = n[r] || [], n[r].push(e)
}), n.forEach(function (e) {
var n = Q();
e[0].__disable_storage__ || a.eventStorage.add(n, e), a._sendData(n, e, t)
})
}, a.checkAndSendCachedStorageEvents = function () {
var e = a.eventStorage.getData(), t = Object.keys(e);
t.length > 0 && t.forEach(function (t) {
a._sendData(t, e[t])
})
}, a._sendData = function (e, t, n) {
a.isReporting = !0;
var r = function () {
a.isReporting = !1
};
a.eventSender.send({
url: a.reportUrl, data: t, success: function () {
r(), a.sendDataSuccess(e)
}, fail: function (e, t) {
r(), a.reportErrorCallback(e, t), setTimeout(function () {
a.report()
}, 3e3)
}, eventError: function (e, t) {
a.reportErrorCallback(e, t)
}, notSure: r, isUnload: n
})
}, a.sendDataSuccess = function (e) {
a.eventStorage.delete(e), a.report()
};
var i = n.log, o = n.disable_storage, l = n.max_batch_num, s = void 0 === l ? 5 : l, u = n.batch_time,
c = void 0 === u ? 30 : u;
return a.init(n), a.maxBatchNum = s, a.waitForBatchTime = c, a.isReady = !1, a.addListener(), a.enableDebugMode(!!i), a.eventStorage = new ae({disable_storage: o}), a.eventStorage.setStorageKey(a.evtDataCacheKey), a.eventSender = new se({logger: a.logger}), a.reportErrorCallback = function () {
}, a
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : r(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, e), t
}(te), de = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
};
var fe = function () {
var e = +Date.now() + Number(("" + Math.random()).slice(2, 8));
return function () {
return e += 1
}
}(), ge = function e(t) {
var n = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.init = function (e) {
if (!X.isObj(e)) throw new Error("init 的参数必须是Object类型");
n.logger.init(e.log), n.channel = new pe(de({}, e, {name: n.name})), n.channel.callback = function () {
n.callbackSend && n.start()
}
}, this.config = function (e) {
X.isObj(e) || n.logger.throw("config 参数必须是 {} 的格式"), e.log && (n.logger.init(!0), n.channel.enableDebugMode(!0), e.log = null);
var t = Object.keys(e);
if (!t.length) return !1;
var r = t, a = Array.isArray(r), i = 0;
for (r = a ? r : r[Symbol.iterator](); ;) {
var o;
if (a) {
if (i >= r.length) break;
o = r[i++]
} else {
if ((i = r.next()).done) break;
o = i.value
}
var l = o, s = e[l];
switch (l) {
case"evtParams":
n.channel.setEvtParams(s);
break;
case"disable_ssid":
n.logger.deprecated("(disable_ssid)请通过init函数来设置。"), s && (n.logger.info("ssid已禁用,设置user_unique_id不会请求ssid接口。"), n.channel.isSsidDisabled = s);
break;
case"disable_auto_pv":
s && (n.logger.info("已禁止默认上报predefine_pageview事件,需手动上报。"), n._autoSendPV = !1);
break;
case"_staging_flag":
"" + s == "1" && n.logger.info("根据_staging_flag设置,数据将会上报到stag 表。"), n.channel.setEvtParams({_staging_flag: Number(s)});
break;
case"reportErrorCallback":
"function" == typeof s && (n.channel.reportErrorCallback = s);
break;
default:
n.channel.setEnv(l, s)
}
}
}, this.send = function () {
n.start()
}, this.start = function () {
if (n.channel.isUserTokensReady) {
if (n._isSendFuncCalled) return;
n._isSendFuncCalled = !0, n.logger.info("看到本提示,意味着用户信息已完全就绪,上报通道打开。用户标识如下:"), n.logger.logJSON(n.channel.get().user), n._autoSendPV && n.predefinePageView(), n.channel.setReady(!0)
} else n.callbackSend = !0
}, this.predefinePageView = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
t = {title: document.title || location.pathname, url: location.href, url_path: location.pathname},
r = de({}, t, e);
n.event("predefine_pageview", r, !0)
}, this.event = function () {
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) t[r] = arguments[r];
var a = X.isBoolean(t[t.length - 1]), i = !!a && t[t.length - 1], o = a ? t.slice(0, t.length - 1) : t,
l = o[0], s = [];
X.isArray(l) ? s = o : s[0] = o, s = s.map(function (e) {
return function (e, t) {
var n = e;
/^event\./.test(e) && (n = e.slice(6));
var r = t;
return X.isObj(r) || (r = {}), r.event_index = fe(), {
event: n,
params: r,
local_time_ms: +new Date
}
}.apply(void 0, e)
}), n.channel.event(s, i)
}, this._isSendFuncCalled = !1, this._autoSendPV = !0, this.name = t, this.logger = new q(t)
};
ge.exportMethods = ["init", "config", "send", "start", "predefinePageView"];
t.default = function e(t) {
var n = this;
return function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this._exportCollect = function () {
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) t[r] = arguments[r];
n._isQueueProcessed ? n._executeCmd.apply(n, t) : (n.cmdQueue.push(t), n._processCmdQueue())
}, this._processCmdQueue = function () {
if (0 !== n.cmdQueue.length) {
var e, t, r, a, i = (e = n.cmdQueue, t = "init", r = "0", a = -1, e.forEach(function (e, n) {
(void 0 !== r ? e[r] : e) === t && (a = n)
}), a);
-1 !== i && (n._isQueueProcessed = !0, n._executeCmd.apply(n, n.cmdQueue[i]), n.cmdQueue.forEach(function (e, t) {
t !== i && n._executeCmd.apply(n, e)
}), n.cmdQueue = [])
}
}, this._executeCmd = function () {
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) t[r] = arguments[r];
var a, i, o = t[0];
ge.exportMethods.indexOf(o) > -1 ? (a = n.colloctor)[o].apply(a, t.slice(1)) : (i = n.colloctor).event.apply(i, t)
}, this.name = t || "Collector" + +new Date, this.cmdQueue = [], this.colloctor = new ge(this.name), this._isQueueProcessed = !1, this._processCmdQueue(), this._exportCollect.init = this._exportCollect.bind(this, "init"), this._exportCollect.config = this._exportCollect.bind(this, "config"), this._exportCollect.send = this._exportCollect.bind(this, "send"), this._exportCollect.start = this._exportCollect.bind(this, "start"), this._exportCollect.predefinePageView = this._exportCollect.bind(this, "predefinePageView"), this._exportCollect
}, e.exports = t.default
}, function (e, t, n) {
e.exports = n(8)
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = _(n(0)), a = _(n(34)), i = _(n(35)), o = _(n(36)), l = _(n(37)), s = _(n(38)), u = _(n(39)),
c = _(n(40)),
p = _(n(41)), d = _(n(42)), f = _(n(43)), g = _(n(44)), h = _(n(45)), y = _(n(46)), x = _(n(47)),
m = _(n(48)),
v = _(n(49)), b = _(n(50)), k = _(n(51)), w = _(n(6));
_(n(52));
function _(e) {
return e && e.__esModule ? e : {default: e}
}
var E = {};
function C(e, t, n) {
var r = e;
t.map(function (e, a) {
r[e] = a == t.length - 1 ? n : r[e] || {}, r = r[e]
})
}
C(E, ["controls", "collect"], w.default), C(E, ["controls", "cssFullscreen"], k.default), C(E, ["controls", "danmu"], b.default), C(E, ["controls", "definition"], v.default), C(E, ["controls", "download"], m.default), C(E, ["controls", "fullscreen"], x.default), C(E, ["controls", "i18n"], y.default), C(E, ["controls", "localPreview"], h.default), C(E, ["controls", "logger"], g.default), C(E, ["controls", "mobile"], f.default), C(E, ["controls", "pc"], d.default), C(E, ["controls", "pip"], p.default), C(E, ["controls", "play"], c.default), C(E, ["controls", "playNext"], u.default), C(E, ["controls", "replay"], s.default), C(E, ["controls", "rotate"], l.default), C(E, ["controls", "screenShot"], o.default), C(E, ["controls", "start"], i.default), C(E, ["controls", "volume"], a.default), t.default = r.default, e.exports = t.default
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = l(n(10)), i = l(n(2)), o = l(n(3));
function l(e) {
return e && e.__esModule ? e : {default: e}
}
var s = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.logParams = {
bc: 0,
bu_acu_t: 0,
played: []
}, this._hasStart = !1, this.videoConfig = {
controls: !1,
autoplay: t.autoplay,
playsinline: t.playsinline,
"webkit-playsinline": t.playsinline,
"x5-playsinline": t.playsinline,
"x5-video-player-type": t["x5-video-player-type"],
"x5-video-player-fullscreen": t["x5-video-player-fullscreen"],
"x5-video-orientation": t["x5-video-orientation"],
airplay: t.airplay,
"webkit-airplay": t.airplay,
tabindex: 2,
mediaType: t.mediaType || "video"
}, t.loop && (this.videoConfig.loop = "loop");
var n = "";
if (t.textTrack && Array.isArray(t.textTrack) && (navigator.userAgent.indexOf("Chrome") > -1 || navigator.userAgent.indexOf("Firefox") > -1) && (t.textTrack.some(function (e) {
if (e.src && e.label && e.default) return n += '