import './style.css'; import { defineComponent, onMounted, toRaw, openBlock, createElementBlock } from "vue"; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } var dist$1 = { exports: {} }; (function(module, exports) { (function webpackUniversalModuleDefinition(root, factory) { module.exports = factory(); })(commonjsGlobal, function() { return function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { return installedModules[moduleId].exports; } var module2 = installedModules[moduleId] = { i: moduleId, l: false, exports: {} }; modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__); module2.l = true; return module2.exports; } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.d = function(exports2, name, getter) { if (!__webpack_require__.o(exports2, name)) { Object.defineProperty(exports2, name, { enumerable: true, get: getter }); } }; __webpack_require__.r = function(exports2) { if (typeof Symbol !== "undefined" && Symbol.toStringTag) { Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" }); } Object.defineProperty(exports2, "__esModule", { value: true }); }; __webpack_require__.t = function(value, mode) { if (mode & 1) value = __webpack_require__(value); if (mode & 8) return value; if (mode & 4 && typeof value === "object" && value && value.__esModule) return value; var ns = /* @__PURE__ */ Object.create(null); __webpack_require__.r(ns); Object.defineProperty(ns, "default", { enumerable: true, value }); if (mode & 2 && typeof value != "string") for (var key in value) __webpack_require__.d(ns, key, function(key2) { return value[key2]; }.bind(null, key)); return ns; }; __webpack_require__.n = function(module2) { var getter = module2 && module2.__esModule ? function getDefault() { return module2["default"]; } : function getModuleExports() { return module2; }; __webpack_require__.d(getter, "a", getter); return getter; }; __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 79); }([ function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.util = exports2.PresentationMode = void 0; exports2.createDom = createDom2; exports2.hasClass = hasClass2; exports2.addClass = addClass2; exports2.removeClass = removeClass2; exports2.toggleClass = toggleClass2; exports2.findDom = findDom2; exports2.padStart = padStart2; exports2.format = format2; exports2.event = event2; exports2.typeOf = typeOf2; exports2.deepCopy = deepCopy; exports2.getBgImage = getBgImage; exports2.copyDom = copyDom; exports2._setInterval = _setInterval; exports2._clearInterval = _clearInterval; exports2.createImgBtn = createImgBtn2; exports2.isWeiXin = isWeiXin2; exports2.isUc = isUc2; exports2.computeWatchDur = computeWatchDur; exports2.offInDestroy = offInDestroy; exports2.on = on; exports2.once = once; exports2.getBuffered2 = getBuffered2; exports2.checkIsBrowser = checkIsBrowser; exports2.setStyle = setStyle; exports2.checkWebkitSetPresentationMode = checkWebkitSetPresentationMode; var _xgplayerTimeRange = __webpack_require__(7); var _xgplayerTimeRange2 = _interopRequireDefault2(_xgplayerTimeRange); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function createDom2() { var el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "div"; var tpl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; var attrs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var cname = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; var dom = document.createElement(el); dom.className = cname; dom.innerHTML = tpl; Object.keys(attrs).forEach(function(item) { var key = item; var value = attrs[item]; if (el === "video" || el === "audio") { if (value) { dom.setAttribute(key, value); } } else { dom.setAttribute(key, value); } }); return dom; } function hasClass2(el, className) { if (!el) { return false; } if (el.classList) { return Array.prototype.some.call(el.classList, function(item) { return item === className; }); } else if (el.className) { return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); } else { return false; } } function addClass2(el, className) { if (!el) { return; } if (el.classList) { className.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function(item) { item && el.classList.add(item); }); } else if (!hasClass2(el, className)) { el.className += " " + className; } } function removeClass2(el, className) { if (!el) { return; } if (el.classList) { className.split(/\s+/g).forEach(function(item) { el.classList.remove(item); }); } else if (hasClass2(el, className)) { className.split(/\s+/g).forEach(function(item) { var reg = new RegExp("(\\s|^)" + item + "(\\s|$)"); el.className = el.className.replace(reg, " "); }); } } function toggleClass2(el, className) { if (!el) { return; } className.split(/\s+/g).forEach(function(item) { if (hasClass2(el, item)) { removeClass2(el, item); } else { addClass2(el, item); } }); } function findDom2() { var el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document; var sel = arguments[1]; var dom = void 0; try { dom = el.querySelector(sel); } catch (e) { if (sel.indexOf("#") === 0) { dom = el.getElementById(sel.slice(1)); } } return dom; } function padStart2(str, length, pad) { var charstr = String(pad); var len = length >> 0; var maxlen = Math.ceil(len / charstr.length); var chars = []; var r = String(str); while (maxlen--) { chars.push(charstr); } return chars.join("").substring(0, len - r.length) + r; } function format2(time2) { if (window.isNaN(time2)) { return ""; } var hour = padStart2(Math.floor(time2 / 3600), 2, 0); var minute = padStart2(Math.floor((time2 - hour * 3600) / 60), 2, 0); var second = padStart2(Math.floor(time2 - hour * 3600 - minute * 60), 2, 0); return (hour === "00" ? [minute, second] : [hour, minute, second]).join(":"); } function event2(e) { if (e.touches) { var touch = e.touches[0] || e.changedTouches[0]; e.clientX = touch.clientX || 0; e.clientY = touch.clientY || 0; e.offsetX = touch.pageX - touch.target.offsetLeft; e.offsetY = touch.pageY - touch.target.offsetTop; } e._target = e.target || e.srcElement; } function typeOf2(obj) { return Object.prototype.toString.call(obj).match(/([^\s.*]+)(?=]$)/g)[0]; } function deepCopy(dst, src) { if (typeOf2(src) === "Object" && typeOf2(dst) === "Object") { Object.keys(src).forEach(function(key) { if (typeOf2(src[key]) === "Object" && !(src[key] instanceof Node)) { if (!dst[key]) { dst[key] = src[key]; } else { deepCopy(dst[key], src[key]); } } else if (typeOf2(src[key]) === "Array") { dst[key] = typeOf2(dst[key]) === "Array" ? dst[key].concat(src[key]) : src[key]; } else { dst[key] = src[key]; } }); return dst; } } function getBgImage(el) { var url = (el.currentStyle || window.getComputedStyle(el, null)).backgroundImage; if (!url || url === "none") { return ""; } var a = document.createElement("a"); a.href = url.replace(/url\("|"\)/g, ""); return a.href; } function copyDom(dom) { if (dom && dom.nodeType === 1) { var back = document.createElement(dom.tagName); Array.prototype.forEach.call(dom.attributes, function(node) { back.setAttribute(node.name, node.value); }); if (dom.innerHTML) { back.innerHTML = dom.innerHTML; } return back; } else { return ""; } } function _setInterval(context, eventName, intervalFunc, frequency) { if (!context._interval[eventName]) { context._interval[eventName] = setInterval(intervalFunc.bind(context), frequency); } } function _clearInterval(context, eventName) { clearInterval(context._interval[eventName]); context._interval[eventName] = null; } function createImgBtn2(name, imgUrl, width, height) { var btn = createDom2("xg-" + name, "", {}, "xgplayer-" + name + "-img"); btn.style.backgroundImage = 'url("' + imgUrl + '")'; if (width && height) { var w = void 0, h = void 0, unit = void 0; ["px", "rem", "em", "pt", "dp", "vw", "vh", "vm", "%"].every(function(item) { if (width.indexOf(item) > -1 && height.indexOf(item) > -1) { w = Number(width.slice(0, width.indexOf(item)).trim()); h = Number(height.slice(0, height.indexOf(item)).trim()); unit = item; return false; } else { return true; } }); btn.style.width = "" + w + unit; btn.style.height = "" + h + unit; btn.style.backgroundSize = "" + w + unit + " " + h + unit; if (name === "start") { btn.style.margin = "-" + h / 2 + unit + " auto auto -" + w / 2 + unit; } else { btn.style.margin = "auto 5px auto 5px"; } } return btn; } function isWeiXin2() { var ua = window.navigator.userAgent.toLowerCase(); return ua.indexOf("micromessenger") > -1; } function isUc2() { var ua = window.navigator.userAgent.toLowerCase(); return ua.indexOf("ucbrowser") > -1; } function computeWatchDur() { var played = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var arr = []; for (var i = 0; i < played.length; i++) { if (!played[i].end || played[i].begin < 0 || played[i].end < 0 || played[i].end < played[i].begin) { continue; } if (arr.length < 1) { arr.push({ begin: played[i].begin, end: played[i].end }); } else { for (var j = 0; j < arr.length; j++) { var begin = played[i].begin; var end = played[i].end; if (end < arr[j].begin) { arr.splice(j, 0, { begin, end }); break; } else if (begin > arr[j].end) { if (j > arr.length - 2) { arr.push({ begin, end }); break; } } else { var b = arr[j].begin; var e = arr[j].end; arr[j].begin = Math.min(begin, b); arr[j].end = Math.max(end, e); break; } } } } var watch_dur = 0; for (var _i = 0; _i < arr.length; _i++) { watch_dur += arr[_i].end - arr[_i].begin; } return watch_dur; } function offInDestroy(object, event3, fn, offEvent) { function onDestroy() { object.off(event3, fn); object.off(offEvent, onDestroy); } object.once(offEvent, onDestroy); } function on(object, event3, fn, offEvent) { if (offEvent) { object.on(event3, fn); offInDestroy(object, event3, fn, offEvent); } else { var _fn = function _fn2(data) { fn(data); object.off(event3, _fn2); }; object.on(event3, _fn); } } function once(object, event3, fn, offEvent) { if (offEvent) { object.once(event3, fn); offInDestroy(object, event3, fn, offEvent); } else { var _fn = function _fn2(data) { fn(data); object.off(event3, _fn2); }; object.once(event3, _fn); } } function getBuffered2(vbuffered) { var maxHoleDuration = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0.5; var buffered = []; for (var i = 0; i < vbuffered.length; i++) { buffered.push({ start: vbuffered.start(i) < 0.5 ? 0 : vbuffered.start(i), end: vbuffered.end(i) }); } buffered.sort(function(a, b) { var diff = a.start - b.start; if (diff) { return diff; } else { return b.end - a.end; } }); var buffered_2 = []; if (maxHoleDuration) { for (var _i2 = 0; _i2 < buffered.length; _i2++) { var buf2len = buffered_2.length; if (buf2len) { var buf2end = buffered_2[buf2len - 1].end; if (buffered[_i2].start - buf2end < maxHoleDuration) { if (buffered[_i2].end > buf2end) { buffered_2[buf2len - 1].end = buffered[_i2].end; } } else { buffered_2.push(buffered[_i2]); } } else { buffered_2.push(buffered[_i2]); } } } else { buffered_2 = buffered; } return new _xgplayerTimeRange2.default(buffered_2); } function checkIsBrowser() { return !(typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined"); } function setStyle(elem, name, value) { var style = elem.style; try { style[name] = value; } catch (error2) { style.setProperty(name, value); } } exports2.PresentationMode = { PIP: "picture-in-picture", INLINE: "inline", FULLSCREEN: "fullscreen" }; function checkWebkitSetPresentationMode(video) { return typeof video.webkitSetPresentationMode === "function"; } exports2.util = { createDom: createDom2, hasClass: hasClass2, addClass: addClass2, removeClass: removeClass2, toggleClass: toggleClass2, findDom: findDom2, padStart: padStart2, format: format2, event: event2, typeOf: typeOf2, deepCopy, getBgImage, copyDom, setInterval: _setInterval, clearInterval: _clearInterval, createImgBtn: createImgBtn2, isWeiXin: isWeiXin2, isUc: isUc2, computeWatchDur, offInDestroy, on, once, getBuffered2, checkIsBrowser, setStyle }; }, function(module2, exports2) { module2.exports = function(useSourceMap) { var list = []; list.toString = function toString() { return this.map(function(item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; list.i = function(modules, mediaQuery) { if (typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (typeof id === "number") alreadyImportedModules[id] = true; } for (i = 0; i < modules.length; i++) { var item = modules[i]; if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ""; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === "function") { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function(source) { return "/*# sourceURL=" + cssMapping.sourceRoot + source + " */"; }); return [content].concat(sourceURLs).concat([sourceMapping]).join("\n"); } return [content].join("\n"); } function toComment(sourceMap) { var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = "sourceMappingURL=data:application/json;charset=utf-8;base64," + base64; return "/*# " + data + " */"; } }, function(module2, exports2, __webpack_require__) { var stylesInDom = {}; var memoize = function(fn) { var memo; return function() { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }; var isOldIE = memoize(function() { return window && document && document.all && !window.atob; }); var getTarget = function(target) { return document.querySelector(target); }; var getElement = function(fn) { var memo = {}; return function(target) { if (typeof target === "function") { return target(); } if (typeof memo[target] === "undefined") { var styleTarget = getTarget.call(this, target); if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { styleTarget = styleTarget.contentDocument.head; } catch (e) { styleTarget = null; } } memo[target] = styleTarget; } return memo[target]; }; }(); var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; var fixUrls = __webpack_require__(36); module2.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; options.attrs = typeof options.attrs === "object" ? options.attrs : {}; if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); if (!options.insertInto) options.insertInto = "head"; if (!options.insertAt) options.insertAt = "bottom"; var styles = listToStyles(list, options); addStylesToDom(styles, options); return function update(newList) { var mayRemove = []; for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; domStyle.refs--; mayRemove.push(domStyle); } if (newList) { var newStyles = listToStyles(newList, options); addStylesToDom(newStyles, options); } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if (domStyle.refs === 0) { for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; }; function addStylesToDom(styles, options) { for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; if (domStyle) { domStyle.refs++; for (var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]); } for (; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j], options)); } } else { var parts = []; for (var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j], options)); } stylesInDom[item.id] = { id: item.id, refs: 1, parts }; } } } function listToStyles(list, options) { var styles = []; var newStyles = {}; for (var i = 0; i < list.length; i++) { var item = list[i]; var id = options.base ? item[0] + options.base : item[0]; var css = item[1]; var media = item[2]; var sourceMap = item[3]; var part = { css, media, sourceMap }; if (!newStyles[id]) styles.push(newStyles[id] = { id, parts: [part] }); else newStyles[id].parts.push(part); } return styles; } function insertStyleElement(options, style) { var target = getElement(options.insertInto); if (!target) { throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); } var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; if (options.insertAt === "top") { if (!lastStyleElementInsertedAtTop) { target.insertBefore(style, target.firstChild); } else if (lastStyleElementInsertedAtTop.nextSibling) { target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); } else { target.appendChild(style); } stylesInsertedAtTop.push(style); } else if (options.insertAt === "bottom") { target.appendChild(style); } else if (typeof options.insertAt === "object" && options.insertAt.before) { var nextSibling = getElement(options.insertInto + " " + options.insertAt.before); target.insertBefore(style, nextSibling); } else { throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n"); } } function removeStyleElement(style) { if (style.parentNode === null) return false; style.parentNode.removeChild(style); var idx = stylesInsertedAtTop.indexOf(style); if (idx >= 0) { stylesInsertedAtTop.splice(idx, 1); } } function createStyleElement(options) { var style = document.createElement("style"); options.attrs.type = "text/css"; addAttrs(style, options.attrs); insertStyleElement(options, style); return style; } function createLinkElement(options) { var link = document.createElement("link"); options.attrs.type = "text/css"; options.attrs.rel = "stylesheet"; addAttrs(link, options.attrs); insertStyleElement(options, link); return link; } function addAttrs(el, attrs) { Object.keys(attrs).forEach(function(key) { el.setAttribute(key, attrs[key]); }); } function addStyle(obj, options) { var style, update, remove, result; if (options.transform && obj.css) { result = options.transform(obj.css); if (result) { obj.css = result; } else { return function() { }; } } if (options.singleton) { var styleIndex = singletonCounter++; style = singleton || (singleton = createStyleElement(options)); update = applyToSingletonTag.bind(null, style, styleIndex, false); remove = applyToSingletonTag.bind(null, style, styleIndex, true); } else if (obj.sourceMap && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" && typeof Blob === "function" && typeof btoa === "function") { style = createLinkElement(options); update = updateLink.bind(null, style, options); remove = function() { removeStyleElement(style); if (style.href) URL.revokeObjectURL(style.href); }; } else { style = createStyleElement(options); update = applyToTag.bind(null, style); remove = function() { removeStyleElement(style); }; } update(obj); return function updateStyle(newObj) { if (newObj) { if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { return; } update(obj = newObj); } else { remove(); } }; } var replaceText = function() { var textStore = []; return function(index2, replacement) { textStore[index2] = replacement; return textStore.filter(Boolean).join("\n"); }; }(); function applyToSingletonTag(style, index2, remove, obj) { var css = remove ? "" : obj.css; if (style.styleSheet) { style.styleSheet.cssText = replaceText(index2, css); } else { var cssNode = document.createTextNode(css); var childNodes = style.childNodes; if (childNodes[index2]) style.removeChild(childNodes[index2]); if (childNodes.length) { style.insertBefore(cssNode, childNodes[index2]); } else { style.appendChild(cssNode); } } } function applyToTag(style, obj) { var css = obj.css; var media = obj.media; if (media) { style.setAttribute("media", media); } if (style.styleSheet) { style.styleSheet.cssText = css; } else { while (style.firstChild) { style.removeChild(style.firstChild); } style.appendChild(document.createTextNode(css)); } } function updateLink(link, options, obj) { var css = obj.css; var sourceMap = obj.sourceMap; var autoFixUrls = options.convertToAbsoluteUrls === void 0 && sourceMap; if (options.convertToAbsoluteUrls || autoFixUrls) { css = fixUrls(css); } if (sourceMap) { css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; } var blob = new Blob([css], { type: "text/css" }); var oldSrc = link.href; link.href = URL.createObjectURL(blob); if (oldSrc) URL.revokeObjectURL(oldSrc); } }, function(module2, exports2, __webpack_require__) { var _undefined = __webpack_require__(24)(); module2.exports = function(val) { return val !== _undefined && val !== null; }; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _version = __webpack_require__(8); function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var ErrorTypes = { network: { code: 1, msg: "\u89C6\u9891\u4E0B\u8F7D\u9519\u8BEF", remark: "\u53EA\u8981\u89C6\u9891\u4E0B\u8F7D\u9519\u8BEF\u5C31\u4F7F\u7528\u6B64\u7C7B\u578B\uFF0C\u65E0\u8BBA\u662Fvideo\u672C\u8EAB\u7684\u8D85\u65F6\u8FD8\u662Fxhr\u7684\u5206\u6BB5\u8BF7\u6C42\u8D85\u65F6\u6216\u8005\u8D44\u6E90\u4E0D\u5B58\u5728" }, mse: { code: 2, msg: "\u6D41\u8FFD\u52A0\u9519\u8BEF", remark: "\u8FFD\u52A0\u6D41\u7684\u65F6\u5019\u5982\u679C\u7C7B\u578B\u4E0D\u5BF9\u3001\u65E0\u6CD5\u88AB\u6B63\u786E\u89E3\u7801\u5219\u4F1A\u89E6\u53D1\u6B64\u7C7B\u9519\u8BEF" }, parse: { code: 3, msg: "\u89E3\u6790\u9519\u8BEF", remark: "mp4\u3001hls\u3001flv\u6211\u4EEC\u90FD\u662F\u4F7F\u7528js\u8FDB\u884C\u683C\u5F0F\u89E3\u6790\uFF0C\u5982\u679C\u89E3\u6790\u5931\u8D25\u5219\u4F1A\u89E6\u53D1\u6B64\u7C7B\u9519\u8BEF" }, format: { code: 4, msg: "\u683C\u5F0F\u9519\u8BEF", remark: "\u5982\u679C\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u7684\u683C\u5F0F\u5BFC\u81F4\u64AD\u653E\u9519\u8BEF" }, decoder: { code: 5, msg: "\u89E3\u7801\u9519\u8BEF", remark: "\u6D4F\u89C8\u5668\u89E3\u7801\u5F02\u5E38\u4F1A\u629B\u51FA\u6B64\u7C7B\u578B\u9519\u8BEF" }, runtime: { code: 6, msg: "\u8BED\u6CD5\u9519\u8BEF", remark: "\u64AD\u653E\u5668\u8BED\u6CD5\u9519\u8BEF" }, timeout: { code: 7, msg: "\u64AD\u653E\u8D85\u65F6", remark: "\u64AD\u653E\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u6B63\u5E38\u8BF7\u6C42\u4E0B\u4E00\u4E2A\u5206\u6BB5\u5BFC\u81F4\u64AD\u653E\u4E2D\u65AD" }, other: { code: 8, msg: "\u5176\u4ED6\u9519\u8BEF", remark: "\u4E0D\u53EF\u77E5\u7684\u9519\u8BEF\u6216\u88AB\u5FFD\u7565\u7684\u9519\u8BEF\u7C7B\u578B" } }; var Errors = function Errors2(type, currentTime, duration, networkState, readyState, src, currentSrc, ended) { var errd = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : { line: "", handle: "", msg: "", version: "" }; var errorCode = arguments[9]; var mediaError = arguments[10]; _classCallCheck2(this, Errors2); var r = {}; if (arguments.length > 1) { r.playerVersion = _version.version; r.errorType = type; r.domain = document.domain; r.duration = duration; r.currentTime = currentTime; r.networkState = networkState; r.readyState = readyState; r.currentSrc = currentSrc; r.src = src; r.ended = ended; r.errd = errd; r.ex = (ErrorTypes[type] || {}).msg; r.errorCode = errorCode; r.mediaError = mediaError; } else { var arg = arguments[0]; Object.keys(arg).map(function(key) { r[key] = arg[key]; }); r.ex = (arg.type && ErrorTypes[arg.type] || {}).msg; } return r; }; exports2.default = Errors; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var sniffer2 = {}; Object.defineProperty(sniffer2, "device", { get: function get5() { var r = sniffer2.os; return r.isPc ? "pc" : "mobile"; } }); Object.defineProperty(sniffer2, "browser", { get: function get5() { var ua = navigator.userAgent.toLowerCase(); var reg = { ie: /rv:([\d.]+)\) like gecko/, firfox: /firefox\/([\d.]+)/, chrome: /chrome\/([\d.]+)/, opera: /opera.([\d.]+)/, safari: /version\/([\d.]+).*safari/ }; return [].concat(Object.keys(reg).filter(function(key) { return reg[key].test(ua); }))[0] || ""; } }); Object.defineProperty(sniffer2, "os", { get: function get5() { var ua = navigator.userAgent; var isWindowsPhone = /(?:Windows Phone)/.test(ua); var isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone; var isAndroid = /(?:Android)/.test(ua); var isFireFox = /(?:Firefox)/.test(ua); var isTablet = /(?:iPad|PlayBook)/.test(ua) || isAndroid && !/(?:Mobile)/.test(ua) || isFireFox && /(?:Tablet)/.test(ua); var isPhone = /(?:iPhone)/.test(ua) && !isTablet; var isPc = !isPhone && !isAndroid && !isSymbian && !isTablet; return { isTablet, isPhone, isAndroid, isPc, isSymbian, isWindowsPhone, isFireFox }; } }); exports2.default = sniffer2; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var _undefined = void 0; module2.exports = function(value) { return value !== _undefined && value !== null; }; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _createClass2 = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var XgplayerTimeRange = function() { function XgplayerTimeRange2(bufferedList) { _classCallCheck2(this, XgplayerTimeRange2); this.bufferedList = bufferedList; } _createClass2(XgplayerTimeRange2, [{ key: "start", value: function start2(index2) { return this.bufferedList[index2].start; } }, { key: "end", value: function end(index2) { return this.bufferedList[index2].end; } }, { key: "length", get: function get5() { return this.bufferedList.length; } }]); return XgplayerTimeRange2; }(); exports2.default = XgplayerTimeRange; module2.exports = exports2["default"]; }, function(module2) { module2.exports = JSON.parse('{"version":"2.31.6"}'); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _createClass2 = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get2 = function get5(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === void 0) { var parent = Object.getPrototypeOf(object); if (parent === null) { return void 0; } else { return get5(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === void 0) { return void 0; } return getter.call(receiver); } }; var _proxy = __webpack_require__(11); var _proxy2 = _interopRequireDefault2(_proxy); var _util = __webpack_require__(0); var _sniffer = __webpack_require__(5); var _sniffer2 = _interopRequireDefault2(_sniffer); var _xgplayerTimeRange = __webpack_require__(7); var _xgplayerTimeRange2 = _interopRequireDefault2(_xgplayerTimeRange); var _error = __webpack_require__(4); var _error2 = _interopRequireDefault2(_error); var _allOff = __webpack_require__(31); var _allOff2 = _interopRequireDefault2(_allOff); var _i18n = __webpack_require__(10); var _i18n2 = _interopRequireDefault2(_i18n); __webpack_require__(34); var _version = __webpack_require__(8); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn2(self2, call) { if (!self2) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self2; } function _inherits2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Player2 = function(_Proxy) { _inherits2(Player3, _Proxy); function Player3(options) { _classCallCheck2(this, Player3); var _this = _possibleConstructorReturn2(this, (Player3.__proto__ || Object.getPrototypeOf(Player3)).call(this, options)); _this.config = (0, _util.deepCopy)({ width: 600, height: 337.5, ignores: [], whitelist: [], lang: (document.documentElement.getAttribute("lang") || navigator.language || "zh-cn").toLocaleLowerCase(), inactive: 3e3, volume: 0.6, controls: true, controlsList: ["nodownload"] }, options); _this.version = _version.version; _this.userTimer = null; _this.waitTimer = null; _this.history = []; _this.isProgressMoving = false; _this.root = (0, _util.findDom)(document, "#" + _this.config.id); _this.controls = (0, _util.createDom)("xg-controls", "", { unselectable: "on", onselectstart: "return false" }, "xgplayer-controls"); if (_this.config.isShowControl) { _this.controls.style.display = "none"; } if (!_this.root) { var el = _this.config.el; if (el && el.nodeType === 1) { _this.root = el; } else { var _ret; _this.emit("error", new _error2.default({ type: "use", errd: { line: 45, handle: "Constructor", msg: "container id can't be empty" }, vid: _this.config.vid })); console.error("container id can't be empty"); return _ret = false, _possibleConstructorReturn2(_this, _ret); } } (0, _util.addClass)(_this.root, "xgplayer xgplayer-" + _sniffer2.default.device + " xgplayer-nostart xgplayer-pause " + (_this.config.controls ? "" : "xgplayer-no-controls")); _this.root.appendChild(_this.controls); if (_this.config.fluid) { _this.root.style["max-width"] = "100%"; _this.root.style["width"] = "100%"; _this.root.style["height"] = "0"; _this.root.style["padding-top"] = _this.config.height * 100 / _this.config.width + "%"; _this.video.style["position"] = "absolute"; _this.video.style["top"] = "0"; _this.video.style["left"] = "0"; } else { if (_this.config.width) { if (typeof _this.config.width !== "number") { _this.root.style.width = _this.config.width; } else { _this.root.style.width = _this.config.width + "px"; } } if (_this.config.height) { if (typeof _this.config.height !== "number") { _this.root.style.height = _this.config.height; } else { _this.root.style.height = _this.config.height + "px"; } } } if (_this.config.execBeforePluginsCall) { _this.config.execBeforePluginsCall.forEach(function(item) { item.call(_this, _this); }); } if (!_this.config.closeI18n) { Player3.install(_i18n2.default.name, _i18n2.default.method); } if (_this.config.controlStyle && (0, _util.typeOf)(_this.config.controlStyle) === "String") { var self2 = _this; fetch(self2.config.controlStyle, { method: "GET", headers: { Accept: "application/json" } }).then(function(res) { if (res.ok) { res.json().then(function(obj) { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { self2.config[prop] = obj[prop]; } } self2.pluginsCall(); }); } }).catch(function(err) { console.log("Fetch\u9519\u8BEF:" + err); }); } else { _this.pluginsCall(); } if (_this.config.controlPlugins) { Player3.controlsRun(_this.config.controlPlugins, _this); } _this.ev.forEach(function(item) { var evName = Object.keys(item)[0]; var evFunc = _this[item[evName]]; if (evFunc) { _this.on(evName, evFunc); } }); ["focus", "blur"].forEach(function(item) { _this.on(item, _this["on" + item.charAt(0).toUpperCase() + item.slice(1)]); }); var player = _this; _this.mousemoveFunc = function() { player.emit("focus"); if (!player.config.closeFocusVideoFocus) { player.video.focus(); } }; _this.root.addEventListener("mousemove", _this.mousemoveFunc); _this.playFunc = function() { player.emit("focus"); if (!player.config.closePlayVideoFocus) { player.video.focus(); } }; player.once("play", _this.playFunc); _this.getVideoSize = function() { if (this.video.videoWidth && this.video.videoHeight) { var containerSize = player.root.getBoundingClientRect(); if (player.config.fitVideoSize === "auto") { if (containerSize.width / containerSize.height > this.video.videoWidth / this.video.videoHeight) { player.root.style.height = this.video.videoHeight / this.video.videoWidth * containerSize.width + "px"; } else { player.root.style.width = this.video.videoWidth / this.video.videoHeight * containerSize.height + "px"; } } else if (player.config.fitVideoSize === "fixWidth") { player.root.style.height = this.video.videoHeight / this.video.videoWidth * containerSize.width + "px"; } else if (player.config.fitVideoSize === "fixHeight") { player.root.style.width = this.video.videoWidth / this.video.videoHeight * containerSize.height + "px"; } } }; player.once("loadeddata", _this.getVideoSize); setTimeout(function() { _this.emit("ready"); _this.isReady = true; }, 0); if (_this.config.videoInit) { if ((0, _util.hasClass)(_this.root, "xgplayer-nostart")) { _this.start(); } } if (player.config.rotate) { player.on("requestFullscreen", _this.updateRotateDeg); player.on("exitFullscreen", _this.updateRotateDeg); } function onDestroy() { player.root.removeEventListener("mousemove", player.mousemoveFunc); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); return _this; } _createClass2(Player3, [{ key: "attachVideo", value: function attachVideo() { var _this2 = this; if (this.video && this.video.nodeType === 1) { this.root.insertBefore(this.video, this.root.firstChild); } setTimeout(function() { _this2.emit("complete"); if (_this2.danmu && typeof _this2.danmu.resize === "function") { _this2.danmu.resize(); } }, 1); } }, { key: "start", value: function start2() { var _this3 = this; var url = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.config.url; if (!this.video) return; var player = this; if (!url || url === "") { this.emit("urlNull"); return; } this.canPlayFunc = function() { player.off("canplay", player.canPlayFunc); var playPromise = player.video.play(); if (playPromise !== void 0 && playPromise) { playPromise.then(function() { player.emit("autoplay started"); }).catch(function() { player.emit("autoplay was prevented"); (0, _util.addClass)(player.root, "xgplayer-is-autoplay"); }); } }; if ((0, _util.typeOf)(url) !== "Array") { if ((0, _util.typeOf)(url) === "String" && url.indexOf("blob:") > -1 && url === this.video.src) ; else { this.video.src = url; } } else { url.forEach(function(item) { _this3.video.appendChild((0, _util.createDom)("source", "", { src: "" + item.src, type: "" + (item.type || "") })); }); } if (this.config.autoplay) { if (_sniffer2.default.os.isPhone) { this.canPlayFunc(); } else { this.on("canplay", this.canPlayFunc); } } if (!this.config.disableStartLoad) { this.video.load(); } this.attachVideo(); } }, { key: "reload", value: function reload2() { this.video.load(); this.reloadFunc = function() { var playPromise = this.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } }; this.once("loadeddata", this.reloadFunc); } }, { key: "destroy", value: function destroy() { var _this4 = this; var isDelDom = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; var player = this; clearInterval(this.bulletResizeTimer); for (var k in this._interval) { clearInterval(this._interval[k]); this._interval[k] = null; } if (this.checkTimer) { clearInterval(this.checkTimer); } if (this.waitTimer) { clearTimeout(this.waitTimer); } this.ev.forEach(function(item) { var evName = Object.keys(item)[0]; var evFunc = _this4[item[evName]]; if (evFunc) { _this4.off(evName, evFunc); } }); if (this.loadeddataFunc) { this.off("loadeddata", this.loadeddataFunc); } if (this.reloadFunc) { this.off("loadeddata", this.reloadFunc); } if (this.replayFunc) { this.off("play", this.replayFunc); } if (this.playFunc) { this.off("play", this.playFunc); } if (this.getVideoSize) { this.off("loadeddata", this.getVideoSize); } ["focus", "blur"].forEach(function(item) { _this4.off(item, _this4["on" + item.charAt(0).toUpperCase() + item.slice(1)]); }); if (!this.config.keyShortcut || this.config.keyShortcut === "on") { ["video", "controls"].forEach(function(item) { if (_this4[item]) { _this4[item].removeEventListener("keydown", function(e) { player.onKeydown(e, player); }); } }); } function destroyFunc() { this.emit("destroy"); this.video.removeAttribute("src"); this.video.load(); if (isDelDom) { this.root.innerHTML = ""; var classNameList = this.root.className.split(" "); if (classNameList.length > 0) { this.root.className = classNameList.filter(function(name) { return name.indexOf("xgplayer") < 0; }).join(" "); } else { this.root.className = ""; } } for (var _k in this) { delete this[_k]; } (0, _allOff2.default)(this); } if (!this.paused) { this.pause(); this.once("pause", destroyFunc); } else { destroyFunc.call(this); } _get2(Player3.prototype.__proto__ || Object.getPrototypeOf(Player3.prototype), "destroy", this).call(this); } }, { key: "replay", value: function replay2() { var _replay = this._replay; (0, _util.removeClass)(this.root, "xgplayer-ended"); if (_sniffer2.default.browser.indexOf("ie") > -1) { this.emit("play"); this.emit("playing"); } if (_replay && _replay instanceof Function) { _replay(); } else { this.currentTime = 0; var playPromise = this.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } } }, { key: "userGestureTrigEvent", value: function userGestureTrigEvent(name, param) { var _this5 = this; var defaultUserGestureEventHandler = function defaultUserGestureEventHandler2(name2, param2) { _this5.emit(name2, param2); }; if (this.config.userGestureEventMiddleware && typeof this.config.userGestureEventMiddleware[name] === "function") { this.config.userGestureEventMiddleware[name].call(this, this, name, param, defaultUserGestureEventHandler); } else { defaultUserGestureEventHandler.call(this, name, param); } } }, { key: "pluginsCall", value: function pluginsCall() { var _this6 = this; if (Player3.plugins["s_i18n"]) { Player3.plugins["s_i18n"].call(this, this); } var self2 = this; if (Player3.plugins) { var ignores = this.config.ignores; Object.keys(Player3.plugins).forEach(function(name) { var descriptor = Player3.plugins[name]; if (!descriptor || typeof descriptor !== "function") { console.warn("plugin name", name, "is invalid"); } else { if (!ignores.some(function(item) { return name === item || name === "s_" + item; }) && name !== "s_i18n") { if (["pc", "tablet", "mobile"].some(function(type) { return type === name; })) { if (name === _sniffer2.default.device) { setTimeout(function() { if (!self2.video) return; descriptor.call(self2, self2); }, 0); } } else { descriptor.call(_this6, _this6); } } } }); } } }, { key: "onFocus", value: function onFocus() { var player = this; if ((0, _util.hasClass)(this.root, "xgplayer-inactive")) { player.emit("controlShow"); } (0, _util.removeClass)(this.root, "xgplayer-inactive"); if (player.userTimer) { clearTimeout(player.userTimer); } player.userTimer = setTimeout(function() { player.emit("blur"); }, player.config.inactive); } }, { key: "onBlur", value: function onBlur() { if ((this.config.enablePausedInactive || !this.paused) && !this.ended && !this.config.closeInactive) { if (!(0, _util.hasClass)(this.root, "xgplayer-inactive")) { this.emit("controlHide"); } (0, _util.addClass)(this.root, "xgplayer-inactive"); } } }, { key: "onPlay", value: function onPlay() { (0, _util.addClass)(this.root, "xgplayer-isloading"); (0, _util.addClass)(this.root, "xgplayer-playing"); (0, _util.removeClass)(this.root, "xgplayer-pause"); } }, { key: "onPause", value: function onPause() { (0, _util.addClass)(this.root, "xgplayer-pause"); if (this.userTimer) { clearTimeout(this.userTimer); } this.emit("focus"); } }, { key: "onEnded", value: function onEnded() { (0, _util.addClass)(this.root, "xgplayer-ended"); (0, _util.removeClass)(this.root, "xgplayer-playing"); } }, { key: "onSeeking", value: function onSeeking() { this.isSeeking = true; this.onWaiting(); } }, { key: "onSeeked", value: function onSeeked() { var _this7 = this; this.once("timeupdate", function() { _this7.isSeeking = false; }); if (this.waitTimer) { clearTimeout(this.waitTimer); } (0, _util.removeClass)(this.root, "xgplayer-isloading"); } }, { key: "onWaiting", value: function onWaiting() { var self2 = this; if (self2.waitTimer) { clearTimeout(self2.waitTimer); } if (self2.checkTimer) { clearInterval(self2.checkTimer); self2.checkTimer = null; } var time2 = self2.currentTime; self2.waitTimer = setTimeout(function() { (0, _util.addClass)(self2.root, "xgplayer-isloading"); self2.checkTimer = setInterval(function() { if (self2.currentTime !== time2) { (0, _util.removeClass)(self2.root, "xgplayer-isloading"); clearInterval(self2.checkTimer); self2.checkTimer = null; } }, 1e3); }, 500); } }, { key: "onPlaying", value: function onPlaying() { if (this.paused) { return; } this.isSeeking = false; if (this.waitTimer) { clearTimeout(this.waitTimer); } (0, _util.removeClass)(this.root, "xgplayer-isloading xgplayer-nostart xgplayer-pause xgplayer-ended xgplayer-is-error xgplayer-replay"); (0, _util.addClass)(this.root, "xgplayer-playing"); } }], [{ key: "install", value: function install(name, descriptor) { if (!(0, _util.checkIsBrowser)()) { return; } if (!Player3.plugins) { Player3.plugins = {}; } if (!Player3.plugins[name]) { Player3.plugins[name] = descriptor; } } }, { key: "installAll", value: function installAll(list) { for (var k = 0; k < list.length; k++) { Player3.install(list[k].name, list[k].method); } } }, { key: "use", value: function use(name, descriptor) { if (!Player3.plugins) { Player3.plugins = {}; } Player3.plugins[name] = descriptor; } }, { key: "useAll", value: function useAll(list) { for (var k in list) { Player3.use(list[k].name, list[k].method); } } }, { key: "controlsRun", value: function controlsRun(controlLst, context) { controlLst.forEach(function(control) { control.method.call(context); }); } }]); return Player3; }(_proxy2.default); Player2.util = _util.util; Player2.sniffer = _sniffer2.default; Player2.Errors = _error2.default; Player2.XgplayerTimeRange = _xgplayerTimeRange2.default; exports2.default = Player2; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var s_i18n = function s_i18n2() { var player = this; var lang = {}; lang.en = { HAVE_NOTHING: "There is no information on whether audio/video is ready", HAVE_METADATA: "Audio/video metadata is ready ", HAVE_CURRENT_DATA: "Data about the current play location is available, but there is not enough data to play the next frame/millisecond", HAVE_FUTURE_DATA: "Current and at least one frame of data is available", HAVE_ENOUGH_DATA: "The available data is sufficient to start playing", NETWORK_EMPTY: "Audio/video has not been initialized", NETWORK_IDLE: "Audio/video is active and has been selected for resources, but no network is used", NETWORK_LOADING: "The browser is downloading the data", NETWORK_NO_SOURCE: "No audio/video source was found", MEDIA_ERR_ABORTED: "The fetch process is aborted by the user", MEDIA_ERR_NETWORK: "An error occurred while downloading", MEDIA_ERR_DECODE: "An error occurred while decoding", MEDIA_ERR_SRC_NOT_SUPPORTED: "Audio/video is not supported", REPLAY: "Replay", ERROR: "Network is offline", PLAY_TIPS: "Play", PAUSE_TIPS: "Pause", PLAYNEXT_TIPS: "Play next", DOWNLOAD_TIPS: "Download", ROTATE_TIPS: "Rotate", RELOAD_TIPS: "Reload", FULLSCREEN_TIPS: "Fullscreen", EXITFULLSCREEN_TIPS: "Exit fullscreen", CSSFULLSCREEN_TIPS: "Cssfullscreen", EXITCSSFULLSCREEN_TIPS: "Exit cssfullscreen", TEXTTRACK: "Caption", PIP: "Pip", MINIPLAYER: "Miniplayer", SCREENSHOT: "Screenshot", LIVE: "LIVE", OFF: "Off", MINIPLAYER_DRAG: "Click and hold to drag", AIRPLAY_TIPS: "Airplay" }; lang["zh-cn"] = { HAVE_NOTHING: "\u6CA1\u6709\u5173\u4E8E\u97F3\u9891/\u89C6\u9891\u662F\u5426\u5C31\u7EEA\u7684\u4FE1\u606F", HAVE_METADATA: "\u97F3\u9891/\u89C6\u9891\u7684\u5143\u6570\u636E\u5DF2\u5C31\u7EEA", HAVE_CURRENT_DATA: "\u5173\u4E8E\u5F53\u524D\u64AD\u653E\u4F4D\u7F6E\u7684\u6570\u636E\u662F\u53EF\u7528\u7684\uFF0C\u4F46\u6CA1\u6709\u8DB3\u591F\u7684\u6570\u636E\u6765\u64AD\u653E\u4E0B\u4E00\u5E27/\u6BEB\u79D2", HAVE_FUTURE_DATA: "\u5F53\u524D\u53CA\u81F3\u5C11\u4E0B\u4E00\u5E27\u7684\u6570\u636E\u662F\u53EF\u7528\u7684", HAVE_ENOUGH_DATA: "\u53EF\u7528\u6570\u636E\u8DB3\u4EE5\u5F00\u59CB\u64AD\u653E", NETWORK_EMPTY: "\u97F3\u9891/\u89C6\u9891\u5C1A\u672A\u521D\u59CB\u5316", NETWORK_IDLE: "\u97F3\u9891/\u89C6\u9891\u662F\u6D3B\u52A8\u7684\u4E14\u5DF2\u9009\u53D6\u8D44\u6E90\uFF0C\u4F46\u5E76\u672A\u4F7F\u7528\u7F51\u7EDC", NETWORK_LOADING: "\u6D4F\u89C8\u5668\u6B63\u5728\u4E0B\u8F7D\u6570\u636E", NETWORK_NO_SOURCE: "\u672A\u627E\u5230\u97F3\u9891/\u89C6\u9891\u6765\u6E90", MEDIA_ERR_ABORTED: "\u53D6\u56DE\u8FC7\u7A0B\u88AB\u7528\u6237\u4E2D\u6B62", MEDIA_ERR_NETWORK: "\u5F53\u4E0B\u8F7D\u65F6\u53D1\u751F\u9519\u8BEF", MEDIA_ERR_DECODE: "\u5F53\u89E3\u7801\u65F6\u53D1\u751F\u9519\u8BEF", MEDIA_ERR_SRC_NOT_SUPPORTED: "\u4E0D\u652F\u6301\u7684\u97F3\u9891/\u89C6\u9891\u683C\u5F0F", REPLAY: "\u91CD\u64AD", ERROR: "\u7F51\u7EDC\u8FDE\u63A5\u4F3C\u4E4E\u51FA\u73B0\u4E86\u95EE\u9898", PLAY_TIPS: "\u64AD\u653E", PAUSE_TIPS: "\u6682\u505C", PLAYNEXT_TIPS: "\u4E0B\u4E00\u96C6", DOWNLOAD_TIPS: "\u4E0B\u8F7D", ROTATE_TIPS: "\u65CB\u8F6C", RELOAD_TIPS: "\u91CD\u65B0\u8F7D\u5165", FULLSCREEN_TIPS: "\u8FDB\u5165\u5168\u5C4F", EXITFULLSCREEN_TIPS: "\u9000\u51FA\u5168\u5C4F", CSSFULLSCREEN_TIPS: "\u8FDB\u5165\u6837\u5F0F\u5168\u5C4F", EXITCSSFULLSCREEN_TIPS: "\u9000\u51FA\u6837\u5F0F\u5168\u5C4F", TEXTTRACK: "\u5B57\u5E55", PIP: "\u753B\u4E2D\u753B", MINIPLAYER: "\u8FF7\u4F60\u64AD\u653E\u5668", SCREENSHOT: "\u622A\u56FE", LIVE: "\u6B63\u5728\u76F4\u64AD", OFF: "\u5173\u95ED", MINIPLAYER_DRAG: "\u70B9\u51FB\u6309\u4F4F\u53EF\u62D6\u52A8\u89C6\u9891", AIRPLAY_TIPS: "\u9694\u7A7A\u64AD\u653E" }; lang["zh-hk"] = { HAVE_NOTHING: "\u6C92\u6709\u95DC\u65BC\u97F3\u983B/\u8996\u983B\u662F\u5426\u5C31\u7DD2\u7684\u4FE1\u606F", HAVE_METADATA: "\u97F3\u983B/\u8996\u983B\u7684\u5143\u6578\u64DA\u5DF2\u5C31\u7DD2", HAVE_CURRENT_DATA: "\u95DC\u65BC\u7576\u524D\u64AD\u653E\u4F4D\u7F6E\u7684\u6578\u64DA\u662F\u53EF\u7528\u7684\uFF0C\u4F46\u6C92\u6709\u8DB3\u5920\u7684\u6578\u64DA\u4F86\u64AD\u653E\u4E0B\u58F9\u5E40/\u6BEB\u79D2", HAVE_FUTURE_DATA: "\u7576\u524D\u53CA\u81F3\u5C11\u4E0B\u58F9\u5E40\u7684\u6578\u64DA\u662F\u53EF\u7528\u7684", HAVE_ENOUGH_DATA: "\u53EF\u7528\u6578\u64DA\u8DB3\u4EE5\u958B\u59CB\u64AD\u653E", NETWORK_EMPTY: "\u97F3\u983B/\u8996\u983B\u5C1A\u672A\u521D\u59CB\u5316", NETWORK_IDLE: "\u97F3\u983B/\u8996\u983B\u662F\u6D3B\u52D5\u7684\u4E14\u5DF2\u9078\u53D6\u8CC7\u6E90\uFF0C\u4F46\u4E26\u672A\u4F7F\u7528\u7DB2\u7D61", NETWORK_LOADING: "\u700F\u89BD\u5668\u6B63\u5728\u4E0B\u8F09\u6578\u64DA", NETWORK_NO_SOURCE: "\u672A\u627E\u5230\u97F3\u983B/\u8996\u983B\u4F86\u6E90", MEDIA_ERR_ABORTED: "\u53D6\u56DE\u904E\u7A0B\u88AB\u7528\u6236\u4E2D\u6B62", MEDIA_ERR_NETWORK: "\u7576\u4E0B\u8F09\u6642\u767C\u751F\u932F\u8AA4", MEDIA_ERR_DECODE: "\u7576\u89E3\u78BC\u6642\u767C\u751F\u932F\u8AA4", MEDIA_ERR_SRC_NOT_SUPPORTED: "\u4E0D\u652F\u6301\u7684\u97F3\u983B/\u8996\u983B\u683C\u5F0F", REPLAY: "\u91CD\u64AD", ERROR: "\u7DB2\u7D61\u9023\u63A5\u4F3C\u4E4E\u51FA\u73FE\u4E86\u554F\u984C", PLAY_TIPS: "\u64AD\u653E", PAUSE_TIPS: "\u66AB\u505C", PLAYNEXT_TIPS: "\u4E0B\u58F9\u96C6", DOWNLOAD_TIPS: "\u4E0B\u8F09", ROTATE_TIPS: "\u65CB\u8F49", RELOAD_TIPS: "\u91CD\u65B0\u8F09\u5165", FULLSCREEN_TIPS: "\u9032\u5165\u5168\u5C4F", EXITFULLSCREEN_TIPS: "\u9000\u51FA\u5168\u5C4F", CSSFULLSCREEN_TIPS: "\u9032\u5165\u6A23\u5F0F\u5168\u5C4F", EXITCSSFULLSCREEN_TIPS: "\u9000\u51FA\u6A23\u5F0F\u5168\u5C4F", TEXTTRACK: "\u5B57\u5E55", PIP: "\u756B\u4E2D\u756B", MINIPLAYER: "\u8FF7\u59B3\u64AD\u653E\u5668", SCREENSHOT: "\u622A\u5716", LIVE: "\u6B63\u5728\u76F4\u64AD", OFF: "\u95DC\u9589", MINIPLAYER_DRAG: "\u9EDE\u64CA\u6309\u4F4F\u53EF\u62D6\u52D5\u8996\u983B", AIRPLAY_TIPS: "\u9694\u7A7A\u64AD\u653E" }; lang["jp"] = { HAVE_NOTHING: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA\u304C\u6E96\u5099\u3067\u304D\u3066\u3044\u308B\u304B\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093", HAVE_METADATA: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u306F\u6E96\u5099\u3067\u304D\u3066\u3044\u307E\u3059", HAVE_CURRENT_DATA: "\u73FE\u5728\u306E\u518D\u751F\u4F4D\u7F6E\u306B\u95A2\u3059\u308B\u30C7\u30FC\u30BF\u306F\u5229\u7528\u53EF\u80FD\u3067\u3059\u304C\u3001\u6B21\u306E\u30D5\u30EC\u30FC\u30E0/\u30DF\u30EA\u79D2\u3092\u518D\u751F\u3059\u308B\u306E\u306B\u5341\u5206\u306A\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093", HAVE_FUTURE_DATA: "\u73FE\u5728\u3001\u5C11\u306A\u304F\u3068\u3082\u6B21\u306E\u30D5\u30EC\u30FC\u30E0\u306E\u30C7\u30FC\u30BF\u304C\u5229\u7528\u53EF\u80FD\u3067\u3059", HAVE_ENOUGH_DATA: "\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30FC\u30BF\u306F\u518D\u751F\u3092\u958B\u59CB\u3059\u308B\u306E\u306B\u5341\u5206\u3067\u3059", NETWORK_EMPTY: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA\u304C\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093", NETWORK_IDLE: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA\u306F\u30A2\u30AF\u30C6\u30A3\u30D6\u3067\u30EA\u30BD\u30FC\u30B9\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u305B\u3093", NETWORK_LOADING: "\u30D6\u30E9\u30A6\u30B6\u30FC\u306F\u30C7\u30FC\u30BF\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u3044\u307E\u3059", NETWORK_NO_SOURCE: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093", MEDIA_ERR_ABORTED: "\u30E6\u30FC\u30B6\u30FC\u306B\u3088\u3063\u3066\u30D5\u30A7\u30C3\u30C1\u30D7\u30ED\u30BB\u30B9\u304C\u4E2D\u6B62\u3055\u308C\u307E\u3057\u305F", MEDIA_ERR_NETWORK: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F", MEDIA_ERR_DECODE: "\u30C7\u30B3\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F", MEDIA_ERR_SRC_NOT_SUPPORTED: "\u30AA\u30FC\u30C7\u30A3\u30AA/\u30D3\u30C7\u30AA \u306E\u5F62\u5F0F\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093", REPLAY: "\u30EA\u30D7\u30EC\u30A4", ERROR: "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u306E\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F", PLAY_TIPS: "\u30D7\u30EC\u30A4", PAUSE_TIPS: "\u4E00\u6642\u505C\u6B62", PLAYNEXT_TIPS: "\u6B21\u3092\u30D7\u30EC\u30A4", DOWNLOAD_TIPS: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9", ROTATE_TIPS: "\u56DE\u8EE2", RELOAD_TIPS: "\u518D\u8AAD\u307F\u8FBC\u307F", FULLSCREEN_TIPS: "\u30D5\u30EB\u30B9\u30AF\u30EA\u30FC\u30F3", EXITFULLSCREEN_TIPS: "\u30D5\u30EB\u30B9\u30AF\u30EA\u30FC\u30F3\u3092\u7D42\u4E86", CSSFULLSCREEN_TIPS: "\u30B7\u30A2\u30BF\u30FC\u30E2\u30FC\u30C9", EXITCSSFULLSCREEN_TIPS: "\u30B7\u30A2\u30BF\u30FC\u30E2\u30FC\u30C9\u3092\u7D42\u4E86", TEXTTRACK: "\u5B57\u5E55", PIP: "\u30DF\u30CB\u30D7\u30EC\u30FC\u30E4\u30FC", MINIPLAYER: "\u30DF\u30CB\u30D7\u30EC\u30FC\u30E4\u30FC", SCREENSHOT: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8", LIVE: "\u751F\u653E\u9001", OFF: "\u30AA\u30D5", MINIPLAYER_DRAG: "\u30DC\u30BF\u30F3\u3092\u62BC\u3057\u3066\u50CD\u753B\u3092\u30C9\u30E9\u30C3\u30B0\u3059\u308B", AIRPLAY_TIPS: "\u9694\u7A7A\u653E\u9001" }; Object.defineProperty(player, "lang", { get: function get5() { if (player.config) { return lang[player.config.lang] || lang["en"]; } else { return lang["en"]; } }, set: function set2(value) { if ((0, _util.typeOf)(value) === "Object") { Object.keys(value).forEach(function(key) { lang[key] = value[key]; }); } } }); }; exports2.default = { name: "s_i18n", method: s_i18n }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _createClass2 = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _eventEmitter = __webpack_require__(12); var _eventEmitter2 = _interopRequireDefault2(_eventEmitter); var _util = __webpack_require__(0); var _error = __webpack_require__(4); var _error2 = _interopRequireDefault2(_error); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Proxy = function() { function Proxy2(options) { var _this = this; _classCallCheck2(this, Proxy2); this._hasStart = false; this.videoConfig = { controls: !!options.isShowControl, autoplay: options.autoplay, playsinline: options.playsinline, "webkit-playsinline": options.playsinline, "x5-playsinline": options.playsinline, "x5-video-player-type": options["x5-video-player-type"] || options["x5VideoPlayerType"], "x5-video-player-fullscreen": options["x5-video-player-fullscreen"] || options["x5VideoPlayerFullscreen"], "x5-video-orientation": options["x5-video-orientation"] || options["x5VideoOrientation"], airplay: options["airplay"], "webkit-airplay": options["airplay"], tabindex: 2, mediaType: options.mediaType || "video" }; if (options.muted) { this.videoConfig.muted = "muted"; } if (options.loop) { this.videoConfig.loop = "loop"; } var textTrackDom = ""; this.textTrackShowDefault = true; if (options.nativeTextTrack && Array.isArray(options.nativeTextTrack)) { if (options.nativeTextTrack.length > 0 && !options.nativeTextTrack.some(function(track) { return track.default; })) { options.nativeTextTrack[0].default = true; this.textTrackShowDefault = false; } options.nativeTextTrack.some(function(track) { if (track.src && track.label && track.default) { textTrackDom += '"; return true; } }); this.videoConfig.crossorigin = "anonymous"; } if (options.textTrackStyle) { var style = document.createElement("style"); this.textTrackStyle = style; document.head.appendChild(style); var styleStr = ""; for (var index2 in options.textTrackStyle) { styleStr += index2 + ": " + options.textTrackStyle[index2] + ";"; } var wrap = options.id ? "#" + options.id : options.el.id ? "#" + options.el.id : "." + options.el.className; if (style.sheet.insertRule) { style.sheet.insertRule(wrap + " video::cue { " + styleStr + " }", 0); } else if (style.sheet.addRule) { style.sheet.addRule(wrap + " video::cue", styleStr); } } var el = options.el ? options.el : (0, _util.findDom)(document, "#" + options.id); var XgVideoProxy = this.constructor.XgVideoProxy; if (XgVideoProxy && this.videoConfig.mediaType === XgVideoProxy.mediaType) { this.video = new XgVideoProxy(el, options); } else { this.video = (0, _util.createDom)(this.videoConfig.mediaType, textTrackDom, this.videoConfig, ""); } if (options.videoStyle) { Object.keys(options.videoStyle).forEach(function(key) { (0, _util.setStyle)(_this.video, key, options.videoStyle[key]); }); } if (!this.textTrackShowDefault && textTrackDom) { var trackDoms = this.video.getElementsByTagName("Track"); trackDoms[0].track.mode = "hidden"; } if (options.autoplay) { this.video.autoplay = true; if (options.autoplayMuted) { this.video.muted = true; } } this.ev = ["play", "playing", "pause", "ended", "error", "seeking", "seeked", "progress", "timeupdate", "waiting", "canplay", "canplaythrough", "durationchange", "volumechange", "ratechange", "loadedmetadata", "loadeddata", "loadstart"].map(function(item) { return _defineProperty({}, item, "on" + item.charAt(0).toUpperCase() + item.slice(1)); }); (0, _eventEmitter2.default)(this); this._interval = {}; var lastBuffer = "0,0"; var self2 = this; var defaultVideoEventHandler = function defaultVideoEventHandler2(name) { if (!_this) { return; } if (name === "play") { _this.hasStart = true; } else if (name === "canplay") { (0, _util.removeClass)(_this.root, "xgplayer-is-enter"); } else if (name === "waiting") { _this.inWaitingStart = new Date().getTime(); } else if (name === "playing") { (0, _util.removeClass)(_this.root, "xgplayer-is-enter"); if (_this.inWaitingStart) { _this.inWaitingStart = void 0; } } if (name === "error") { _this._onError(name); } else { _this.emit(name, _this); } if (_this.hasOwnProperty("_interval")) { if (["ended", "error", "timeupdate"].indexOf(name) < 0) { (0, _util._clearInterval)(_this, "bufferedChange"); (0, _util._setInterval)(_this, "bufferedChange", function() { if (this.video && this.video.buffered) { var curBuffer = []; for (var i = 0, len = this.video.buffered.length; i < len; i++) { curBuffer.push([this.video.buffered.start(i), this.video.buffered.end(i)]); } if (curBuffer.toString() !== lastBuffer) { lastBuffer = curBuffer.toString(); this.emit("bufferedChange", curBuffer); } } }, 200); } else { if (name !== "timeupdate") { (0, _util._clearInterval)(_this, "bufferedChange"); } } } }; var videoEventHandler = function videoEventHandler2(name) { if (options.videoEventMiddleware && typeof options.videoEventMiddleware[name] === "function") { options.videoEventMiddleware[name].call(_this, _this, name, defaultVideoEventHandler); } else { defaultVideoEventHandler.call(_this, name); } }; this.ev.forEach(function(item) { self2.evItem = Object.keys(item)[0]; var name = Object.keys(item)[0]; self2.video.addEventListener(Object.keys(item)[0], videoEventHandler.bind(self2, name)); }); } _createClass2(Proxy2, [{ key: "_onError", value: function _onError(name) { if (this.video && this.video.error) { this.emit(name, new _error2.default("other", this.currentTime, this.duration, this.networkState, this.readyState, this.currentSrc, this.src, this.ended, { line: 162, msg: this.error, handle: "Constructor" }, this.video.error.code, this.video.error)); } } }, { key: "destroy", value: function destroy() { if (this.textTrackStyle) { this.textTrackStyle.parentNode.removeChild(this.textTrackStyle); } } }, { key: "play", value: function play2() { return this.video.play(); } }, { key: "pause", value: function pause() { this.video.pause(); } }, { key: "canPlayType", value: function canPlayType(type) { return this.video.canPlayType(type); } }, { key: "getBufferedRange", value: function getBufferedRange(buffered) { var range = [0, 0]; var video = this.video; if (!buffered) buffered = video.buffered; var currentTime = video.currentTime; if (buffered) { for (var i = 0, len = buffered.length; i < len; i++) { range[0] = buffered.start(i); range[1] = buffered.end(i); if (range[0] <= currentTime && currentTime <= range[1]) { break; } } } if (range[0] - currentTime <= 0 && currentTime - range[1] <= 0) { return range; } else { return [0, 0]; } } }, { key: "proxyOn", value: function proxyOn(event2, fn) { (0, _util.on)(this, event2, fn, "destroy"); } }, { key: "proxyOnce", value: function proxyOnce(event2, fn) { (0, _util.once)(this, event2, fn, "destroy"); } }, { key: "hasStart", get: function get5() { return this._hasStart; }, set: function set2(bool) { if (typeof bool === "boolean" && bool === true && !this._hasStart) { this._hasStart = true; this.emit("hasstart"); } } }, { key: "autoplay", set: function set2(isTrue) { if (this.video) { this.video.autoplay = isTrue; } }, get: function get5() { if (this.video) { return this.video.autoplay; } else { return false; } } }, { key: "buffered", get: function get5() { if (this.video) { return this.video.buffered; } else { return void 0; } } }, { key: "buffered2", get: function get5() { return (0, _util.getBuffered2)(this.video.buffered); } }, { key: "crossOrigin", get: function get5() { if (this.video) { return this.video.crossOrigin; } else { return false; } }, set: function set2(isTrue) { if (this.video) { this.video.crossOrigin = isTrue; } } }, { key: "currentSrc", get: function get5() { if (this.video) { return this.video.currentSrc; } else { return void 0; } } }, { key: "currentTime", get: function get5() { if (this.video) { return this.video.currentTime || 0; } else { return 0; } }, set: function set2(time2) { var _this2 = this; if (typeof isFinite === "function" && !isFinite(time2)) return; if ((0, _util.hasClass)(this.root, "xgplayer-ended")) { this.once("playing", function() { _this2.video.currentTime = time2; }); this.replay(); } else { this.video.currentTime = time2; } this.emit("currentTimeChange", time2); } }, { key: "defaultMuted", get: function get5() { if (this.video) { return this.video.defaultMuted; } else { return false; } }, set: function set2(isTrue) { if (this.video) { this.video.defaultMuted = isTrue; } } }, { key: "duration", get: function get5() { if (this.config.duration) { if (this.video) return Math.min(this.config.duration, this.video.duration); else return this.config.duration; } if (!this.video) return null; return this.video.duration; } }, { key: "ended", get: function get5() { if (this.video) { return this.video.ended || false; } else { return true; } } }, { key: "error", get: function get5() { var err = this.video.error; if (!err) { return null; } var status = [{ en: "MEDIA_ERR_ABORTED", cn: "\u53D6\u56DE\u8FC7\u7A0B\u88AB\u7528\u6237\u4E2D\u6B62" }, { en: "MEDIA_ERR_NETWORK", cn: "\u5F53\u4E0B\u8F7D\u65F6\u53D1\u751F\u9519\u8BEF" }, { en: "MEDIA_ERR_DECODE", cn: "\u5F53\u89E3\u7801\u65F6\u53D1\u751F\u9519\u8BEF" }, { en: "MEDIA_ERR_SRC_NOT_SUPPORTED", cn: "\u4E0D\u652F\u6301\u97F3\u9891/\u89C6\u9891" }]; return this.lang ? this.lang[status[err.code - 1].en] : status[err.code - 1].en; } }, { key: "loop", get: function get5() { if (this.video) { return this.video.loop; } else { return false; } }, set: function set2(isTrue) { if (this.video) { this.video.loop = isTrue; } } }, { key: "muted", get: function get5() { if (this.video) { return this.video.muted; } else { return false; } }, set: function set2(isTrue) { if (this.video) { this.video.muted = isTrue; } } }, { key: "networkState", get: function get5() { var status = [{ en: "NETWORK_EMPTY", cn: "\u97F3\u9891/\u89C6\u9891\u5C1A\u672A\u521D\u59CB\u5316" }, { en: "NETWORK_IDLE", cn: "\u97F3\u9891/\u89C6\u9891\u662F\u6D3B\u52A8\u7684\u4E14\u5DF2\u9009\u53D6\u8D44\u6E90\uFF0C\u4F46\u5E76\u672A\u4F7F\u7528\u7F51\u7EDC" }, { en: "NETWORK_LOADING", cn: "\u6D4F\u89C8\u5668\u6B63\u5728\u4E0B\u8F7D\u6570\u636E" }, { en: "NETWORK_NO_SOURCE", cn: "\u672A\u627E\u5230\u97F3\u9891/\u89C6\u9891\u6765\u6E90" }]; return this.lang ? this.lang[status[this.video.networkState].en] : status[this.video.networkState].en; } }, { key: "paused", get: function get5() { return (0, _util.hasClass)(this.root, "xgplayer-pause"); } }, { key: "playbackRate", get: function get5() { if (this.video) { return this.video.playbackRate; } else { return 1; } }, set: function set2(rate) { if (this.video) { this.video.playbackRate = rate; } } }, { key: "played", get: function get5() { if (this.video) { return this.video.played; } else { return void 0; } } }, { key: "preload", get: function get5() { if (this.video) { return this.video.preload; } else { return false; } }, set: function set2(isTrue) { if (this.video) { this.video.preload = isTrue; } } }, { key: "readyState", get: function get5() { var status = [{ en: "HAVE_NOTHING", cn: "\u6CA1\u6709\u5173\u4E8E\u97F3\u9891/\u89C6\u9891\u662F\u5426\u5C31\u7EEA\u7684\u4FE1\u606F" }, { en: "HAVE_METADATA", cn: "\u5173\u4E8E\u97F3\u9891/\u89C6\u9891\u5C31\u7EEA\u7684\u5143\u6570\u636E" }, { en: "HAVE_CURRENT_DATA", cn: "\u5173\u4E8E\u5F53\u524D\u64AD\u653E\u4F4D\u7F6E\u7684\u6570\u636E\u662F\u53EF\u7528\u7684\uFF0C\u4F46\u6CA1\u6709\u8DB3\u591F\u7684\u6570\u636E\u6765\u64AD\u653E\u4E0B\u4E00\u5E27/\u6BEB\u79D2" }, { en: "HAVE_FUTURE_DATA", cn: "\u5F53\u524D\u53CA\u81F3\u5C11\u4E0B\u4E00\u5E27\u7684\u6570\u636E\u662F\u53EF\u7528\u7684" }, { en: "HAVE_ENOUGH_DATA", cn: "\u53EF\u7528\u6570\u636E\u8DB3\u4EE5\u5F00\u59CB\u64AD\u653E" }]; return this.lang ? this.lang[status[this.video.readyState].en] : status[this.video.readyState]; } }, { key: "seekable", get: function get5() { if (this.video) { return this.video.seekable; } else { return false; } } }, { key: "seeking", get: function get5() { if (this.video) { return this.video.seeking; } else { return false; } } }, { key: "src", get: function get5() { if (this.video) { return this.video.src; } else { return void 0; } }, set: function set2(url) { if (!(0, _util.hasClass)(this.root, "xgplayer-ended")) { this.emit("urlchange", this.video.src); } (0, _util.removeClass)(this.root, "xgplayer-ended xgplayer-is-replay xgplayer-is-error"); this.video.pause(); this.emit("pause"); this.video.src = url; this.emit("srcChange"); } }, { key: "poster", set: function set2(posterUrl) { var poster2 = (0, _util.findDom)(this.root, ".xgplayer-poster"); if (poster2) { poster2.style.backgroundImage = "url(" + posterUrl + ")"; } } }, { key: "volume", get: function get5() { if (this.video) { return this.video.volume; } else { return 1; } }, set: function set2(vol) { if (this.video) { this.video.volume = vol; } } }, { key: "fullscreen", get: function get5() { return (0, _util.hasClass)(this.root, "xgplayer-is-fullscreen") || (0, _util.hasClass)(this.root, "xgplayer-fullscreen-active"); } }, { key: "bullet", get: function get5() { return (0, _util.findDom)(this.root, "xg-danmu") ? (0, _util.hasClass)((0, _util.findDom)(this.root, "xg-danmu"), "xgplayer-has-danmu") : false; } }, { key: "textTrack", get: function get5() { return (0, _util.hasClass)(this.root, "xgplayer-is-textTrack"); } }, { key: "pip", get: function get5() { return (0, _util.hasClass)(this.root, "xgplayer-pip-active"); } }, { key: "isMiniPlayer", get: function get5() { return (0, _util.hasClass)(this.root, "xgplayer-miniplayer-active"); } }]); return Proxy2; }(); exports2.default = Proxy; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var d = __webpack_require__(13), callable = __webpack_require__(30), apply = Function.prototype.apply, call = Function.prototype.call, create = Object.create, defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, hasOwnProperty2 = Object.prototype.hasOwnProperty, descriptor = { configurable: true, enumerable: false, writable: true }, on, once, off, emit, methods, descriptors, base; on = function(type, listener) { var data; callable(listener); if (!hasOwnProperty2.call(this, "__ee__")) { data = descriptor.value = create(null); defineProperty(this, "__ee__", descriptor); descriptor.value = null; } else { data = this.__ee__; } if (!data[type]) data[type] = listener; else if (typeof data[type] === "object") data[type].push(listener); else data[type] = [data[type], listener]; return this; }; once = function(type, listener) { var once2, self2; callable(listener); self2 = this; on.call(this, type, once2 = function() { off.call(self2, type, once2); apply.call(listener, this, arguments); }); once2.__eeOnceListener__ = listener; return this; }; off = function(type, listener) { var data, listeners, candidate, i; callable(listener); if (!hasOwnProperty2.call(this, "__ee__")) return this; data = this.__ee__; if (!data[type]) return this; listeners = data[type]; if (typeof listeners === "object") { for (i = 0; candidate = listeners[i]; ++i) { if (candidate === listener || candidate.__eeOnceListener__ === listener) { if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; else listeners.splice(i, 1); } } } else { if (listeners === listener || listeners.__eeOnceListener__ === listener) { delete data[type]; } } return this; }; emit = function(type) { var i, l, listener, listeners, args; if (!hasOwnProperty2.call(this, "__ee__")) return; listeners = this.__ee__[type]; if (!listeners) return; if (typeof listeners === "object") { l = arguments.length; args = new Array(l - 1); for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; listeners = listeners.slice(); for (i = 0; listener = listeners[i]; ++i) { apply.call(listener, this, args); } } else { switch (arguments.length) { case 1: call.call(listeners, this); break; case 2: call.call(listeners, this, arguments[1]); break; case 3: call.call(listeners, this, arguments[1], arguments[2]); break; default: l = arguments.length; args = new Array(l - 1); for (i = 1; i < l; ++i) { args[i - 1] = arguments[i]; } apply.call(listeners, this, args); } } }; methods = { on, once, off, emit }; descriptors = { on: d(on), once: d(once), off: d(off), emit: d(emit) }; base = defineProperties({}, descriptors); module2.exports = exports2 = function(o) { return o == null ? create(base) : defineProperties(Object(o), descriptors); }; exports2.methods = methods; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(6), isPlainFunction = __webpack_require__(14), assign = __webpack_require__(18), normalizeOpts = __webpack_require__(26), contains = __webpack_require__(27); var d = module2.exports = function(dscr, value) { var c, e, w, options, desc; if (arguments.length < 2 || typeof dscr !== "string") { options = value; value = dscr; dscr = null; } else { options = arguments[2]; } if (isValue(dscr)) { c = contains.call(dscr, "c"); e = contains.call(dscr, "e"); w = contains.call(dscr, "w"); } else { c = w = true; e = false; } desc = { value, configurable: c, enumerable: e, writable: w }; return !options ? desc : assign(normalizeOpts(options), desc); }; d.gs = function(dscr, get5, set2) { var c, e, options, desc; if (typeof dscr !== "string") { options = set2; set2 = get5; get5 = dscr; dscr = null; } else { options = arguments[3]; } if (!isValue(get5)) { get5 = void 0; } else if (!isPlainFunction(get5)) { options = get5; get5 = set2 = void 0; } else if (!isValue(set2)) { set2 = void 0; } else if (!isPlainFunction(set2)) { options = set2; set2 = void 0; } if (isValue(dscr)) { c = contains.call(dscr, "c"); e = contains.call(dscr, "e"); } else { c = true; e = false; } desc = { get: get5, set: set2, configurable: c, enumerable: e }; return !options ? desc : assign(normalizeOpts(options), desc); }; }, function(module2, exports2, __webpack_require__) { var isFunction = __webpack_require__(15); var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString; module2.exports = function(value) { if (!isFunction(value)) return false; if (classRe.test(functionToString.call(value))) return false; return true; }; }, function(module2, exports2, __webpack_require__) { var isPrototype = __webpack_require__(16); module2.exports = function(value) { if (typeof value !== "function") return false; if (!hasOwnProperty.call(value, "length")) return false; try { if (typeof value.length !== "number") return false; if (typeof value.call !== "function") return false; if (typeof value.apply !== "function") return false; } catch (error2) { return false; } return !isPrototype(value); }; }, function(module2, exports2, __webpack_require__) { var isObject = __webpack_require__(17); module2.exports = function(value) { if (!isObject(value)) return false; try { if (!value.constructor) return false; return value.constructor.prototype === value; } catch (error2) { return false; } }; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(6); var possibleTypes = { "object": true, "function": true, "undefined": true }; module2.exports = function(value) { if (!isValue(value)) return false; return hasOwnProperty.call(possibleTypes, typeof value); }; }, function(module2, exports2, __webpack_require__) { module2.exports = __webpack_require__(19)() ? Object.assign : __webpack_require__(20); }, function(module2, exports2, __webpack_require__) { module2.exports = function() { var assign = Object.assign, obj; if (typeof assign !== "function") return false; obj = { foo: "raz" }; assign(obj, { bar: "dwa" }, { trzy: "trzy" }); return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; }; }, function(module2, exports2, __webpack_require__) { var keys = __webpack_require__(21), value = __webpack_require__(25), max = Math.max; module2.exports = function(dest, src) { var error2, i, length = max(arguments.length, 2), assign; dest = Object(value(dest)); assign = function(key) { try { dest[key] = src[key]; } catch (e) { if (!error2) error2 = e; } }; for (i = 1; i < length; ++i) { src = arguments[i]; keys(src).forEach(assign); } if (error2 !== void 0) throw error2; return dest; }; }, function(module2, exports2, __webpack_require__) { module2.exports = __webpack_require__(22)() ? Object.keys : __webpack_require__(23); }, function(module2, exports2, __webpack_require__) { module2.exports = function() { try { Object.keys("primitive"); return true; } catch (e) { return false; } }; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(3); var keys = Object.keys; module2.exports = function(object) { return keys(isValue(object) ? Object(object) : object); }; }, function(module2, exports2, __webpack_require__) { module2.exports = function() { }; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(3); module2.exports = function(value) { if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); return value; }; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(3); var forEach = Array.prototype.forEach, create = Object.create; var process = function(src, obj) { var key; for (key in src) obj[key] = src[key]; }; module2.exports = function(opts1) { var result = create(null); forEach.call(arguments, function(options) { if (!isValue(options)) return; process(Object(options), result); }); return result; }; }, function(module2, exports2, __webpack_require__) { module2.exports = __webpack_require__(28)() ? String.prototype.contains : __webpack_require__(29); }, function(module2, exports2, __webpack_require__) { var str = "razdwatrzy"; module2.exports = function() { if (typeof str.contains !== "function") return false; return str.contains("dwa") === true && str.contains("foo") === false; }; }, function(module2, exports2, __webpack_require__) { var indexOf = String.prototype.indexOf; module2.exports = function(searchString) { return indexOf.call(this, searchString, arguments[1]) > -1; }; }, function(module2, exports2, __webpack_require__) { module2.exports = function(fn) { if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); return fn; }; }, function(module2, exports2, __webpack_require__) { var value = __webpack_require__(32), hasOwnProperty2 = Object.prototype.hasOwnProperty; module2.exports = function(emitter) { var type = arguments[1], data; value(emitter); if (type !== void 0) { data = hasOwnProperty2.call(emitter, "__ee__") && emitter.__ee__; if (!data) return; if (data[type]) delete data[type]; return; } if (hasOwnProperty2.call(emitter, "__ee__")) delete emitter.__ee__; }; }, function(module2, exports2, __webpack_require__) { var isObject = __webpack_require__(33); module2.exports = function(value) { if (!isObject(value)) throw new TypeError(value + " is not an Object"); return value; }; }, function(module2, exports2, __webpack_require__) { var isValue = __webpack_require__(3); var map = { function: true, object: true }; module2.exports = function(value) { return isValue(value) && map[typeof value] || false; }; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(35); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default{background:#000;width:100%;height:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.xgplayer-skin-default *{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}.xgplayer-skin-default.xgplayer-rotate-fullscreen{position:absolute;top:0;left:100%;bottom:0;right:0;height:100vw!important;width:100vh!important;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.xgplayer-skin-default.xgplayer-is-fullscreen{width:100%!important;height:100%!important;padding-top:0!important;z-index:9999}.xgplayer-skin-default.xgplayer-is-fullscreen.xgplayer-inactive{cursor:none}.xgplayer-skin-default video{width:100%;height:100%;outline:none}.xgplayer-skin-default .xgplayer-none{display:none}@-webkit-keyframes loadingRotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loadingRotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}@keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}.xgplayer-skin-default .xgplayer-controls{display:-webkit-flex;display:-moz-box;display:flex;position:absolute;bottom:0;left:0;right:0;height:40px;background-image:linear-gradient(180deg,transparent,rgba(0,0,0,.37),rgba(0,0,0,.75),rgba(0,0,0,.75));z-index:10}.xgplayer-skin-default.xgplayer-inactive .xgplayer-controls,.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-progress,.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-time,.xgplayer-skin-default.xgplayer-no-controls .xgplayer-controls,.xgplayer-skin-default.xgplayer-nostart .xgplayer-controls{display:none}.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-live{display:block}.xgplayer-skin-default .xgplayer-live{display:block;font-size:12px;color:#fff;line-height:40px;-webkit-order:1;-moz-box-ordinal-group:2;order:1}.xgplayer-skin-default .xgplayer-icon{display:block;width:40px;height:40px;overflow:hidden;fill:#fff}.xgplayer-skin-default .xgplayer-icon svg{position:absolute}.xgplayer-skin-default .xgplayer-tips{background:rgba(0,0,0,.54);border-radius:1px;display:none;position:absolute;font-family:PingFangSC-Regular;font-size:11px;color:#fff;padding:2px 4px;text-align:center;top:-30px;left:50%;margin-left:-16px;width:auto;white-space:nowrap}.xgplayer-skin-default.xgplayer-mobile .xgplayer-tips{display:none!important}.xgplayer-skin-default .xgplayer-screen-container{display:block;width:100%}", ""]); }, function(module2, exports2) { module2.exports = function(css) { var location2 = typeof window !== "undefined" && window.location; if (!location2) { throw new Error("fixUrls requires window.location"); } if (!css || typeof css !== "string") { return css; } var baseUrl = location2.protocol + "//" + location2.host; var currentDir = baseUrl + location2.pathname.replace(/\/[^\/]*$/, "/"); var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { var unquotedOrigUrl = origUrl.trim().replace(/^"(.*)"$/, function(o, $1) { return $1; }).replace(/^'(.*)'$/, function(o, $1) { return $1; }); if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { return fullMatch; } var newUrl; if (unquotedOrigUrl.indexOf("//") === 0) { newUrl = unquotedOrigUrl; } else if (unquotedOrigUrl.indexOf("/") === 0) { newUrl = baseUrl + unquotedOrigUrl; } else { newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); } return "url(" + JSON.stringify(newUrl) + ")"; }); return fixedCss; }; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var mobile = function mobile2() { var player = this; var root = player.root; var clk = 0; var _click_ = void 0; var clickedTime = { first: "", second: "" }; player.onElementTouchend = function(e, element) { if (!this.config.closeVideoPreventDefault) { e.preventDefault(); } if (!this.config.closeVideoStopPropagation) { e.stopPropagation(); } var player2 = this; if ((0, _util.hasClass)(root, "xgplayer-inactive")) { player2.emit("focus"); } else { player2.emit("blur"); } if (!player2.config.closeVideoTouch && !player2.isTouchMove) { var onTouch = function onTouch2() { _click_ = setTimeout(function() { if ((0, _util.hasClass)(player2.root, "xgplayer-nostart")) { return false; } else if (!player2.ended) { if (player2.paused) { var playPromise = player2.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } else { player2.pause(); } } clk = 0; }, 200); }; if (!player2.config.closeVideoClick) { clk++; if (_click_) { clearTimeout(_click_); } if (clk === 1) { if (player2.config.enableVideoDbltouch) { clickedTime.first = new Date(); } else { onTouch(); } } else if (clk === 2) { if (player2.config.enableVideoDbltouch) { clickedTime.second = new Date(); if (Math.abs(clickedTime.first - clickedTime.second) < 400) { onTouch(); } else { clickedTime.first = new Date(); clk = 1; } } else { clk = 0; } } else { clk = 0; } } } }; function onReady(e) { player.video.addEventListener("touchend", function(e2) { player.onElementTouchend(e2, player.video); }); player.video.addEventListener("touchstart", function() { player.isTouchMove = false; }); player.video.addEventListener("touchmove", function() { player.isTouchMove = true; }); if (player.config.autoplay) { player.start(); } } player.once("ready", onReady); function onDestroy() { player.off("ready", onReady); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "mobile", method: mobile }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var pc = function pc2() { var player = this; if (!player.controls || !player.video) return; var controls = player.controls; var root = player.root; var clk = 0; var _click_ = void 0; player.onElementClick = function(e, element) { if (!this.config.closeVideoPreventDefault) { e.preventDefault(); } if (!this.config.closeVideoStopPropagation) { e.stopPropagation(); } var player2 = this; if (!player2.config.closeVideoClick) { clk++; if (_click_) { clearTimeout(_click_); } if (clk === 1) { _click_ = setTimeout(function() { if ((0, _util.hasClass)(player2.root, "xgplayer-nostart")) { return false; } else if (!player2.ended) { if (player2.paused) { var playPromise = player2.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } else { player2.pause(); } } clk = 0; }, 200); } else { clk = 0; } } }; player.video.addEventListener("click", function(e) { player.onElementClick(e, player.video); }, false); player.onElementDblclick = function(e, element) { if (!this.config.closeVideoPreventDefault) { e.preventDefault(); } if (!this.config.closeVideoStopPropagation) { e.stopPropagation(); } var player2 = this; if (!player2.config.closeVideoDblclick) { var fullscreen2 = controls.querySelector(".xgplayer-fullscreen"); if (fullscreen2) { var _clk = void 0; if (document.createEvent) { _clk = document.createEvent("Event"); _clk.initEvent("click", true, true); } else { _clk = new Event("click"); } fullscreen2.dispatchEvent(_clk); } } }; player.video.addEventListener("dblclick", function(e) { player.onElementDblclick(e, player.video); }, false); function onMouseEnter() { clearTimeout(player.leavePlayerTimer); player.emit("focus", player); } root.addEventListener("mouseenter", onMouseEnter); function onMouseLeave() { if (!player.config.closePlayerBlur) { player.leavePlayerTimer = setTimeout(function() { player.emit("blur", player); }, player.config.leavePlayerTime || 0); } } root.addEventListener("mouseleave", onMouseLeave); function onControlMouseEnter(e) { if (player.userTimer) { clearTimeout(player.userTimer); } } controls.addEventListener("mouseenter", onControlMouseEnter); function onControlMouseLeave(e) { if (!player.config.closeControlsBlur) { player.emit("focus", player); } } controls.addEventListener("mouseleave", onControlMouseLeave); function onControlClick(e) { e.preventDefault(); e.stopPropagation(); } controls.addEventListener("click", onControlClick); function onReady(e) { if (player.config.autoplay) { player.start(); } } player.once("ready", onReady); function onDestroy() { root.removeEventListener("mouseenter", onMouseEnter); root.removeEventListener("mouseleave", onMouseLeave); player.off("ready", onReady); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "pc", method: pc }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var start2 = function start3() { var player = this; var root = player.root; function onCanPlay() { player.off("canplay", onCanPlay); var playPromise = player.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } function onStartBtnClick() { if ((0, _util.hasClass)(root, "xgplayer-nostart")) { (0, _util.removeClass)(root, "xgplayer-nostart"); (0, _util.addClass)(root, "xgplayer-is-enter"); if (typeof root.contains === "function") { if (player.video && player.video.nodeType === 1 && !root.contains(player.video) || player.video && player.video.nodeType !== 1 && player.video.mediaSource === void 0) { player.once("canplay", onCanPlay); player.start(); } else { onCanPlay(); } } else { if (player.video && player.video.nodeType === 1 && !root.querySelector(this.videoConfig.mediaType) || player.video && player.video.nodeType !== 1 && player.video.mediaSource === void 0) { player.once("canplay", onCanPlay); player.start(); } else { onCanPlay(); } } } else { if (player.paused) { (0, _util.removeClass)(root, "xgplayer-nostart xgplayer-isloading"); setTimeout(function() { var playPromise = player.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } }, 10); } } } player.on("startBtnClick", onStartBtnClick); function onDestroy() { player.off("startBtnClick", onStartBtnClick); player.off("canplay", onCanPlay); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "start", method: start2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _startPlay = __webpack_require__(41); var _startPlay2 = _interopRequireDefault2(_startPlay); var _startPause = __webpack_require__(42); var _startPause2 = _interopRequireDefault2(_startPause); __webpack_require__(43); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var s_start2 = function s_start3() { var player = this; var root = player.root; var btn = (0, _util.createDom)("xg-start", '
' + _startPlay2.default + '
\n
' + _startPause2.default + "
", {}, "xgplayer-start"); function onPlayerReady(player2) { (0, _util.addClass)(player2.root, "xgplayer-skin-default"); if (player2.config) { player2.config.autoplay && !(0, _util.isWeiXin)() && !(0, _util.isUc)() && (0, _util.addClass)(player2.root, "xgplayer-is-enter"); if (player2.config.lang && player2.config.lang === "en") { (0, _util.addClass)(player2.root, "xgplayer-lang-is-en"); } else if (player2.config.lang === "jp") { (0, _util.addClass)(player2.root, "xgplayer-lang-is-jp"); } if (!player2.config.enableContextmenu) { player2.video.addEventListener("contextmenu", function(e) { e.preventDefault(); e.stopPropagation(); }); } } } if (player.config && player.config.hideStartBtn) { (0, _util.addClass)(root, "xgplayer-start-hide"); } if (player.isReady) { root.appendChild(btn); onPlayerReady(player); } else { player.once("ready", function() { root.appendChild(btn); onPlayerReady(player); }); } player.once("autoplay was prevented", function() { (0, _util.removeClass)(player.root, "xgplayer-is-enter"); (0, _util.addClass)(player.root, "xgplayer-nostart"); }); player.once("canplay", function() { (0, _util.removeClass)(player.root, "xgplayer-is-enter"); }); btn.onclick = function(e) { e.preventDefault(); e.stopPropagation(); player.userGestureTrigEvent("startBtnClick"); }; }; exports2.default = { name: "s_start", method: s_start2 }; module2.exports = exports2["default"]; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(44); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-start{border-radius:50%;display:inline-block;width:70px;height:70px;background:rgba(0,0,0,.38);overflow:hidden;text-align:center;line-height:70px;vertical-align:middle;position:absolute;left:50%;top:50%;z-index:115;margin:-35px auto auto -35px;cursor:pointer}.xgplayer-skin-default .xgplayer-start div{position:absolute}.xgplayer-skin-default .xgplayer-start div svg{fill:hsla(0,0%,100%,.7)}.xgplayer-skin-default .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default .xgplayer-start .xgplayer-icon-pause{display:none}.xgplayer-skin-default .xgplayer-start:hover{opacity:.85}.xgplayer-skin-default.xgplayer-pause.xgplayer-start-hide .xgplayer-start,.xgplayer-skin-default.xgplayer-playing .xgplayer-start,.xgplayer-skin-default.xgplayer-playing .xgplayer-start .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-start-hide .xgplayer-start{display:none}.xgplayer-skin-default.xgplayer-playing .xgplayer-start .xgplayer-icon-pause{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-start{display:inline-block}.xgplayer-skin-default.xgplayer-pause .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start,.xgplayer-skin-default.xgplayer-pause .xgplayer-start .xgplayer-icon-pause{display:none}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start .xgplayer-icon-pause{display:none}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var fullscreen2 = function fullscreen3() { var player = this; var root = player.root; function onFullscreenBtnClick() { if (player.config.rotateFullscreen) { if ((0, _util.hasClass)(root, "xgplayer-rotate-fullscreen")) { player.exitRotateFullscreen(); } else { player.getRotateFullscreen(); } } else { if ((0, _util.hasClass)(root, "xgplayer-is-fullscreen")) { player.exitFullscreen(root); } else { player.getFullscreen(root); } } } player.on("fullscreenBtnClick", onFullscreenBtnClick); function onFullscreenChange() { var fullscreenEl = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; if (fullscreenEl && fullscreenEl === root) { (0, _util.addClass)(root, "xgplayer-is-fullscreen"); player.emit("requestFullscreen"); } else if ((0, _util.hasClass)(root, "xgplayer-is-fullscreen")) { (0, _util.removeClass)(root, "xgplayer-is-fullscreen"); player.emit("exitFullscreen"); } if (player.danmu && typeof player.danmu.resize === "function") { player.danmu.resize(); } } ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"].forEach(function(item) { document.addEventListener(item, onFullscreenChange); }); player.video.addEventListener("webkitbeginfullscreen", function() { (0, _util.addClass)(root, "xgplayer-is-fullscreen"); player.emit("requestFullscreen"); }); player.video.addEventListener("webkitendfullscreen", function() { (0, _util.removeClass)(root, "xgplayer-is-fullscreen"); player.emit("exitFullscreen"); }); function onWebkitpresentationmodechanged(e) { var mode = player.video.webkitPresentationMode; if (mode !== _util.PresentationMode.FULLSCREEN) { (0, _util.removeClass)(root, "xgplayer-is-fullscreen"); player.emit("exitFullscreen"); } } (0, _util.checkWebkitSetPresentationMode)(player.video) && player.video.addEventListener("webkitpresentationmodechanged", onWebkitpresentationmodechanged); function onDestroy() { player.off("fullscreenBtnClick", onFullscreenBtnClick); ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"].forEach(function(item) { document.removeEventListener(item, onFullscreenChange); }); (0, _util.checkWebkitSetPresentationMode)(player.video) && player.video.removeEventListener("webkitpresentationmodechanged", onWebkitpresentationmodechanged); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); player.getFullscreen = function(el) { var player2 = this; if (el.requestFullscreen) { var fullscreenPromise = el.requestFullscreen(); if (fullscreenPromise) { fullscreenPromise.catch(function() { player2.emit("fullscreen error"); }); } } else if (el.mozRequestFullScreen) { el.mozRequestFullScreen(); } else if (el.webkitRequestFullscreen) { el.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT); } else if (player2.video.webkitSupportsFullscreen) { player2.video.webkitEnterFullscreen(); } else if (el.msRequestFullscreen) { el.msRequestFullscreen(); } else { (0, _util.addClass)(el, "xgplayer-is-cssfullscreen"); } }; player.exitFullscreen = function(el) { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } (0, _util.removeClass)(el, "xgplayer-is-cssfullscreen"); }; player.getRotateFullscreen = function() { var player2 = this; document.documentElement.style.width = "100%"; document.documentElement.style.height = "100%"; if (player2.config.fluid) { player2.root.style["padding-top"] = ""; player2.root.style["max-width"] = "unset"; } if (player2.root && !(0, _util.hasClass)(player2.root, "xgplayer-rotate-fullscreen")) { (0, _util.addClass)(player2.root, "xgplayer-rotate-fullscreen"); } player2.emit("getRotateFullscreen"); }; player.exitRotateFullscreen = function() { var player2 = this; document.documentElement.style.width = "unset"; document.documentElement.style.height = "unset"; if (player2.config.fluid) { player2.root.style["width"] = "100%"; player2.root.style["height"] = "0"; player2.root.style["padding-top"] = player2.config.height * 100 / player2.config.width + "%"; player2.root.style["max-width"] = "100%"; } if (player2.root && (0, _util.hasClass)(player2.root, "xgplayer-rotate-fullscreen")) { (0, _util.removeClass)(player2.root, "xgplayer-rotate-fullscreen"); } player2.emit("exitRotateFullscreen"); }; }; exports2.default = { name: "fullscreen", method: fullscreen2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var play2 = function play3() { var player = this; function onPlayBtnClick() { if (!player.config.allowPlayAfterEnded && player.ended) { return; } if ((0, _util.hasClass)(player.root, "xgplayer-nostart")) { player.start(); } if (player.paused) { var playPromise = player.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } else { player.pause(); } } player.on("playBtnClick", onPlayBtnClick); function onDestroy() { player.off("playBtnClick", onPlayBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "play", method: play2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var replay2 = function replay3() { var player = this; var root = player.root; function onReplayBtnClick() { (0, _util.removeClass)(root, "xgplayer-is-replay"); player.replay(); } player.on("replayBtnClick", onReplayBtnClick); function onEnded() { if (!player.config.loop) { (0, _util.addClass)(root, "xgplayer-is-replay"); } } player.on("ended", onEnded); function onDestroy() { player.off("replayBtnClick", onReplayBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "replay", method: replay2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _play = __webpack_require__(49); var _play2 = _interopRequireDefault2(_play); var _pause = __webpack_require__(50); var _pause2 = _interopRequireDefault2(_pause); __webpack_require__(51); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var s_play2 = function s_play3() { var player = this; var playBtn = player.config.playBtn ? player.config.playBtn : {}; var btn = void 0; if (playBtn.type === "img") { btn = (0, _util.createImgBtn)("play", playBtn.url.play, playBtn.width, playBtn.height); } else { btn = (0, _util.createDom)("xg-play", '\n
' + _play2.default + '
\n
' + _pause2.default + "
\n
", {}, "xgplayer-play"); } var tipsText = {}; tipsText.play = player.lang.PLAY_TIPS; tipsText.pause = player.lang.PAUSE_TIPS; var tips = (0, _util.createDom)("xg-tips", '' + tipsText.play + '\n ' + tipsText.pause + "", {}, "xgplayer-tips"); btn.appendChild(tips); player.once("ready", function() { if (player.controls) { player.controls.appendChild(btn); } }); ["click", "touchend"].forEach(function(item) { btn.addEventListener(item, function(e) { e.preventDefault(); e.stopPropagation(); player.userGestureTrigEvent("playBtnClick"); }); }); }; exports2.default = { name: "s_play", method: s_play2 }; module2.exports = exports2["default"]; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(52); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-play,.xgplayer-skin-default .xgplayer-play-img{width:40px;position:relative;-webkit-order:0;-moz-box-ordinal-group:1;order:0;display:block;cursor:pointer;margin-left:3px}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon,.xgplayer-skin-default .xgplayer-play .xgplayer-icon{margin-top:3px;width:32px}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon div,.xgplayer-skin-default .xgplayer-play .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default .xgplayer-play .xgplayer-icon .xgplayer-icon-play{display:block}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:none}.xgplayer-skin-default .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:block}.xgplayer-skin-default .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:none}.xgplayer-skin-default .xgplayer-play-img:hover,.xgplayer-skin-default .xgplayer-play:hover{opacity:.85}.xgplayer-skin-default .xgplayer-play-img:hover .xgplayer-tips,.xgplayer-skin-default .xgplayer-play:hover .xgplayer-tips{display:block}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-icon .xgplayer-icon-play{display:none}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:block}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:none}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); __webpack_require__(54); var s_poster = function s_poster2() { var player = this; var root = player.root; if (!player.config.poster) { return; } var poster2 = (0, _util.createDom)("xg-poster", "", {}, "xgplayer-poster"); poster2.style.backgroundImage = "url(" + player.config.poster + ")"; root.appendChild(poster2); }; exports2.default = { name: "s_poster", method: s_poster }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(55); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-poster{display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:100;background-size:cover;background-position:50%}.xgplayer-skin-default.xgplayer-nostart .xgplayer-poster{display:block}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); __webpack_require__(57); var s_flex2 = function s_flex3() { var player = this; var playceholder = (0, _util.createDom)("xg-placeholder", "", {}, "xgplayer-placeholder"); player.controls.appendChild(playceholder); }; exports2.default = { name: "s_flex", method: s_flex2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(58); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-placeholder{-webkit-flex:1;-moz-box-flex:1;flex:1;-webkit-order:3;-moz-box-ordinal-group:4;order:3;display:block}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _requestFull = __webpack_require__(60); var _requestFull2 = _interopRequireDefault2(_requestFull); var _exitFull = __webpack_require__(61); var _exitFull2 = _interopRequireDefault2(_exitFull); __webpack_require__(62); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var s_fullscreen2 = function s_fullscreen3() { var player = this; var fullscreenBtn = player.config.fullscreenBtn ? player.config.fullscreenBtn : {}; var btn = void 0; if (fullscreenBtn.type === "img") { btn = (0, _util.createImgBtn)("fullscreen", fullscreenBtn.url.request, fullscreenBtn.width, fullscreenBtn.height); } else { btn = (0, _util.createDom)("xg-fullscreen", '\n
' + _requestFull2.default + '
\n
' + _exitFull2.default + "
\n
", {}, "xgplayer-fullscreen"); } var tipsText = {}; tipsText.requestfull = player.lang.FULLSCREEN_TIPS; tipsText.exitfull = player.lang.EXITFULLSCREEN_TIPS; var tips = (0, _util.createDom)("xg-tips", '' + tipsText.requestfull + '\n ' + tipsText.exitfull + "", {}, "xgplayer-tips"); btn.appendChild(tips); player.once("ready", function() { if (player.controls) { player.controls.appendChild(btn); } }); ["click", "touchend"].forEach(function(item) { btn.addEventListener(item, function(e) { e.preventDefault(); e.stopPropagation(); player.userGestureTrigEvent("fullscreenBtnClick"); }); }); }; exports2.default = { name: "s_fullscreen", method: s_fullscreen2 }; module2.exports = exports2["default"]; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(63); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-fullscreen,.xgplayer-skin-default .xgplayer-fullscreen-img{position:relative;-webkit-order:13;-moz-box-ordinal-group:14;order:13;display:block;cursor:pointer;margin-left:5px;margin-right:3px}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon{margin-top:3px}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon div,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:block}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:none}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips{position:absolute;right:0;left:auto}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:block}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:none}.xgplayer-skin-default .xgplayer-fullscreen-img:hover,.xgplayer-skin-default .xgplayer-fullscreen:hover{opacity:.85}.xgplayer-skin-default .xgplayer-fullscreen-img:hover .xgplayer-tips,.xgplayer-skin-default .xgplayer-fullscreen:hover .xgplayer-tips{display:block}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:block}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:block}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _loading = __webpack_require__(65); var _loading2 = _interopRequireDefault2(_loading); __webpack_require__(66); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var s_loading = function s_loading2() { var player = this; var root = player.root; var container = (0, _util.createDom)("xg-loading", "" + _loading2.default, {}, "xgplayer-loading"); player.once("ready", function() { root.appendChild(container); }); }; exports2.default = { name: "s_loading", method: s_loading }; module2.exports = exports2["default"]; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(67); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-loading{display:none;width:100px;height:100px;overflow:hidden;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7);position:absolute;left:50%;top:50%;margin:-50px auto auto -50px}.xgplayer-skin-default .xgplayer-loading svg{border-radius:50%;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center;-webkit-animation:loadingRotate 1s linear infinite;animation:loadingRotate 1s linear infinite}.xgplayer-skin-default .xgplayer-loading svg path{stroke:#ddd;stroke-dasharray:236;-webkit-animation:loadingDashOffset 2s linear infinite;animation:loadingDashOffset 2s linear infinite;animation-direction:alternate-reverse;fill:none;stroke-width:12px}.xgplayer-skin-default.xgplayer-nostart .xgplayer-loading{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-loading{display:none!important}.xgplayer-skin-default.xgplayer-isloading .xgplayer-loading{display:block}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _sniffer = __webpack_require__(5); var _sniffer2 = _interopRequireDefault2(_sniffer); __webpack_require__(69); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var isRotateFullscreen2 = function isRotateFullscreen3(player) { return (0, _util.hasClass)(player.root, "xgplayer-rotate-fullscreen"); }; var s_progress2 = function s_progress3() { var player = this; var container = (0, _util.createDom)("xg-progress", '\n \n \n \n \n \n \n ', { tabindex: 1 }, "xgplayer-progress"); var containerWidth = void 0; player.controls.appendChild(container); var progress2 = container.querySelector(".xgplayer-progress-played"); var outer = container.querySelector(".xgplayer-progress-outer"); var cache = container.querySelector(".xgplayer-progress-cache"); var point = container.querySelector(".xgplayer-progress-point"); var thumbnail = container.querySelector(".xgplayer-progress-thumbnail"); player.dotArr = {}; function dotEvent(dotItem, text) { dotItem.addEventListener("mouseenter", function(e) { if (text) { (0, _util.addClass)(dotItem, "xgplayer-progress-dot-show"); (0, _util.addClass)(container, "xgplayer-progress-dot-active"); } }); dotItem.addEventListener("mouseleave", function(e) { if (text) { (0, _util.removeClass)(dotItem, "xgplayer-progress-dot-show"); (0, _util.removeClass)(container, "xgplayer-progress-dot-active"); } }); dotItem.addEventListener("touchend", function(e) { e.stopPropagation(); if (text) { if (!(0, _util.hasClass)(dotItem, "xgplayer-progress-dot-show")) { Object.keys(player.dotArr).forEach(function(key) { if (player.dotArr[key]) { (0, _util.removeClass)(player.dotArr[key], "xgplayer-progress-dot-show"); } }); } (0, _util.toggleClass)(dotItem, "xgplayer-progress-dot-show"); (0, _util.toggleClass)(container, "xgplayer-progress-dot-active"); } }); } function onCanplay() { if (player.config.progressDot && (0, _util.typeOf)(player.config.progressDot) === "Array") { player.config.progressDot.forEach(function(item) { if (item.time >= 0 && item.time <= player.duration) { var dot = (0, _util.createDom)("xg-progress-dot", item.text ? '' + item.text + "" : "", {}, "xgplayer-progress-dot"); dot.style.left = item.time / player.duration * 100 + "%"; if (item.duration >= 0) { dot.style.width = Math.min(item.duration, player.duration - item.time) / player.duration * 100 + "%"; } if (item.style) { for (var k in item.style) { dot.style[k] = item.style[k]; } } outer.appendChild(dot); player.dotArr[item.time] = dot; dotEvent(dot, item.text); } }); } } player.once("canplay", onCanplay); player.addProgressDot = function(time2, text, duration, style) { if (player.dotArr[time2]) { return; } if (time2 >= 0 && time2 <= player.duration) { var dot = (0, _util.createDom)("xg-progress-dot", text ? '' + text + "" : "", {}, "xgplayer-progress-dot"); dot.style.left = time2 / player.duration * 100 + "%"; if (duration >= 0) { dot.style.width = Math.min(duration, player.duration - time2) / player.duration * 100 + "%"; } if (style) { for (var k in style) { dot.style[k] = style[k]; } } outer.appendChild(dot); player.dotArr[time2] = dot; dotEvent(dot, text); } }; player.removeProgressDot = function(time2) { if (time2 >= 0 && time2 <= player.duration && player.dotArr[time2]) { var dot = player.dotArr[time2]; dot.parentNode.removeChild(dot); dot = null; player.dotArr[time2] = null; } }; player.removeAllProgressDot = function() { Object.keys(player.dotArr).forEach(function(key) { if (player.dotArr[key]) { var dot = player.dotArr[key]; dot.parentNode.removeChild(dot); dot = null; player.dotArr[key] = null; } }); }; var tnailPicNum = 0; var tnailWidth = 0; var tnailHeight = 0; var tnailCol = 0; var tnailRow = 0; var interval = 0; var tnailUrls = []; var coverPreviewContainer = void 0, coverPreviewPoint = void 0; var onLoadedmetadata = function onLoadedmetadata2() { if (player.config.thumbnail) { if (player.config.thumbnail.isShowCoverPreview && !coverPreviewContainer) { progress2.removeChild(thumbnail); coverPreviewContainer = (0, _util.createDom)("xg-coverpreview", '\n \n \n ', { tabindex: 1 }, "xgplayer-coverpreview"); coverPreviewContainer.querySelector(".xgplayer-coverpreview-outer"); coverPreviewPoint = coverPreviewContainer.querySelector(".xgplayer-coverpreview-point"); thumbnail = coverPreviewContainer.querySelector(".xgplayer-coverpreview-thumbnail"); player.root.appendChild(coverPreviewContainer); } tnailPicNum = player.config.thumbnail.pic_num; tnailWidth = player.config.thumbnail.width; tnailHeight = player.config.thumbnail.height; tnailCol = player.config.thumbnail.col; tnailRow = player.config.thumbnail.row; tnailUrls = player.config.thumbnail.urls; thumbnail.style.width = tnailWidth + "px"; thumbnail.style.height = tnailHeight + "px"; } }; player.on("loadedmetadata", onLoadedmetadata); if (typeof player.config.disableSwipeHandler === "function" && typeof player.config.enableSwipeHandler === "function") { player.root.addEventListener("touchmove", function(e) { e.preventDefault(); if (!player.disableSwipe) { player.disableSwipe = true; player.config.disableSwipeHandler.call(player); } }); player.root.addEventListener("touchstart", function(e) { player.disableSwipe = true; player.config.disableSwipeHandler.call(player); }); player.root.addEventListener("touchend", function(e) { player.disableSwipe = false; player.config.enableSwipeHandler.call(player); }); } var events = ["touchstart", "mousedown"]; if (_sniffer2.default.device === "mobile") { events.pop(); } events.forEach(function(item) { container.addEventListener(item, function(e) { if (player.config.disableProgress) return; e.stopPropagation(); (0, _util.event)(e); if (e._target === point || !player.config.allowSeekAfterEnded && player.ended) { return true; } container.focus(); var _progress$getBounding = progress2.getBoundingClientRect(), left = _progress$getBounding.left; var isRotate = isRotateFullscreen2(player); if (isRotate) { left = progress2.getBoundingClientRect().top; containerWidth = container.getBoundingClientRect().height; } else { containerWidth = container.getBoundingClientRect().width; left = progress2.getBoundingClientRect().left; } var move = function move2(e2) { e2.stopPropagation(); (0, _util.event)(e2); player.isProgressMoving = true; var w = (isRotate ? e2.clientY : e2.clientX) - left; if (w > containerWidth) { w = containerWidth; } var now = w / containerWidth * player.duration; if (now < 0) now = 0; if (player.config.allowSeekPlayed && Number(now).toFixed(1) > player.maxPlayedTime) ; else { progress2.style.width = w * 100 / containerWidth + "%"; if (player.videoConfig.mediaType === "video" && !player.dash && !player.config.closeMoveSeek) { console.log("trigger touchmove"); player.currentTime = Number(now).toFixed(1); } else { var time2 = (0, _util.findDom)(player.controls, ".xgplayer-time"); if (time2) { time2.innerHTML = '' + (0, _util.format)(now || 0) + "" + (0, _util.format)(player.duration) + ""; } } } if (player.config.thumbnail && player.config.thumbnail.isShowCoverPreview) { coverPreviewPoint.innerHTML = "" + (0, _util.format)(now) + " / " + (0, _util.format)(player.duration || 0); interval = player.duration / tnailPicNum; var index2 = Math.floor(now / interval); thumbnail.style.backgroundImage = "url(" + tnailUrls[Math.ceil((index2 + 1) / (tnailCol * tnailRow)) - 1] + ")"; var indexInPage = index2 + 1 - tnailCol * tnailRow * (Math.ceil((index2 + 1) / (tnailCol * tnailRow)) - 1); var tnaiRowIndex = Math.ceil(indexInPage / tnailRow) - 1; var tnaiColIndex = indexInPage - tnaiRowIndex * tnailRow - 1; thumbnail.style["background-position"] = "-" + tnaiColIndex * tnailWidth + "px -" + tnaiRowIndex * tnailHeight + "px"; coverPreviewContainer.style.display = "block"; } player.emit("focus"); }; var up = function up2(e2) { console.log("up event", e2); e2.stopPropagation(); (0, _util.event)(e2); window.removeEventListener("mousemove", move); window.removeEventListener("touchmove", move, { passive: false }); window.removeEventListener("mouseup", up2); window.removeEventListener("touchend", up2); if (_sniffer2.default.browser.indexOf("ie") < 0) { container.blur(); } if (!player.isProgressMoving || player.videoConfig && player.videoConfig.mediaType === "audio" || player.dash || player.config.closeMoveSeek) { var w = (isRotate ? e2.clientY : e2.clientX) - left; if (w > containerWidth) { w = containerWidth; } var now = w / containerWidth * player.duration; if (now < 0) now = 0; if (player.config.allowSeekPlayed && Number(now).toFixed(1) > player.maxPlayedTime) ; else { progress2.style.width = w * 100 / containerWidth + "%"; console.warn("trigger touchup"); player.currentTime = Number(now).toFixed(1); } } if (player.config.thumbnail && player.config.thumbnail.isShowCoverPreview) { coverPreviewContainer.style.display = "none"; } player.emit("focus"); player.isProgressMoving = false; }; window.addEventListener("touchmove", move, { passive: false }); window.addEventListener("touchend", up); window.addEventListener("mousemove", move); window.addEventListener("mouseup", up); return true; }); }); container.addEventListener("mouseenter", function(e) { if (!player.config.allowSeekAfterEnded && player.ended) { return true; } var isRotate = isRotateFullscreen2(player); var containerLeft = isRotate ? container.getBoundingClientRect().top : container.getBoundingClientRect().left; var containerWidth2 = isRotate ? container.getBoundingClientRect().height : container.getBoundingClientRect().width; var compute = function compute2(e2) { var now = ((isRotate ? e2.clientY : e2.clientX) - containerLeft) / containerWidth2 * player.duration; now = now < 0 ? 0 : now; point.textContent = (0, _util.format)(now); var pointWidth = point.getBoundingClientRect().width; if (player.config.thumbnail && !player.config.thumbnail.isShowCoverPreview) { interval = player.duration / tnailPicNum; var index2 = Math.floor(now / interval); thumbnail.style.backgroundImage = "url(" + tnailUrls[Math.ceil((index2 + 1) / (tnailCol * tnailRow)) - 1] + ")"; var indexInPage = index2 + 1 - tnailCol * tnailRow * (Math.ceil((index2 + 1) / (tnailCol * tnailRow)) - 1); var tnaiRowIndex = Math.ceil(indexInPage / tnailRow) - 1; var tnaiColIndex = indexInPage - tnaiRowIndex * tnailRow - 1; thumbnail.style["background-position"] = "-" + tnaiColIndex * tnailWidth + "px -" + tnaiRowIndex * tnailHeight + "px"; var left = (isRotate ? e2.clientY : e2.clientX) - containerLeft - tnailWidth / 2; left = left > 0 ? left : 0; left = left < containerWidth2 - tnailWidth ? left : containerWidth2 - tnailWidth; thumbnail.style.left = left + "px"; thumbnail.style.top = -10 - tnailHeight + "px"; thumbnail.style.display = "block"; point.style.left = left + tnailWidth / 2 - pointWidth / 2 + "px"; } else { var _left = e2.clientX - containerLeft - pointWidth / 2; _left = _left > 0 ? _left : 0; _left = _left > containerWidth2 - pointWidth ? containerWidth2 - pointWidth : _left; point.style.left = _left + "px"; } if ((0, _util.hasClass)(container, "xgplayer-progress-dot-active")) { point.style.display = "none"; } else { point.style.display = "block"; } }; var move = function move2(e2) { compute(e2); }; var leave = function leave2(e2) { container.removeEventListener("mousemove", move, false); container.removeEventListener("mouseleave", leave2, false); compute(e2); point.style.display = "none"; if (player.config.thumbnail && !player.config.thumbnail.isShowCoverPreview) { thumbnail.style.display = "none"; } }; container.addEventListener("mousemove", move, false); container.addEventListener("mouseleave", leave, false); compute(e); }, false); var onTimeupdate = function onTimeupdate2() { if (player.maxPlayedTime === void 0) player.maxPlayedTime = 0; if (player.maxPlayedTime < player.currentTime) player.maxPlayedTime = player.currentTime; if (!containerWidth && container) { containerWidth = container.getBoundingClientRect().width; } if (!player.isProgressMoving && !player.isSeeking && !player.seeking) { var precent = player.currentTime / player.duration; var prevPrecent = Number(progress2.style.width.replace("%", "") || "0") / Number(container.style.width || "100"); if (Math.abs(precent - prevPrecent) <= 1) { progress2.style.width = player.currentTime * 100 / player.duration + "%"; } } }; player.on("timeupdate", onTimeupdate); var onCurrentTimeChange = function onCurrentTimeChange2(time2) { progress2.style.width = time2 * 100 / player.duration + "%"; }; player.on("currentTimeChange", onCurrentTimeChange); var onSrcChange = function onSrcChange2() { progress2.style.width = "0%"; }; player.on("srcChange", onSrcChange); var onCacheUpdate = function onCacheUpdate2() { var buffered = player.buffered; if (buffered && buffered.length > 0) { var end = buffered.end(buffered.length - 1); for (var i = 0, len = buffered.length; i < len; i++) { if (player.currentTime >= buffered.start(i) && player.currentTime <= buffered.end(i)) { end = buffered.end(i); for (var j = i + 1; j < buffered.length; j++) { if (buffered.start(j) - buffered.end(j - 1) >= 2) { end = buffered.end(j - 1); break; } } break; } } cache.style.width = end / player.duration * 100 + "%"; } }; var cacheUpdateEvents = ["bufferedChange", "cacheupdate", "ended", "timeupdate"]; cacheUpdateEvents.forEach(function(item) { player.on(item, onCacheUpdate); }); function destroyFunc() { player.removeAllProgressDot(); player.off("canplay", onCanplay); player.off("timeupdate", onTimeupdate); player.off("currentTimeChange", onCurrentTimeChange); player.off("srcChange", onSrcChange); player.off("loadedmetadata", onLoadedmetadata); cacheUpdateEvents.forEach(function(item) { player.off(item, onCacheUpdate); }); player.off("destroy", destroyFunc); } player.once("destroy", destroyFunc); }; exports2.default = { name: "s_progress", method: s_progress2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(70); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-progress{display:block;position:absolute;height:20px;line-height:20px;left:12px;right:12px;outline:none;top:-15px;z-index:35}.xgplayer-skin-default .xgplayer-progress-outer{background:hsla(0,0%,100%,.3);display:block;height:3px;line-height:3px;margin-top:8.5px;width:100%;position:relative;cursor:pointer}.xgplayer-skin-default .xgplayer-progress-cache,.xgplayer-skin-default .xgplayer-progress-played{display:block;height:100%;line-height:1;position:absolute;left:0;top:0}.xgplayer-skin-default .xgplayer-progress-cache{width:0;background:hsla(0,0%,100%,.5)}.xgplayer-skin-default .xgplayer-progress-played{display:block;width:0;background-image:linear-gradient(-90deg,#fa1f41,#e31106);border-radius:0 1.5px 1.5px 0}.xgplayer-skin-default .xgplayer-progress-btn{display:none;position:absolute;left:0;top:-5px;width:13px;height:13px;border-radius:30px;background:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.26);left:100%;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%);z-index:36}.xgplayer-skin-default .xgplayer-progress-point{position:absolute}.xgplayer-skin-default .xgplayer-progress-point.xgplayer-tips{margin-left:0;top:-25px;display:none;z-index:100}.xgplayer-skin-default .xgplayer-progress-dot{display:inline-block;position:absolute;height:3px;width:5px;top:0;background:#fff;border-radius:6px;z-index:16}.xgplayer-skin-default .xgplayer-progress-dot .xgplayer-progress-tip{position:absolute;bottom:200%;right:50%;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:auto;line-height:30px;width:auto;background:rgba(0,0,0,.3);border-radius:6px;border:1px solid rgba(0,0,0,.8);cursor:default;white-space:nowrap;display:none}.xgplayer-skin-default .xgplayer-progress-dot-show .xgplayer-progress-tip{display:block}.xgplayer-skin-default .xgplayer-progress-thumbnail{position:absolute;-moz-box-sizing:border-box;box-sizing:border-box}.xgplayer-skin-default .xgplayer-progress-thumbnail.xgplayer-tips{margin-left:0;display:none;z-index:99}.xgplayer-skin-default .xgplayer-coverpreview{position:absolute;width:100%;height:100%;top:0;left:0;display:none}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer{position:absolute;display:block;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-thumbnail{display:block}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-point{display:block;text-align:center;font-family:PingFangSC-Regular;font-size:11px;color:#ccc;padding:2px 4px}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-point span{color:#fff}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-outer,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-outer{height:6px;margin-top:7px}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-dot,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-dot{height:6px}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-btn,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-btn{display:block;top:-3px}.xgplayer-skin-default.xgplayer-definition-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-playbackrate-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-texttrack-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-volume-active .xgplayer-progress{z-index:15}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress-btn{display:block!important}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:focus .xgplayer-progress-outer,.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:hover .xgplayer-progress-outer{height:3px!important;margin-top:8.5px!important}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:focus .xgplayer-progress-btn,.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:hover .xgplayer-progress-btn{display:block!important;top:-5px!important}", ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); __webpack_require__(72); var s_time = function s_time2() { var player = this; var container = (0, _util.createDom)("xg-time", '' + (player.currentTime || (0, _util.format)(0)) + "\n " + (player.duration || (0, _util.format)(0)) + "", {}, "xgplayer-time"); player.once("ready", function() { if (player.controls) { player.controls.appendChild(container); } }); var onTimeChange = function onTimeChange2() { if (player.videoConfig.mediaType !== "audio" || !player.isProgressMoving || !player.dash) { container.innerHTML = '' + (0, _util.format)(player.currentTime || 0) + "" + ("" + (0, _util.format)(player.duration) + ""); } }; player.on("durationchange", onTimeChange); player.on("timeupdate", onTimeChange); function onDestroy() { player.off("durationchange", onTimeChange); player.off("timeupdate", onTimeChange); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "s_time", method: s_time }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(73); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, '.xgplayer-skin-default .xgplayer-time{-webkit-order:2;-moz-box-ordinal-group:3;order:2;font-family:ArialMT;font-size:13px;color:#fff;line-height:40px;height:40px;text-align:center;display:inline-block;margin:auto 8px}.xgplayer-skin-default .xgplayer-time span{color:hsla(0,0%,100%,.5)}.xgplayer-skin-default .xgplayer-time .xgplayer-time-current{color:#fff}.xgplayer-skin-default .xgplayer-time .xgplayer-time-current:after{content:"/";display:inline-block;padding:0 3px}', ""]); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _replay = __webpack_require__(75); var _replay2 = _interopRequireDefault2(_replay); __webpack_require__(76); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var s_replay = function s_replay2() { var player = this; var root = player.root; var replayText = player.lang.REPLAY; var btn = (0, _util.createDom)("xg-replay", _replay2.default + '\n ' + replayText + "\n ", {}, "xgplayer-replay"); player.once("ready", function() { root.appendChild(btn); }); function onEnded() { var path = btn.querySelector("path"); if (path) { var transform = window.getComputedStyle(path).getPropertyValue("transform"); if (typeof transform === "string" && transform.indexOf("none") > -1) { return; } else { path.setAttribute("transform", transform); } } } player.on("ended", onEnded); function onBtnClick(e) { e.preventDefault(); e.stopPropagation(); } btn.addEventListener("click", onBtnClick); var svg = btn.querySelector("svg"); ["click", "touchend"].forEach(function(item) { svg.addEventListener(item, function(e) { e.preventDefault(); e.stopPropagation(); player.userGestureTrigEvent("replayBtnClick"); }); }); function destroyFunc() { player.off("ended", onEnded); player.off("destroy", destroyFunc); } player.once("destroy", destroyFunc); }; exports2.default = { name: "s_replay", method: s_replay }; module2.exports = exports2["default"]; }, function(module2, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_exports__["default"] = '\n \n\n'; }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(77); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(1)(false); exports2.push([module2.i, ".xgplayer-skin-default .xgplayer-replay{position:absolute;left:0;top:0;width:100%;height:100%;z-index:105;display:none;-webkit-justify-content:center;-moz-box-pack:center;justify-content:center;-webkit-align-items:center;-moz-box-align:center;align-items:center;background:rgba(0,0,0,.54);-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;flex-direction:column}.xgplayer-skin-default .xgplayer-replay svg{background:rgba(0,0,0,.58);border-radius:100%;cursor:pointer}.xgplayer-skin-default .xgplayer-replay svg path{-webkit-transform:translate(20px,21px);-ms-transform:translate(20px,21px);transform:translate(20px,21px);fill:#ddd}.xgplayer-skin-default .xgplayer-replay svg:hover{background:rgba(0,0,0,.38)}.xgplayer-skin-default .xgplayer-replay svg:hover path{fill:#fff}.xgplayer-skin-default .xgplayer-replay .xgplayer-replay-txt{display:inline-block;font-family:PingFangSC-Regular;font-size:14px;color:#fff;line-height:34px}.xgplayer-skin-default.xgplayer.xgplayer-ended .xgplayer-controls{display:none}.xgplayer-skin-default.xgplayer.xgplayer-ended .xgplayer-replay{display:-webkit-flex;display:-moz-box;display:flex}", ""]); }, function(module2, exports2, __webpack_require__) { var content = __webpack_require__(161); if (typeof content === "string") content = [[module2.i, content, ""]]; var transform; var options = { "hmr": true }; options.transform = transform; options.insertInto = void 0; __webpack_require__(2)(content, options); if (content.locals) module2.exports = content.locals; }, function(module2, exports2, __webpack_require__) { module2.exports = __webpack_require__(80); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _player = __webpack_require__(9); var _player2 = _interopRequireDefault2(_player); var _airplay = __webpack_require__(81); var _airplay2 = _interopRequireDefault2(_airplay); var _cssFullscreen = __webpack_require__(82); var _cssFullscreen2 = _interopRequireDefault2(_cssFullscreen); var _danmu = __webpack_require__(83); var _danmu2 = _interopRequireDefault2(_danmu); var _definition = __webpack_require__(84); var _definition2 = _interopRequireDefault2(_definition); var _download = __webpack_require__(85); var _download2 = _interopRequireDefault2(_download); var _errorRetry = __webpack_require__(88); var _errorRetry2 = _interopRequireDefault2(_errorRetry); var _fullscreen = __webpack_require__(45); var _fullscreen2 = _interopRequireDefault2(_fullscreen); var _keyboard = __webpack_require__(89); var _keyboard2 = _interopRequireDefault2(_keyboard); var _localPreview = __webpack_require__(90); var _localPreview2 = _interopRequireDefault2(_localPreview); var _memoryPlay = __webpack_require__(91); var _memoryPlay2 = _interopRequireDefault2(_memoryPlay); var _miniplayer = __webpack_require__(92); var _miniplayer2 = _interopRequireDefault2(_miniplayer); var _mobile = __webpack_require__(37); var _mobile2 = _interopRequireDefault2(_mobile); var _pc = __webpack_require__(38); var _pc2 = _interopRequireDefault2(_pc); var _pip = __webpack_require__(98); var _pip2 = _interopRequireDefault2(_pip); var _play = __webpack_require__(46); var _play2 = _interopRequireDefault2(_play); var _playNext = __webpack_require__(99); var _playNext2 = _interopRequireDefault2(_playNext); var _reload = __webpack_require__(100); var _reload2 = _interopRequireDefault2(_reload); var _replay = __webpack_require__(47); var _replay2 = _interopRequireDefault2(_replay); var _rotate = __webpack_require__(101); var _rotate2 = _interopRequireDefault2(_rotate); var _screenShot = __webpack_require__(102); var _screenShot2 = _interopRequireDefault2(_screenShot); var _stallCheck = __webpack_require__(103); var _stallCheck2 = _interopRequireDefault2(_stallCheck); var _start = __webpack_require__(39); var _start2 = _interopRequireDefault2(_start); var _volume = __webpack_require__(104); var _volume2 = _interopRequireDefault2(_volume); var _textTrack = __webpack_require__(105); var _textTrack2 = _interopRequireDefault2(_textTrack); __webpack_require__(107); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _player2.default.installAll([_airplay2.default, _cssFullscreen2.default, _danmu2.default, _definition2.default, _download2.default, _errorRetry2.default, _fullscreen2.default, _keyboard2.default, _localPreview2.default, _memoryPlay2.default, _miniplayer2.default, _mobile2.default, _pc2.default, _pip2.default, _play2.default, _playNext2.default, _reload2.default, _replay2.default, _rotate2.default, _screenShot2.default, _stallCheck2.default, _start2.default, _volume2.default, _textTrack2.default]); exports2.default = _player2.default; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var airplay2 = function airplay3() { var player = this; if (!player.config.airplay || !window.WebKitPlaybackTargetAvailabilityEvent) return; function onAirplayBtnClick() { player.video.webkitShowPlaybackTargetPicker(); } player.on("airplayBtnClick", onAirplayBtnClick); function onDestroy() { player.off("airplayBtnClick", onAirplayBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "airplay", method: airplay2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var cssFullscreen = function cssFullscreen2() { var player = this; var root = player.root; function onCssFullscreenBtnClick() { if ((0, _util.hasClass)(root, "xgplayer-is-cssfullscreen")) { player.exitCssFullscreen(); } else { player.getCssFullscreen(); } } player.on("cssFullscreenBtnClick", onCssFullscreenBtnClick); player.on("exitFullscreen", function() { (0, _util.removeClass)(root, "xgplayer-is-cssfullscreen"); }); function onDestroy() { player.off("cssFullscreenBtnClick", onCssFullscreenBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); player.getCssFullscreen = function() { var player2 = this; if (player2.config.fluid) { player2.root.style["padding-top"] = ""; } (0, _util.addClass)(player2.root, "xgplayer-is-cssfullscreen"); player2.emit("requestCssFullscreen"); }; player.exitCssFullscreen = function() { var player2 = this; if (player2.config.fluid) { player2.root.style["width"] = "100%"; player2.root.style["height"] = "0"; player2.root.style["padding-top"] = player2.config.height * 100 / player2.config.width + "%"; } (0, _util.removeClass)(player2.root, "xgplayer-is-cssfullscreen"); player2.emit("exitCssFullscreen"); }; }; exports2.default = { name: "cssFullscreen", method: cssFullscreen }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var danmu2 = function danmu3() { var player = this; function onInitDanmu(danmujs) { var container = player.root.querySelector("xg-danmu"); (0, _util.addClass)(container, "xgplayer-has-danmu"); if (!player.config.danmu.closeDefaultBtn) { var onTimeupdate = function onTimeupdate2() { danmujs.start(); }; var onPause = function onPause2() { if ((0, _util.hasClass)(player.danmuBtn, "danmu-switch-active")) { danmujs.pause(); } }; var onPlay = function onPlay2() { if ((0, _util.hasClass)(player.danmuBtn, "danmu-switch-active")) { danmujs.play(); } }; var onSeeked = function onSeeked2() { if ((0, _util.hasClass)(player.danmuBtn, "danmu-switch-active")) { danmujs.stop(); danmujs.start(); } }; var onDestroy = function onDestroy2() { player.off("timeupdate", onTimeupdate); player.off("pause", onPause); player.off("play", onPlay); player.off("seeked", onSeeked); player.off("destroy", onDestroy2); }; player.danmuBtn = (0, _util.copyDom)(danmujs.bulletBtn.createSwitch(true)); player.controls.appendChild(player.danmuBtn); ["click", "touchend"].forEach(function(item) { player.danmuBtn.addEventListener(item, function(e) { e.preventDefault(); e.stopPropagation(); (0, _util.toggleClass)(player.danmuBtn, "danmu-switch-active"); if ((0, _util.hasClass)(player.danmuBtn, "danmu-switch-active")) { player.emit("danmuBtnOn"); (0, _util.addClass)(container, "xgplayer-has-danmu"); player.once("timeupdate", onTimeupdate); } else { player.emit("danmuBtnOff"); (0, _util.removeClass)(container, "xgplayer-has-danmu"); danmujs.stop(); } }); }); player.onElementClick && container.addEventListener("click", function(e) { player.onElementClick(e, container); }, false); player.onElementDblclick && container.addEventListener("dblclick", function(e) { player.onElementDblclick(e, container); }, false); player.on("pause", onPause); player.on("play", onPlay); player.on("seeked", onSeeked); player.once("destroy", onDestroy); } } player.on("initDefaultDanmu", onInitDanmu); }; exports2.default = { name: "danmu", method: danmu2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var definition2 = function definition3() { var player = this; function onDestroy() { player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "definition", method: definition2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _downloadjs = __webpack_require__(86); var _downloadjs2 = _interopRequireDefault2(_downloadjs); var _url = __webpack_require__(87); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var download2 = function download3() { var player = this; function onDownloadBtnClick() { player.download(); } player.on("downloadBtnClick", onDownloadBtnClick); function onDestroy() { player.off("downloadBtnClick", onDownloadBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); player.download = function() { var url = (0, _url.getAbsoluteURL)(this.config.url); (0, _downloadjs2.default)(url); }; }; exports2.default = { name: "download", method: download2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; (function(root, factory) { { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(this, function() { return function download2(data, strFileName, strMimeType) { var self2 = window, defaultMime = "application/octet-stream", mimeType = strMimeType || defaultMime, payload = data, url = !strFileName && !strMimeType && payload, anchor = document.createElement("a"), toString = function(a) { return String(a); }, myBlob = self2.Blob || self2.MozBlob || self2.WebKitBlob || toString, fileName = strFileName || "download", blob, reader; myBlob = myBlob.call ? myBlob.bind(self2) : Blob; if (String(this) === "true") { payload = [payload, mimeType]; mimeType = payload[0]; payload = payload[1]; } if (url && url.length < 2048) { fileName = url.split("/").pop().split("?")[0]; anchor.href = url; if (anchor.href.indexOf(url) !== -1) { var ajax = new XMLHttpRequest(); ajax.open("GET", url, true); ajax.responseType = "blob"; ajax.onload = function(e) { download2(e.target.response, fileName, defaultMime); }; setTimeout(function() { ajax.send(); }, 0); return ajax; } } if (/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)) { if (payload.length > 1024 * 1024 * 1.999 && myBlob !== toString) { payload = dataUrlToBlob(payload); mimeType = payload.type || defaultMime; } else { return navigator.msSaveBlob ? navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : saver(payload); } } else { if (/([\x80-\xff])/.test(payload)) { var i = 0, tempUiArr = new Uint8Array(payload.length), mx = tempUiArr.length; for (i; i < mx; ++i) tempUiArr[i] = payload.charCodeAt(i); payload = new myBlob([tempUiArr], { type: mimeType }); } } blob = payload instanceof myBlob ? payload : new myBlob([payload], { type: mimeType }); function dataUrlToBlob(strUrl) { var parts = strUrl.split(/[:;,]/), type = parts[1], decoder = parts[2] == "base64" ? atob : decodeURIComponent, binData = decoder(parts.pop()), mx2 = binData.length, i2 = 0, uiArr = new Uint8Array(mx2); for (i2; i2 < mx2; ++i2) uiArr[i2] = binData.charCodeAt(i2); return new myBlob([uiArr], { type }); } function saver(url2, winMode) { if ("download" in anchor) { anchor.href = url2; anchor.setAttribute("download", fileName); anchor.className = "download-js-link"; anchor.innerHTML = "downloading..."; anchor.style.display = "none"; document.body.appendChild(anchor); setTimeout(function() { anchor.click(); document.body.removeChild(anchor); if (winMode === true) { setTimeout(function() { self2.URL.revokeObjectURL(anchor.href); }, 250); } }, 66); return true; } if (/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) { if (/^data:/.test(url2)) url2 = "data:" + url2.replace(/^data:([\w\/\-\+]+)/, defaultMime); if (!window.open(url2)) { if (confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")) { location.href = url2; } } return true; } var f = document.createElement("iframe"); document.body.appendChild(f); if (!winMode && /^data:/.test(url2)) { url2 = "data:" + url2.replace(/^data:([\w\/\-\+]+)/, defaultMime); } f.src = url2; setTimeout(function() { document.body.removeChild(f); }, 333); } if (navigator.msSaveBlob) { return navigator.msSaveBlob(blob, fileName); } if (self2.URL) { saver(self2.URL.createObjectURL(blob), true); } else { if (typeof blob === "string" || blob.constructor === toString) { try { return saver("data:" + mimeType + ";base64," + self2.btoa(blob)); } catch (y) { return saver("data:" + mimeType + "," + encodeURIComponent(blob)); } } reader = new FileReader(); reader.onload = function(e) { saver(this.result); }; reader.readAsDataURL(blob); } return true; }; }); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getAbsoluteURL = function getAbsoluteURL(url) { if (!url.match(/^https?:\/\//)) { var div = document.createElement("div"); div.innerHTML = 'x'; url = div.firstChild.href; } return url; }; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _error = __webpack_require__(4); var _error2 = _interopRequireDefault2(_error); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var defaultConfig2 = { maxCount: 3, backupUrl: "", isFetch: true, fetchTimeout: 100 }; function errorRetry() { var _this = this; var player = this; if (!player.config.errorConfig || player.src.indexOf("blob:") > -1) { return; } var errorConfig = {}; var _inConfig = player.config.errorConfig; for (var key in defaultConfig2) { if (_inConfig[key] === void 0) { errorConfig[key] = defaultConfig2[key]; } else { errorConfig[key] = _inConfig[key]; } } player.retryData = { count: 0, errfTimer: null, isFetchReturn: false, currentTime: 0 }; function errorfetch(player2, url, timeout) { var resolveFun = function resolveFun2(resolve, data) { if (!player2.retryData.isFetchReturn) { player2.retryData.isFetchReturn = true; resolve(data); } }; return new Promise(function(resolve, reject) { try { var xhr = new window.XMLHttpRequest(); xhr.open("get", url); xhr.onload = function() { resolveFun(resolve, { status: xhr.status, statusText: xhr.statusText, xhr }); }; xhr.onerror = function() { resolveFun(resolve, { status: xhr.status, statusText: xhr.statusText || "The network environment is disconnected or the address is invalid", xhr }); }; xhr.onabort = function() { }; player2.retryData.errfTimer = window.setTimeout(function() { var errfTimer = player2.retryData.errfTimer; window.clearTimeout(errfTimer); player2.retryData.errfTimer = null; resolveFun(resolve, { status: -1, statusText: "request timeout" }); }, timeout); xhr.send(); } catch (err) { player2.retryData.isFetchReturn = true; resolveFun(resolve, { status: -2, statusText: "request error" }); } }); } function retryCanPlay() { this.currentTime = this.retryData.currentTime; this.play(); this.retryData.retryCode = 0; this.retryData.isFetchReturn = false; this.retryData.currentTime = 0; } var _originErrorEmit = player._onError; player._onError = function(data) { var errorCount = _this.retryData.count; if (errorCount > errorConfig.maxCount) { if (errorConfig.isFetch) { errorfetch(_this, _this.currentSrc, errorConfig.fetchTimeout).then(function(data2) { _this.emit("error", new _error2.default({ type: "network", currentTime: _this.currentTime, duration: _this.duration || 0, networkState: _this.networkState, readyState: _this.readyState, currentSrc: _this.currentSrc, src: _this.src, ended: _this.ended, httpCode: data2.status, httpMsg: data2.statusText, errd: { line: 101, msg: _this.error, handle: "plugin errorRetry" }, errorCode: _this.video && _this.video.error.code, mediaError: _this.video && _this.video.error })); _originErrorEmit.call(_this, data2); }); } else { _originErrorEmit.call(_this, data); } return; } if (errorCount === 0) { _this.retryData.currentTime = _this.currentTime; _this.once("canplay", retryCanPlay.bind(_this)); } var src = ""; if (errorConfig.count < 2) { src = errorConfig.backupUrl ? errorConfig.backupUrl : player.currentSrc; } else { src = errorConfig.backupUrl && errorCount > 1 ? errorConfig.backupUrl : player.currentSrc; } _this.retryData.count++; _this.src = src; }; } exports2.default = { name: "errorretry", method: errorRetry }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _createClass2 = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _util = __webpack_require__(0); function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Keyboard = function() { function Keyboard2(player) { _classCallCheck2(this, Keyboard2); this.player = player; this.state = { playbackRate: 0, isRepeat: false, keyCode: 0, repeat: 0, isBody: false }; this.timer = null; this.initEvents(); } _createClass2(Keyboard2, [{ key: "initEvents", value: function initEvents() { var _this = this; var _player = this.player, root = _player.root, config = _player.config; this.player.onBodyKeydown = this.onBodyKeydown.bind(this); this.player.onKeydown = this.onKeydown.bind(this); this.player.onKeyup = this.onKeyup.bind(this); if (!config.keyShortcut || config.keyShortcut === "on") { document.addEventListener("keydown", this.player.onBodyKeydown); root.addEventListener("keydown", this.player.onKeydown); var destroyFunc = function destroyFunc2() { document.removeEventListener("keydown", _this.player.onBodyKeydown); root.removeEventListener("keydown", _this.player.onKeydown); clearTimeout(_this.timer); _this.timer = null; }; (0, _util.on)(this.player, "destroy", destroyFunc); } } }, { key: "checkTarget", value: function checkTarget(e) { var player = this.player; return e.target === player.root || e.target === player.video || e.target === player.controls; } }, { key: "onBodyKeydown", value: function onBodyKeydown(event2) { var e = event2 || window.event; var keyCode = e.keyCode; if (e.target === document.body && (keyCode === 37 || keyCode === 39 || keyCode === 32)) { e.preventDefault(); e.cancelBubble = true; e.returnValue = false; if (!e.repeat) { document.addEventListener("keyup", this.player.onKeyup); } this.handler(e); return false; } } }, { key: "onKeydown", value: function onKeydown(event2) { var e = event2 || window.event; var keyCode = e.keyCode; if (this.checkTarget(e) && (keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40 || keyCode === 32 || keyCode === 27)) { e.preventDefault(); e.cancelBubble = true; e.returnValue = false; this.player.emit("focus"); if (!e.repeat) { this.player.root.addEventListener("keyup", this.player.onKeyup); } this.handler(e); return false; } } }, { key: "onKeyup", value: function onKeyup() { var state = this.state, player = this.player; document.removeEventListener("keyup", this.player.onKeyup); player.root.removeEventListener("keyup", this.player.onKeyup); if (!state.keyCode) { return; } if (state.playbackRate !== 0) { player.playbackRate = state.playbackRate; } if (!state.isRepeat) { this.handlerKeyCode(state.keyCode, false); } state.playbackRate = 0; state.isRepeat = false; state.keyCode = 0; state.repeat = 0; this.changeVolumeSlide(); } }, { key: "handler", value: function handler(e) { var state = this.state, player = this.player; state.keyCode = e.keyCode; state.isRepeat = e.repeat; if (e.repeat) { if (player.config.disableLongPress) { this.handlerKeyCode(state.keyCode, false); } else if (state.repeat % 2 === 0) { this.handlerKeyCode(state.keyCode, true); } state.repeat++; } } }, { key: "handlerKeyCode", value: function handlerKeyCode(keyCode, isLonePress) { var player = this.player, state = this.state; switch (keyCode) { case 39: if (isLonePress) { state.repeat === 0 && this.changeRate(); } else { this.seek(false, isLonePress); } break; case 37: this.seek(true, isLonePress); break; case 38: this.changeVolume(true); break; case 40: this.changeVolume(false); break; case 32: if (!isLonePress) { player.paused ? player.play() : player.pause(); } break; case 27: if ((0, _util.hasClass)(player.root, "xgplayer-is-cssfullscreen")) { player.exitCssFullscreen(); } break; } } }, { key: "seek", value: function seek(isBack, isLongPress) { var player = this.player; var keyShortcutStep = player.config.keyShortcutStep || {}; var currentTimeStep = keyShortcutStep.currentTime || 10; if (player.isLoading || player.isSeeking || isLongPress && this.state.repeat % 8 > 0) { return; } if (isBack) { if (player.currentTime - currentTimeStep >= 0) { player.currentTime -= currentTimeStep; } else { player.currentTime = 0; } } else { if (player.maxPlayedTime && player.config.allowSeekPlayed && player.currentTime + currentTimeStep > player.maxPlayedTime) { player.currentTime = player.maxPlayedTime; } else { if (player.currentTime + currentTimeStep <= player.duration) { player.currentTime += currentTimeStep; } else { player.currentTime = player.duration + 1; } } } } }, { key: "changeRate", value: function changeRate() { this.state.playbackRate = this.player.playbackRate; this.player.playbackRate = this.player.config.keyboardRate || 5; } }, { key: "changeVolumeSlide", value: function changeVolumeSlide(show) { var player = this.player; if (!player.controls) { return; } if (show) { player.emit("focus"); if (!(0, _util.hasClass)(player.root, "xgplayer-volume-active")) { (0, _util.addClass)(player.root, "xgplayer-volume-active"); } } else { clearTimeout(this.timer); this.timer = setTimeout(function() { (0, _util.removeClass)(player.root, "xgplayer-volume-active"); }, 1e3); } } }, { key: "changeVolume", value: function changeVolume(isup) { var player = this.player; var keyShortcutStep = player.config.keyShortcutStep || {}; var volumeStep = keyShortcutStep.volume || 0.1; this.changeVolumeSlide(true); var volume2 = player.volume; if (isup && volume2 + volumeStep <= 1) { player.volume = volume2 + volumeStep; } else if (!isup && volume2 - volumeStep >= 0) { player.volume = volume2 - volumeStep; } } }]); return Keyboard2; }(); var keyboard = function keyboard2() { var player = this; player.keyboard = new Keyboard(player); }; exports2.default = { name: "keyboard", method: keyboard }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var localPreview = function localPreview2() { var player = this; var root = player.root; function onUpload(upload) { player.uploadFile = upload.files[0]; var url = URL.createObjectURL(player.uploadFile); if ((0, _util.hasClass)(root, "xgplayer-nostart")) { player.config.url = url; player.start(); } else { player.src = url; var playPromise = player.play(); if (playPromise !== void 0 && playPromise) { playPromise.catch(function(err) { }); } } } player.on("upload", onUpload); function onDestroy() { player.off("upload", onUpload); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "localPreview", method: localPreview }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var memoryPlay2 = function memoryPlay3() { var player = this; player.on("memoryPlayStart", function(lastPlayTime) { setTimeout(function() { console.log("memoryPlayStart", lastPlayTime, player.readyState, 11); player.currentTime = lastPlayTime; }); }); }; exports2.default = { name: "memoryPlay", method: memoryPlay2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _draggabilly = __webpack_require__(93); var _draggabilly2 = _interopRequireDefault2(_draggabilly); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var miniplayer2 = function miniplayer3() { var player = this; var root = player.root; function onMiniplayerBtnClick() { if ((0, _util.hasClass)(root, "xgplayer-miniplayer-active")) { player.exitMiniplayer(); } else { player.getMiniplayer(); } } player.on("miniplayerBtnClick", onMiniplayerBtnClick); function onDestroy() { player.off("miniplayerBtnClick", onMiniplayerBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); player.getMiniplayer = function() { if ((0, _util.hasClass)(root, "xgplayer-is-fullscreen")) { this.exitFullscreen(root); } if ((0, _util.hasClass)(root, "xgplayer-is-cssfullscreen")) { this.exitCssFullscreen(); } if ((0, _util.hasClass)(root, "xgplayer-rotate-fullscreen")) { this.exitRotateFullscreen(); } var dragLay = (0, _util.createDom)("xg-miniplayer-lay", "
", {}, "xgplayer-miniplayer-lay"); this.root.appendChild(dragLay); var dragHandle = (0, _util.createDom)("xg-miniplayer-drag", '
' + this.lang.MINIPLAYER_DRAG + "
", { tabindex: 9 }, "xgplayer-miniplayer-drag"); this.root.appendChild(dragHandle); new _draggabilly2.default(".xgplayer", { handle: ".drag-handle" }); (0, _util.addClass)(this.root, "xgplayer-miniplayer-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"; if (this.config.miniplayerConfig) { if (this.config.miniplayerConfig.top !== void 0) { this.root.style.top = this.config.miniplayerConfig.top + "px"; this.root.style.bottom = ""; } if (this.config.miniplayerConfig.bottom !== void 0) { this.root.style.bottom = this.config.miniplayerConfig.bottom + "px"; } if (this.config.miniplayerConfig.left !== void 0) { this.root.style.left = this.config.miniplayerConfig.left + "px"; this.root.style.right = ""; } if (this.config.miniplayerConfig.right !== void 0) { this.root.style.right = this.config.miniplayerConfig.right + "px"; } if (this.config.miniplayerConfig.width !== void 0) { this.root.style.width = this.config.miniplayerConfig.width + "px"; } if (this.config.miniplayerConfig.height !== void 0) { this.root.style.height = this.config.miniplayerConfig.height + "px"; } } if (this.config.fluid) { this.root.style["padding-top"] = ""; } var player2 = this; ["click", "touchend"].forEach(function(item) { dragLay.addEventListener(item, function(e) { e.preventDefault(); e.stopPropagation(); player2.exitMiniplayer(); }); }); }; player.exitMiniplayer = function() { (0, _util.removeClass)(this.root, "xgplayer-miniplayer-active"); this.root.style.right = ""; this.root.style.bottom = ""; this.root.style.top = ""; this.root.style.left = ""; if (this.config.fluid) { this.root.style["width"] = "100%"; this.root.style["height"] = "0"; this.root.style["padding-top"] = this.config.height * 100 / this.config.width + "%"; } else { if (this.config.width) { if (typeof this.config.width !== "number") { this.root.style.width = this.config.width; } else { this.root.style.width = this.config.width + "px"; } } if (this.config.height) { if (typeof this.config.height !== "number") { this.root.style.height = this.config.height; } else { this.root.style.height = this.config.height + "px"; } } } var dragLay = (0, _util.findDom)(this.root, ".xgplayer-miniplayer-lay"); if (dragLay && dragLay.parentNode) { dragLay.parentNode.removeChild(dragLay); } var dragHandle = (0, _util.findDom)(this.root, ".xgplayer-miniplayer-drag"); if (dragHandle && dragHandle.parentNode) { dragHandle.parentNode.removeChild(dragHandle); } }; }; exports2.default = { name: "miniplayer", method: miniplayer2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! * Draggabilly v2.3.0 * Make that shiz draggable * https://draggabilly.desandro.com * MIT license */ (function(window2, factory) { { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(94), __webpack_require__(95)], __WEBPACK_AMD_DEFINE_RESULT__ = function(getSize, Unidragger) { return factory(window2, getSize, Unidragger); }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(window, function factory(window2, getSize, Unidragger) { function extend(a, b) { for (var prop in b) { a[prop] = b[prop]; } return a; } function noop() { } var jQuery = window2.jQuery; function Draggabilly(element, options) { this.element = typeof element == "string" ? document.querySelector(element) : element; if (jQuery) { this.$element = jQuery(this.element); } this.options = extend({}, this.constructor.defaults); this.option(options); this._create(); } var proto = Draggabilly.prototype = Object.create(Unidragger.prototype); Draggabilly.defaults = {}; proto.option = function(opts) { extend(this.options, opts); }; var positionValues = { relative: true, absolute: true, fixed: true }; proto._create = function() { this.position = {}; this._getPosition(); this.startPoint = { x: 0, y: 0 }; this.dragPoint = { x: 0, y: 0 }; this.startPosition = extend({}, this.position); var style = getComputedStyle(this.element); if (!positionValues[style.position]) { this.element.style.position = "relative"; } this.on("pointerMove", this.onPointerMove); this.on("pointerUp", this.onPointerUp); this.enable(); this.setHandles(); }; proto.setHandles = function() { this.handles = this.options.handle ? this.element.querySelectorAll(this.options.handle) : [this.element]; this.bindHandles(); }; proto.dispatchEvent = function(type, event2, args) { var emitArgs = [event2].concat(args); this.emitEvent(type, emitArgs); this.dispatchJQueryEvent(type, event2, args); }; proto.dispatchJQueryEvent = function(type, event2, args) { var jquery = window2.jQuery; if (!jquery || !this.$element) { return; } var $event = jquery.Event(event2); $event.type = type; this.$element.trigger($event, args); }; proto._getPosition = function() { var style = getComputedStyle(this.element); var x = this._getPositionCoord(style.left, "width"); var y = this._getPositionCoord(style.top, "height"); this.position.x = isNaN(x) ? 0 : x; this.position.y = isNaN(y) ? 0 : y; this._addTransformPosition(style); }; proto._getPositionCoord = function(styleSide, measure) { if (styleSide.indexOf("%") != -1) { var parentSize = getSize(this.element.parentNode); return !parentSize ? 0 : parseFloat(styleSide) / 100 * parentSize[measure]; } return parseInt(styleSide, 10); }; proto._addTransformPosition = function(style) { var transform = style.transform; if (transform.indexOf("matrix") !== 0) { return; } var matrixValues = transform.split(","); var xIndex = transform.indexOf("matrix3d") === 0 ? 12 : 4; var translateX = parseInt(matrixValues[xIndex], 10); var translateY = parseInt(matrixValues[xIndex + 1], 10); this.position.x += translateX; this.position.y += translateY; }; proto.onPointerDown = function(event2, pointer) { this.element.classList.add("is-pointer-down"); this.dispatchJQueryEvent("pointerDown", event2, [pointer]); }; proto.pointerDown = function(event2, pointer) { var isOkay = this.okayPointerDown(event2); if (!isOkay || !this.isEnabled) { this._pointerReset(); return; } this.pointerDownPointer = { pageX: pointer.pageX, pageY: pointer.pageY }; event2.preventDefault(); this.pointerDownBlur(); this._bindPostStartEvents(event2); this.element.classList.add("is-pointer-down"); this.dispatchEvent("pointerDown", event2, [pointer]); }; proto.dragStart = function(event2, pointer) { if (!this.isEnabled) { return; } this._getPosition(); this.measureContainment(); this.startPosition.x = this.position.x; this.startPosition.y = this.position.y; this.setLeftTop(); this.dragPoint.x = 0; this.dragPoint.y = 0; this.element.classList.add("is-dragging"); this.dispatchEvent("dragStart", event2, [pointer]); this.animate(); }; proto.measureContainment = function() { var container = this.getContainer(); if (!container) { return; } var elemSize = getSize(this.element); var containerSize = getSize(container); var elemRect = this.element.getBoundingClientRect(); var containerRect = container.getBoundingClientRect(); var borderSizeX = containerSize.borderLeftWidth + containerSize.borderRightWidth; var borderSizeY = containerSize.borderTopWidth + containerSize.borderBottomWidth; var position = this.relativeStartPosition = { x: elemRect.left - (containerRect.left + containerSize.borderLeftWidth), y: elemRect.top - (containerRect.top + containerSize.borderTopWidth) }; this.containSize = { width: containerSize.width - borderSizeX - position.x - elemSize.width, height: containerSize.height - borderSizeY - position.y - elemSize.height }; }; proto.getContainer = function() { var containment = this.options.containment; if (!containment) { return; } var isElement = containment instanceof HTMLElement; if (isElement) { return containment; } if (typeof containment == "string") { return document.querySelector(containment); } return this.element.parentNode; }; proto.onPointerMove = function(event2, pointer, moveVector) { this.dispatchJQueryEvent("pointerMove", event2, [pointer, moveVector]); }; proto.dragMove = function(event2, pointer, moveVector) { if (!this.isEnabled) { return; } var dragX = moveVector.x; var dragY = moveVector.y; var grid = this.options.grid; var gridX = grid && grid[0]; var gridY = grid && grid[1]; dragX = applyGrid(dragX, gridX); dragY = applyGrid(dragY, gridY); dragX = this.containDrag("x", dragX, gridX); dragY = this.containDrag("y", dragY, gridY); dragX = this.options.axis == "y" ? 0 : dragX; dragY = this.options.axis == "x" ? 0 : dragY; this.position.x = this.startPosition.x + dragX; this.position.y = this.startPosition.y + dragY; this.dragPoint.x = dragX; this.dragPoint.y = dragY; this.dispatchEvent("dragMove", event2, [pointer, moveVector]); }; function applyGrid(value, grid, method) { method = method || "round"; return grid ? Math[method](value / grid) * grid : value; } proto.containDrag = function(axis, drag, grid) { if (!this.options.containment) { return drag; } var measure = axis == "x" ? "width" : "height"; var rel = this.relativeStartPosition[axis]; var min = applyGrid(-rel, grid, "ceil"); var max = this.containSize[measure]; max = applyGrid(max, grid, "floor"); return Math.max(min, Math.min(max, drag)); }; proto.onPointerUp = function(event2, pointer) { this.element.classList.remove("is-pointer-down"); this.dispatchJQueryEvent("pointerUp", event2, [pointer]); }; proto.dragEnd = function(event2, pointer) { if (!this.isEnabled) { return; } this.element.style.transform = ""; this.setLeftTop(); this.element.classList.remove("is-dragging"); this.dispatchEvent("dragEnd", event2, [pointer]); }; proto.animate = function() { if (!this.isDragging) { return; } this.positionDrag(); var _this = this; requestAnimationFrame(function animateFrame() { _this.animate(); }); }; proto.setLeftTop = function() { this.element.style.left = this.position.x + "px"; this.element.style.top = this.position.y + "px"; }; proto.positionDrag = function() { this.element.style.transform = "translate3d( " + this.dragPoint.x + "px, " + this.dragPoint.y + "px, 0)"; }; proto.staticClick = function(event2, pointer) { this.dispatchEvent("staticClick", event2, [pointer]); }; proto.setPosition = function(x, y) { this.position.x = x; this.position.y = y; this.setLeftTop(); }; proto.enable = function() { this.isEnabled = true; }; proto.disable = function() { this.isEnabled = false; if (this.isDragging) { this.dragEnd(); } }; proto.destroy = function() { this.disable(); this.element.style.transform = ""; this.element.style.left = ""; this.element.style.top = ""; this.element.style.position = ""; this.unbindHandles(); if (this.$element) { this.$element.removeData("draggabilly"); } }; proto._init = noop; if (jQuery && jQuery.bridget) { jQuery.bridget("draggabilly", Draggabilly); } return Draggabilly; }); }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(window2, factory) { { !(__WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.call(exports2, __webpack_require__, exports2, module2) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(window, function factory() { function getStyleSize(value) { var num = parseFloat(value); var isValid = value.indexOf("%") == -1 && !isNaN(num); return isValid && num; } function noop() { } var logError = typeof console == "undefined" ? noop : function(message) { console.error(message); }; var measurements = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"]; var measurementsLength = measurements.length; function getZeroSize() { var size = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }; for (var i = 0; i < measurementsLength; i++) { var measurement = measurements[i]; size[measurement] = 0; } return size; } function getStyle(elem) { var style = getComputedStyle(elem); if (!style) { logError("Style returned " + style + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"); } return style; } var isSetup = false; var isBoxSizeOuter; function setup() { if (isSetup) { return; } isSetup = true; var div = document.createElement("div"); div.style.width = "200px"; div.style.padding = "1px 2px 3px 4px"; div.style.borderStyle = "solid"; div.style.borderWidth = "1px 2px 3px 4px"; div.style.boxSizing = "border-box"; var body = document.body || document.documentElement; body.appendChild(div); var style = getStyle(div); isBoxSizeOuter = Math.round(getStyleSize(style.width)) == 200; getSize.isBoxSizeOuter = isBoxSizeOuter; body.removeChild(div); } function getSize(elem) { setup(); if (typeof elem == "string") { elem = document.querySelector(elem); } if (!elem || typeof elem != "object" || !elem.nodeType) { return; } var style = getStyle(elem); if (style.display == "none") { return getZeroSize(); } var size = {}; size.width = elem.offsetWidth; size.height = elem.offsetHeight; var isBorderBox = size.isBorderBox = style.boxSizing == "border-box"; for (var i = 0; i < measurementsLength; i++) { var measurement = measurements[i]; var value = style[measurement]; var num = parseFloat(value); size[measurement] = !isNaN(num) ? num : 0; } var paddingWidth = size.paddingLeft + size.paddingRight; var paddingHeight = size.paddingTop + size.paddingBottom; var marginWidth = size.marginLeft + size.marginRight; var marginHeight = size.marginTop + size.marginBottom; var borderWidth = size.borderLeftWidth + size.borderRightWidth; var borderHeight = size.borderTopWidth + size.borderBottomWidth; var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; var styleWidth = getStyleSize(style.width); if (styleWidth !== false) { size.width = styleWidth + (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth); } var styleHeight = getStyleSize(style.height); if (styleHeight !== false) { size.height = styleHeight + (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight); } size.innerWidth = size.width - (paddingWidth + borderWidth); size.innerHeight = size.height - (paddingHeight + borderHeight); size.outerWidth = size.width + marginWidth; size.outerHeight = size.height + marginHeight; return size; } return getSize; }); }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! * Unidragger v2.3.1 * Draggable base class * MIT license */ (function(window2, factory) { { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(96)], __WEBPACK_AMD_DEFINE_RESULT__ = function(Unipointer) { return factory(window2, Unipointer); }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(window, function factory(window2, Unipointer) { function Unidragger() { } var proto = Unidragger.prototype = Object.create(Unipointer.prototype); proto.bindHandles = function() { this._bindHandles(true); }; proto.unbindHandles = function() { this._bindHandles(false); }; proto._bindHandles = function(isAdd) { isAdd = isAdd === void 0 ? true : isAdd; var bindMethod = isAdd ? "addEventListener" : "removeEventListener"; var touchAction = isAdd ? this._touchActionValue : ""; for (var i = 0; i < this.handles.length; i++) { var handle = this.handles[i]; this._bindStartEvent(handle, isAdd); handle[bindMethod]("click", this); if (window2.PointerEvent) { handle.style.touchAction = touchAction; } } }; proto._touchActionValue = "none"; proto.pointerDown = function(event2, pointer) { var isOkay = this.okayPointerDown(event2); if (!isOkay) { return; } this.pointerDownPointer = { pageX: pointer.pageX, pageY: pointer.pageY }; event2.preventDefault(); this.pointerDownBlur(); this._bindPostStartEvents(event2); this.emitEvent("pointerDown", [event2, pointer]); }; var cursorNodes = { TEXTAREA: true, INPUT: true, SELECT: true, OPTION: true }; var clickTypes = { radio: true, checkbox: true, button: true, submit: true, image: true, file: true }; proto.okayPointerDown = function(event2) { var isCursorNode = cursorNodes[event2.target.nodeName]; var isClickType = clickTypes[event2.target.type]; var isOkay = !isCursorNode || isClickType; if (!isOkay) { this._pointerReset(); } return isOkay; }; proto.pointerDownBlur = function() { var focused = document.activeElement; var canBlur = focused && focused.blur && focused != document.body; if (canBlur) { focused.blur(); } }; proto.pointerMove = function(event2, pointer) { var moveVector = this._dragPointerMove(event2, pointer); this.emitEvent("pointerMove", [event2, pointer, moveVector]); this._dragMove(event2, pointer, moveVector); }; proto._dragPointerMove = function(event2, pointer) { var moveVector = { x: pointer.pageX - this.pointerDownPointer.pageX, y: pointer.pageY - this.pointerDownPointer.pageY }; if (!this.isDragging && this.hasDragStarted(moveVector)) { this._dragStart(event2, pointer); } return moveVector; }; proto.hasDragStarted = function(moveVector) { return Math.abs(moveVector.x) > 3 || Math.abs(moveVector.y) > 3; }; proto.pointerUp = function(event2, pointer) { this.emitEvent("pointerUp", [event2, pointer]); this._dragPointerUp(event2, pointer); }; proto._dragPointerUp = function(event2, pointer) { if (this.isDragging) { this._dragEnd(event2, pointer); } else { this._staticClick(event2, pointer); } }; proto._dragStart = function(event2, pointer) { this.isDragging = true; this.isPreventingClicks = true; this.dragStart(event2, pointer); }; proto.dragStart = function(event2, pointer) { this.emitEvent("dragStart", [event2, pointer]); }; proto._dragMove = function(event2, pointer, moveVector) { if (!this.isDragging) { return; } this.dragMove(event2, pointer, moveVector); }; proto.dragMove = function(event2, pointer, moveVector) { event2.preventDefault(); this.emitEvent("dragMove", [event2, pointer, moveVector]); }; proto._dragEnd = function(event2, pointer) { this.isDragging = false; setTimeout(function() { delete this.isPreventingClicks; }.bind(this)); this.dragEnd(event2, pointer); }; proto.dragEnd = function(event2, pointer) { this.emitEvent("dragEnd", [event2, pointer]); }; proto.onclick = function(event2) { if (this.isPreventingClicks) { event2.preventDefault(); } }; proto._staticClick = function(event2, pointer) { if (this.isIgnoringMouseUp && event2.type == "mouseup") { return; } this.staticClick(event2, pointer); if (event2.type != "mouseup") { this.isIgnoringMouseUp = true; setTimeout(function() { delete this.isIgnoringMouseUp; }.bind(this), 400); } }; proto.staticClick = function(event2, pointer) { this.emitEvent("staticClick", [event2, pointer]); }; Unidragger.getPointerPoint = Unipointer.getPointerPoint; return Unidragger; }); }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! * Unipointer v2.3.0 * base class for doing one thing with pointer event * MIT license */ (function(window2, factory) { { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(97)], __WEBPACK_AMD_DEFINE_RESULT__ = function(EvEmitter) { return factory(window2, EvEmitter); }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(window, function factory(window2, EvEmitter) { function noop() { } function Unipointer() { } var proto = Unipointer.prototype = Object.create(EvEmitter.prototype); proto.bindStartEvent = function(elem) { this._bindStartEvent(elem, true); }; proto.unbindStartEvent = function(elem) { this._bindStartEvent(elem, false); }; proto._bindStartEvent = function(elem, isAdd) { isAdd = isAdd === void 0 ? true : isAdd; var bindMethod = isAdd ? "addEventListener" : "removeEventListener"; var startEvent = "mousedown"; if (window2.PointerEvent) { startEvent = "pointerdown"; } else if ("ontouchstart" in window2) { startEvent = "touchstart"; } elem[bindMethod](startEvent, this); }; proto.handleEvent = function(event2) { var method = "on" + event2.type; if (this[method]) { this[method](event2); } }; proto.getTouch = function(touches) { for (var i = 0; i < touches.length; i++) { var touch = touches[i]; if (touch.identifier == this.pointerIdentifier) { return touch; } } }; proto.onmousedown = function(event2) { var button = event2.button; if (button && button !== 0 && button !== 1) { return; } this._pointerDown(event2, event2); }; proto.ontouchstart = function(event2) { this._pointerDown(event2, event2.changedTouches[0]); }; proto.onpointerdown = function(event2) { this._pointerDown(event2, event2); }; proto._pointerDown = function(event2, pointer) { if (event2.button || this.isPointerDown) { return; } this.isPointerDown = true; this.pointerIdentifier = pointer.pointerId !== void 0 ? pointer.pointerId : pointer.identifier; this.pointerDown(event2, pointer); }; proto.pointerDown = function(event2, pointer) { this._bindPostStartEvents(event2); this.emitEvent("pointerDown", [event2, pointer]); }; var postStartEvents = { mousedown: ["mousemove", "mouseup"], touchstart: ["touchmove", "touchend", "touchcancel"], pointerdown: ["pointermove", "pointerup", "pointercancel"] }; proto._bindPostStartEvents = function(event2) { if (!event2) { return; } var events = postStartEvents[event2.type]; events.forEach(function(eventName) { window2.addEventListener(eventName, this); }, this); this._boundPointerEvents = events; }; proto._unbindPostStartEvents = function() { if (!this._boundPointerEvents) { return; } this._boundPointerEvents.forEach(function(eventName) { window2.removeEventListener(eventName, this); }, this); delete this._boundPointerEvents; }; proto.onmousemove = function(event2) { this._pointerMove(event2, event2); }; proto.onpointermove = function(event2) { if (event2.pointerId == this.pointerIdentifier) { this._pointerMove(event2, event2); } }; proto.ontouchmove = function(event2) { var touch = this.getTouch(event2.changedTouches); if (touch) { this._pointerMove(event2, touch); } }; proto._pointerMove = function(event2, pointer) { this.pointerMove(event2, pointer); }; proto.pointerMove = function(event2, pointer) { this.emitEvent("pointerMove", [event2, pointer]); }; proto.onmouseup = function(event2) { this._pointerUp(event2, event2); }; proto.onpointerup = function(event2) { if (event2.pointerId == this.pointerIdentifier) { this._pointerUp(event2, event2); } }; proto.ontouchend = function(event2) { var touch = this.getTouch(event2.changedTouches); if (touch) { this._pointerUp(event2, touch); } }; proto._pointerUp = function(event2, pointer) { this._pointerDone(); this.pointerUp(event2, pointer); }; proto.pointerUp = function(event2, pointer) { this.emitEvent("pointerUp", [event2, pointer]); }; proto._pointerDone = function() { this._pointerReset(); this._unbindPostStartEvents(); this.pointerDone(); }; proto._pointerReset = function() { this.isPointerDown = false; delete this.pointerIdentifier; }; proto.pointerDone = noop; proto.onpointercancel = function(event2) { if (event2.pointerId == this.pointerIdentifier) { this._pointerCancel(event2, event2); } }; proto.ontouchcancel = function(event2) { var touch = this.getTouch(event2.changedTouches); if (touch) { this._pointerCancel(event2, touch); } }; proto._pointerCancel = function(event2, pointer) { this._pointerDone(); this.pointerCancel(event2, pointer); }; proto.pointerCancel = function(event2, pointer) { this.emitEvent("pointerCancel", [event2, pointer]); }; Unipointer.getPointerPoint = function(pointer) { return { x: pointer.pageX, y: pointer.pageY }; }; return Unipointer; }); }, function(module2, exports2, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__; (function(global2, factory) { { !(__WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.call(exports2, __webpack_require__, exports2, module2) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(typeof window != "undefined" ? window : this, function() { function EvEmitter() { } var proto = EvEmitter.prototype; proto.on = function(eventName, listener) { if (!eventName || !listener) { return; } var events = this._events = this._events || {}; var listeners = events[eventName] = events[eventName] || []; if (listeners.indexOf(listener) == -1) { listeners.push(listener); } return this; }; proto.once = function(eventName, listener) { if (!eventName || !listener) { return; } this.on(eventName, listener); var onceEvents = this._onceEvents = this._onceEvents || {}; var onceListeners = onceEvents[eventName] = onceEvents[eventName] || {}; onceListeners[listener] = true; return this; }; proto.off = function(eventName, listener) { var listeners = this._events && this._events[eventName]; if (!listeners || !listeners.length) { return; } var index2 = listeners.indexOf(listener); if (index2 != -1) { listeners.splice(index2, 1); } return this; }; proto.emitEvent = function(eventName, args) { var listeners = this._events && this._events[eventName]; if (!listeners || !listeners.length) { return; } listeners = listeners.slice(0); args = args || []; var onceListeners = this._onceEvents && this._onceEvents[eventName]; for (var i = 0; i < listeners.length; i++) { var listener = listeners[i]; var isOnce = onceListeners && onceListeners[listener]; if (isOnce) { this.off(eventName, listener); delete onceListeners[listener]; } listener.apply(this, args); } return this; }; proto.allOff = function() { delete this._events; delete this._onceEvents; }; return EvEmitter; }); }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var pip2 = function pip3() { var _this = this; var player = this; function onPipBtnClick() { if (player.video !== document.pictureInPictureElement) { player.video.requestPictureInPicture(); } else { document.exitPictureInPicture(); } } player.on("pipBtnClick", onPipBtnClick); var onWebkitpresentationmodechanged = function onWebkitpresentationmodechanged2(e) { var mode = player.video.webkitPresentationMode; _this.pMode = mode; if (mode === _util.PresentationMode.PIP) { player.emit("requestPictureInPicture", e.pictureInPictureWindow); } else if (mode === _util.PresentationMode.INLINE) { player.emit("exitPictureInPicture"); } }; player.video.addEventListener("enterpictureinpicture", function(pipWindow) { (0, _util.addClass)(player.root, "xgplayer-pip-active"); player.emit("requestPictureInPicture", pipWindow); }); player.video.addEventListener("leavepictureinpicture", function() { (0, _util.removeClass)(player.root, "xgplayer-pip-active"); player.emit("exitPictureInPicture"); }); (0, _util.checkWebkitSetPresentationMode)(player.video) && player.video.addEventListener("webkitpresentationmodechanged", onWebkitpresentationmodechanged); function onDestroy() { player.off("pipBtnClick", onPipBtnClick); player.off("destroy", onDestroy); (0, _util.checkWebkitSetPresentationMode)(player.video) && player.video.removeEventListener("webkitpresentationmodechanged", onWebkitpresentationmodechanged); } player.once("destroy", onDestroy); }; exports2.default = { name: "pip", method: pip2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var playNext2 = function playNext3() { var player = this; var nextBtn = player.config.playNext; player.currentVideoIndex = -1; function onPlayNextBtnClick() { if (player.currentVideoIndex + 1 < nextBtn.urlList.length) { player.currentVideoIndex++; player.video.autoplay = true; player.src = nextBtn.urlList[player.currentVideoIndex]; player.emit("playerNext", player.currentVideoIndex + 1); if (player.currentVideoIndex + 1 === nextBtn.urlList.length) { player.emit("urlListEnd"); } } } player.on("playNextBtnClick", onPlayNextBtnClick); function onDestroy() { player.off("playNextBtnClick", onPlayNextBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "playNext", method: playNext2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var reload2 = function reload3() { var player = this; var reloadConfig = player.config.reload; if (!reloadConfig) { return; } function onReloadBtnClick() { (0, _util.removeClass)(player.root, "xgplayer-is-error"); player.src = player.config.url; } player.on("reloadBtnClick", onReloadBtnClick); function onDestroy() { player.off("reloadBtnClick", onReloadBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "reload", method: reload2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var rotate2 = function rotate3() { var player = this; var rotateConfig = player.config.rotate; if (!rotateConfig) { return; } function onRotateBtnClick() { player.rotate(rotateConfig.clockwise, rotateConfig.innerRotate); } player.on("rotateBtnClick", onRotateBtnClick); function onDestroy() { player.off("rotateBtnClick", onRotateBtnClick); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); player.updateRotateDeg = function() { var player2 = this; if (!player2.rotateDeg) { player2.rotateDeg = 0; } var width = player2.root.offsetWidth; var height = player2.root.offsetHeight; var targetWidth = player2.video.videoWidth; var targetHeight = player2.video.videoHeight; if (!player2.config.rotate.innerRotate && player2.config.rotate.controlsFix) { player2.root.style.width = height + "px"; player2.root.style.height = width + "px"; } var scale = void 0; if (player2.rotateDeg === 0.25 || player2.rotateDeg === 0.75) { if (player2.config.rotate.innerRotate) { if (targetWidth / targetHeight > height / width) { var videoWidth = 0; if (targetHeight / targetWidth > height / width) { videoWidth = height * targetWidth / targetHeight; } else { videoWidth = width; } scale = height / videoWidth; } else { var videoHeight = 0; if (targetHeight / targetWidth > height / width) { videoHeight = height; } else { videoHeight = width * targetHeight / targetWidth; } scale = width / videoHeight; } } else { if (width >= height) { scale = width / height; } else { scale = height / width; } } scale = Number(scale.toFixed(5)); } else { scale = 1; } if (player2.config.rotate.innerRotate) { player2.video.style.transformOrigin = "center center"; player2.video.style.transform = "rotate(" + player2.rotateDeg + "turn) scale(" + scale + ")"; player2.video.style.webKitTransform = "rotate(" + player2.rotateDeg + "turn) scale(" + scale + ")"; } else { if (player2.config.rotate.controlsFix) { player2.video.style.transformOrigin = "center center"; player2.video.style.transform = "rotate(" + player2.rotateDeg + "turn) scale(" + scale + ")"; player2.video.style.webKitTransform = "rotate(" + player2.rotateDeg + "turn) scale(" + scale + ")"; } else { player2.root.style.transformOrigin = "center center"; player2.root.style.transform = "rotate(" + player2.rotateDeg + "turn) scale(" + 1 + ")"; player2.root.style.webKitTransform = "rotate(" + player2.rotateDeg + "turn) scale(" + 1 + ")"; } } }; player.rotate = function() { var clockwise = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; var times = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; var player2 = this; if (!player2.rotateDeg) { player2.rotateDeg = 0; } var factor = clockwise ? 1 : -1; player2.rotateDeg = (player2.rotateDeg + 1 + factor * 0.25 * times) % 1; this.updateRotateDeg(); player2.emit("rotate", player2.rotateDeg * 360); }; }; exports2.default = { name: "rotate", method: rotate2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var screenShot2 = function screenShot3() { var player = this; var screenShotOptions = player.config.screenShot; if (!screenShotOptions) { return; } player.video.setAttribute("crossOrigin", "anonymous"); var encoderOptions = 0.92; if (screenShotOptions.quality || screenShotOptions.quality === 0) { encoderOptions = screenShotOptions.quality; } var type = screenShotOptions.type === void 0 ? "image/png" : screenShotOptions.type; var format2 = screenShotOptions.format === void 0 ? ".png" : screenShotOptions.format; var canvas = document.createElement("canvas"); var canvasCtx = canvas.getContext("2d"); var img = new Image(); canvas.width = this.config.width || 600; canvas.height = this.config.height || 337.5; var saveScreenShot = function saveScreenShot2(data, filename) { var saveLink = document.createElement("a"); saveLink.href = data; saveLink.download = filename; var event2 = document.createEvent("MouseEvents"); event2.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); saveLink.dispatchEvent(event2); }; player.screenShot = function() { var save = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; save = screenShotOptions.saveImg === void 0 ? save : screenShotOptions.saveImg; canvas.width = player.video.videoWidth || 600; canvas.height = player.video.videoHeight || 337.5; img.onload = function() { canvasCtx.drawImage(player.video, 0, 0, canvas.width, canvas.height); img.src = canvas.toDataURL(type, encoderOptions).replace(type, "image/octet-stream"); var screenShotImg = img.src.replace(/^data:image\/[^;]+/, "data:application/octet-stream"); player.emit("screenShot", screenShotImg); save && saveScreenShot(screenShotImg, "\u622A\u56FE" + format2); }(); }; player.on("screenShotBtnClick", player.screenShot); function onDestroy() { player.off("screenShotBtnClick", player.screenShot); player.off("destroy", onDestroy); } player.once("destroy", onDestroy); }; exports2.default = { name: "screenShot", method: screenShot2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _error = __webpack_require__(4); var _error2 = _interopRequireDefault2(_error); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function stallCheck() { var player = this; if (!player.config.enableStallCheck) return; var lastCurrentTime = 0; var stallFlag = void 0, stallCheckTimer = void 0; player.once("complete", function() { setInterval(function() { if (player.currentTime - (lastCurrentTime || 0) > 0.1 || player.paused) { if (stallFlag === 1 || stallFlag === 2) { stallFlag = 0; clearTimeout(stallCheckTimer); stallCheckTimer = null; } } else { if (!stallFlag) { stallFlag = 1; stallCheckTimer = setTimeout(function() { if (stallFlag === 1) { stallFlag = 2; player.emit("error", new _error2.default("STALL")); } stallCheckTimer = null; }, 2e4); } } lastCurrentTime = player.currentTime; }, 1e3); }); } exports2.default = { name: "stallCheck", method: stallCheck }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _util = __webpack_require__(0); var _sniffer = __webpack_require__(5); var _sniffer2 = _interopRequireDefault2(_sniffer); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var volume2 = function volume3() { var player = this; var root = player.root; var container = void 0, slider = void 0, bar = void 0, selected = void 0; function onCanplay() { if (!player.controls) return; player.volume = player.config.volume; container = player.controls.querySelector(".xgplayer-volume"); if (!container) return; slider = container.querySelector(".xgplayer-slider"); bar = container.querySelector(".xgplayer-bar"); selected = container.querySelector(".xgplayer-drag"); if (_sniffer2.default.device === "mobile") { if (player.volume === 0) { player.video.muted = true; } onVolumeChange(); } } player.once("canplay", onCanplay); function onVolumeBarClick(e) { if (!slider) return; player.video.muted = false; slider.focus(); (0, _util.event)(e); var barRect = bar.getBoundingClientRect(); var pos = { x: e.clientX, y: e.clientY }; var height = selected.getBoundingClientRect().height; var isMove = false; var onMove = function onMove2(e2) { e2.preventDefault(); e2.stopPropagation(); (0, _util.event)(e2); isMove = true; var w = height - e2.clientY + pos.y; var now = w / barRect.height; selected.style.height = w + "px"; player.volume = Math.max(Math.min(now, 1), 0); }; var onUp = function onUp2(e2) { e2.preventDefault(); e2.stopPropagation(); (0, _util.event)(e2); window.removeEventListener("mousemove", onMove); window.removeEventListener("touchmove", onMove); window.removeEventListener("mouseup", onUp2); window.removeEventListener("touchend", onUp2); if (!isMove) { var w = barRect.height - (e2.clientY - barRect.top); var now = w / barRect.height; selected.style.height = w + "px"; if (now <= 0) { if (player.volume > 0) { selected.volume = player.video.volume; } else { now = selected.volume; } } player.volume = Math.max(Math.min(now, 1), 0); } slider.volume = player.volume; isMove = false; }; window.addEventListener("mousemove", onMove); window.addEventListener("touchmove", onMove); window.addEventListener("mouseup", onUp); window.addEventListener("touchend", onUp); return false; } player.on("volumeBarClick", onVolumeBarClick); function onVolumeIconClick() { if (_sniffer2.default.device === "mobile") { if (player.video.muted) { player.video.muted = false; player.emit("unmute"); player.volume = 1; } else { player.video.muted = true; player.emit("mute"); player.volume = 0; } } else { if (!slider) return; player.video.muted = false; if (player.volume < 0.1) { if (slider.volume < 0.1) { player.volume = 0.6; } else { player.volume = slider.volume; } player.emit("unmute"); } else { player.volume = 0; player.emit("mute"); } } } player.on("volumeIconClick", onVolumeIconClick); function onVolumeIconEnter() { (0, _util.addClass)(root, "xgplayer-volume-active"); if (container) { container.focus(); } } player.on("volumeIconEnter", onVolumeIconEnter); function onVolumeIconLeave() { (0, _util.removeClass)(root, "xgplayer-volume-active"); } player.on("volumeIconLeave", onVolumeIconLeave); var _changeTimer = null; function onVolumeChange() { if (_changeTimer) { clearTimeout(_changeTimer); } _changeTimer = setTimeout(function() { if (_sniffer2.default.device === "mobile") { (0, _util.removeClass)(root, "xgplayer-volume-muted"); (0, _util.removeClass)(root, "xgplayer-volume-large"); if (player.video.muted || player.video.defaultMuted) { if (!player.video.muted) { player.video.muted = true; } player.video.defaultMuted = false; (0, _util.addClass)(root, "xgplayer-volume-muted"); } else { (0, _util.addClass)(root, "xgplayer-volume-large"); } } else { (0, _util.removeClass)(root, "xgplayer-volume-muted"); (0, _util.removeClass)(root, "xgplayer-volume-small"); (0, _util.removeClass)(root, "xgplayer-volume-large"); if (player.volume === 0 || player.muted) { (0, _util.addClass)(root, "xgplayer-volume-muted"); } else if (player.volume < 0.5) { (0, _util.addClass)(root, "xgplayer-volume-small"); } else { (0, _util.addClass)(root, "xgplayer-volume-large"); } if (!bar) return; var containerHeight = bar.getBoundingClientRect().height || 76; selected.style.height = player.volume * containerHeight + "px"; } }, 50); } player.on("volumechange", onVolumeChange); function onDestroy() { player.off("canplay", onCanplay); player.off("volumeBarClick", onVolumeBarClick); player.off("volumeIconClick", onVolumeIconClick); player.off("volumeIconEnter", onVolumeIconEnter); player.off("volumeIconLeave", onVolumeIconLeave); player.off("volumechange", onVolumeChange); player.off("destroy", onDestroy); if (_changeTimer) { clearTimeout(_changeTimer); _changeTimer = null; } } player.once("destroy", onDestroy); }; exports2.default = { name: "volume", method: volume2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { Object.defineProperty(exports2, "__esModule", { value: true }); var _createClass2 = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _xgplayerSubtitles = __webpack_require__(106); var _xgplayerSubtitles2 = _interopRequireDefault2(_xgplayerSubtitles); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var defaultStyle = { follow: true, mode: "stroke", followBottom: 50, fitVideo: true, offsetBottom: 2, baseSizeX: 49, baseSizeY: 28, minSize: 16, minMobileSize: 13, line: "double", fontColor: "#fff" }; var XgSubtitles = function() { function XgSubtitles2(player, list, style) { var _this = this; _classCallCheck2(this, XgSubtitles2); var subtitle = this.create(list, style, player.textTrackShowDefault); subtitle.attachPlayer(player); this.subtitle = subtitle; this.player = player; this.positionData = { vBottom: 0, marginBottom: 0 }; this.isActive = false; this.followBottom = style.followBottom; ["onSubtitleResize", "onFocus", "onBlur"].map(function(item) { _this[item] = _this[item].bind(_this); }); if (player.controls && style.follow) { this.subtitle.on("resize", this.onSubtitleResize); player.on("focus", this.onFocus); player.on("blur", this.onBlur); } } _createClass2(XgSubtitles2, [{ key: "create", value: function create(textTrack3) { var style = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var defaultOpen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; var config = { subTitles: textTrack3, defaultOpen }; Object.keys(style).map(function(key) { config[key] = style[key]; }); return new _xgplayerSubtitles2.default(config); } }, { key: "switch", value: function _switch(subtitle) { return this.subtitle.switch(subtitle); } }, { key: "switchOff", value: function switchOff() { return this.subtitle.switchOff(); } }, { key: "setSubTitles", value: function setSubTitles(subtitles, showDefault, isNeedMove) { return this.subtitle.setSubTitles(subtitles, showDefault, isNeedMove); } }, { key: "onFocus", value: function onFocus() { var _positionData = this.positionData, marginBottom = _positionData.marginBottom, vBottom = _positionData.vBottom; if (this.isActive || !marginBottom) { return; } this.isActive = true; var bottom = marginBottom + vBottom; if (this.followBottom > bottom) { bottom = this.followBottom; } this.subtitle && (this.subtitle.root.style.bottom = bottom + "px"); } }, { key: "onBlur", value: function onBlur() { this.isActive = false; var bottom = this.positionData.vBottom + this.positionData.marginBottom; this.subtitle && (this.subtitle.root.style.bottom = bottom + "px"); } }, { key: "onSubtitleResize", value: function onSubtitleResize(data) { this.positionData.vBottom = data.vBottom; this.positionData.marginBottom = data.marginBottom; } }, { key: "destroy", value: function destroy() { this.subtitle.off("resize", this.onSubtitleResize); this.player.off("focus", this.onFocus); this.player.off("blur", this.onBlur); this.subtitle.destroy(); this.subtitle = null; } }]); return XgSubtitles2; }(); var textTrack2 = function textTrack3() { var _this2 = this; var player = this; var textTrack4 = player.config.textTrack; if (!textTrack4) { return; } var textTrackStyle = player.config.textTrackStyle || {}; Object.keys(defaultStyle).map(function(key) { if (textTrackStyle[key] === void 0) { textTrackStyle[key] = defaultStyle[key]; } }); player.textTrackShowDefault = false; player.config.textTrack.map(function(item, index2) { if (!item.id && !item.language) { item.id = index2; } !item.url && (item.url = item.src); !item.language && (item.language = item.srclang); item.isDefault === void 0 && (item.isDefault = item.default); !player.textTrackShowDefault && (player.textTrackShowDefault = item.isDefault || item.default); }); this.subTitles = new XgSubtitles(player, player.config.textTrack, textTrackStyle); player.setSubTitles = function(textTrack5) { var needRemove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; var showDefault = false; textTrack5.map(function(item, index2) { if (!item.id && !item.language) { item.id = index2; } !item.url && (item.url = item.src); !item.language && (item.language = item.srclang); item.isDefault === void 0 && (item.isDefault = item.default); item.isDefault && (showDefault = true); }); player.textTrackShowDefault = showDefault; _this2.subTitles.setSubTitles(textTrack5, showDefault, needRemove); player.emit("subtitle_change", { off: false, isListUpdate: true, list: textTrack5 }); }; player.switchSubTitle = function() { var subtitle = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { id: "", language: "" }; _this2.subTitles.switch(subtitle).then(function(data) { if (data.code === 0) { subtitle.off = false; subtitle.isListUpdate = false; subtitle.list = []; player.emit("subtitle_change", subtitle); } }); }; player.switchOffSubtile = function() { _this2.subTitles.switchOff(); player.emit("subtitle_change", { off: true, isListUpdate: false, list: [] }); }; function onDestroy() { this.subTitles.destroy(); this.subTitles = null; } player.once("destroy", onDestroy); }; exports2.default = { name: "textTrack", method: textTrack2 }; module2.exports = exports2["default"]; }, function(module2, exports2, __webpack_require__) { !function(t, e) { module2.exports = e(); }(this, function() { function t(t2) { return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2; } function e(t2, e2) { return e2 = { exports: {} }, t2(e2, e2.exports), e2.exports; } function n(t2) { var e2, n2; this.promise = new t2(function(t3, r2) { if (e2 !== void 0 || n2 !== void 0) throw TypeError("Bad Promise constructor"); e2 = t3, n2 = r2; }), this.resolve = F(e2), this.reject = F(n2); } function r(t2) { var e2 = t2.length; return e2 === 3 ? (60 * (60 * Number(t2[0]) + Number(t2[1])) * 1e3 + 1e3 * Number(t2[2])) / 1e3 : e2 === 2 ? (60 * Number(t2[0]) * 1e3 + 1e3 * Number(t2[1])) / 1e3 : Number(t2[0]); } function i(t2) { return /^(\-|\+)?\d+(\.\d+)?$/.test(t2); } function o(t2) { return t2; } function s(t2, e2) { return t2 >= 0 && t2 < e2.length ? e2[t2] : ""; } function a(t2, e2) { if (!t2) return false; if (t2.classList) return Array.prototype.some.call(t2.classList, function(t3) { return t3 === e2; }); var n2 = t2.className && Je(t2.className) === "object" ? t2.getAttribute("class") : t2.className; return n2 && !!n2.match(new RegExp("(\\s|^)" + e2 + "(\\s|$)")); } function u(t2, e2) { t2 && (t2.classList ? e2.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function(e3) { e3 && t2.classList.add(e3); }) : a(t2, e2) || (t2.className && Je(t2.className) === "object" ? t2.setAttribute("class", t2.getAttribute("class") + " " + e2) : t2.className += " " + e2)); } function c(t2, e2) { t2 && (t2.classList ? e2.split(/\s+/g).forEach(function(e3) { t2.classList.remove(e3); }) : a(t2, e2) && e2.split(/\s+/g).forEach(function(e3) { var n2 = new RegExp("(\\s|^)" + e3 + "(\\s|$)"); t2.className && Je(t2.className) === "object" ? t2.setAttribute("class", t2.getAttribute("class").replace(n2, " ")) : t2.className = t2.className.replace(n2, " "); })); } function l(t2, e2, n2) { var r2 = e2.length; if (r2 < 1) return -1; if (n2 = n2 < 0 ? 0 : n2 >= r2 ? r2 - 1 : n2, e2[n2].start <= t2 && t2 < e2[n2].end) return n2; for (var i2 = e2[n2].end <= t2 ? n2 + 1 : 0; i2 < r2; i2++) { if (e2[i2].start <= t2 && t2 < e2[i2].end) return i2; if (t2 > e2[i2].end && i2 + 1 < r2 && t2 < e2[i2 + 1].start) return -1; if (t2 > e2[i2].end && i2 + 1 >= r2) return -1; } return -1; } function f(t2, e2, n2) { var r2 = e2.length; if (r2 < 1) return []; var i2 = []; if ((n2 = n2 < 0 ? 0 : n2 >= r2 ? r2 - 1 : n2) < r2) for (var o2 = e2[n2].end <= t2 ? n2 : 0; o2 < r2 && (e2[o2].start <= t2 && t2 < e2[o2].end && i2.push(o2), !(t2 < e2[o2].start)); o2++) ; return i2; } function h(t2) { return Object.prototype.toString.call(t2).match(/([^\s.*]+)(?=]$)/g)[0]; } function d() { var t2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "div", e2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", n2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", i2 = document.createElement(t2); return i2.className = r2, i2.innerHTML = e2, kr(n2).forEach(function(e3) { var r3 = e3, o2 = n2[e3]; t2 === "video" || t2 === "audio" || t2 === "live-video" ? o2 && i2.setAttribute(r3, o2) : i2.setAttribute(r3, o2); }), i2; } function p() { var t2 = navigator.userAgent, e2 = /(?:Windows Phone)/.test(t2), n2 = /(?:SymbianOS)/.test(t2) || e2, r2 = /(?:Android)/.test(t2), i2 = /(?:Firefox)/.test(t2), o2 = /(?:iPad|PlayBook)/.test(t2) || r2 && !/(?:Mobile)/.test(t2) || i2 && /(?:Tablet)/.test(t2); return /(?:iPhone)/.test(t2) && !o2 || r2 || n2 || o2; } function v(t2) { var e2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", n2 = ""; t2.map(function(t3) { n2 += " " + e2 + " " + t3.key + " {" + t3.style + "}"; }); var r2 = document.createElement("style"), i2 = document.head || document.getElementsByTagName("head")[0]; if (r2.type = "text/css", r2.id = "ssss", r2.styleSheet) { var o2 = function() { try { r2.styleSheet.cssText = n2; } catch (t3) { } }; r2.styleSheet.disabled ? setTimeout(o2, 10) : o2(); } else { var s2 = document.createTextNode(n2); r2.appendChild(s2); } i2.appendChild(r2); } function y(t2, e2) { Ir || (Ir = new Lr()), Ir.addObserver(t2, e2); } function g(t2, e2) { Ir && Ir.unObserver(t2, e2); } function m(t2) { var e2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n2 = { code: Fr[t2].code, msg: Fr[t2].msg }; return kr(e2).map(function(t3) { n2[t3] = e2[t3]; }), n2; } function _(t2, e2, n2, r2, i2) { i2 ? n2(m(2, i2), { format: r2.format }) : r2.format ? (t2.list = r2.list, t2.format = r2.format, t2.styles = r2.styles, e2(t2)) : n2(m(3)); } function x(t2) { return new xr(function(e2, n2) { if (t2.list) return void e2(t2); if (t2.json) { var r2 = Nr.parseJson(t2.json); return t2.list = r2, t2.format = "json", void e2(t2); } if (t2.stringContent && !t2.url) Nr.parse(t2.stringContent, function(r3, i3) { _(t2, e2, n2, r3, i3); }); else if (t2.url) new Tr({ url: t2.url, type: "text" }).then(function(r3) { Nr.parse(r3.res.response, function(r4, i3) { _(t2, e2, n2, r4, i3); }); }).catch(function(e3) { var r3 = m(1, { statusText: e3.statusText, status: e3.status, type: e3.type, message: "http load error", url: t2.url }); n2(r3); }); else { var i2 = m(8); n2(i2); } }); } function b(t2, e2) { return !!(t2.id && t2.id === e2.id || t2.language && t2.language === e2.language); } var k = function(t2) { if (t2 == void 0) throw TypeError("Can't call method on " + t2); return t2; }, w = function(t2) { return Object(k(t2)); }, T = {}.hasOwnProperty, S = function(t2, e2) { return T.call(t2, e2); }, O = e(function(t2) { var e2 = t2.exports = { version: "2.6.12" }; typeof __e == "number" && (__e = e2); }), E = (O.version, e(function(t2) { var e2 = t2.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")(); typeof __g == "number" && (__g = e2); })), P = e(function(t2) { var e2 = E["__core-js_shared__"] || (E["__core-js_shared__"] = {}); (t2.exports = function(t3, n2) { return e2[t3] || (e2[t3] = n2 !== void 0 ? n2 : {}); })("versions", []).push({ version: O.version, mode: "pure", copyright: "\xA9 2020 Denis Pushkarev (zloirock.ru)" }); }), j = 0, M = Math.random(), A = function(t2) { return "Symbol(".concat(t2 === void 0 ? "" : t2, ")_", (++j + M).toString(36)); }, C = P("keys"), R = function(t2) { return C[t2] || (C[t2] = A(t2)); }, N = R("IE_PROTO"), L = Object.prototype, I = Object.getPrototypeOf || function(t2) { return t2 = w(t2), S(t2, N) ? t2[N] : typeof t2.constructor == "function" && t2 instanceof t2.constructor ? t2.constructor.prototype : t2 instanceof Object ? L : null; }, F = function(t2) { if (typeof t2 != "function") throw TypeError(t2 + " is not a function!"); return t2; }, z = function(t2, e2, n2) { if (F(t2), e2 === void 0) return t2; switch (n2) { case 1: return function(n3) { return t2.call(e2, n3); }; case 2: return function(n3, r2) { return t2.call(e2, n3, r2); }; case 3: return function(n3, r2, i2) { return t2.call(e2, n3, r2, i2); }; } return function() { return t2.apply(e2, arguments); }; }, B = function(t2) { return typeof t2 == "object" ? t2 !== null : typeof t2 == "function"; }, D = function(t2) { if (!B(t2)) throw TypeError(t2 + " is not an object!"); return t2; }, H = function(t2) { try { return !!t2(); } catch (t3) { return true; } }, V = !H(function() { return Object.defineProperty({}, "a", { get: function() { return 7; } }).a != 7; }), W = E.document, G = B(W) && B(W.createElement), U = function(t2) { return G ? W.createElement(t2) : {}; }, $ = !V && !H(function() { return Object.defineProperty(U("div"), "a", { get: function() { return 7; } }).a != 7; }), K = function(t2, e2) { if (!B(t2)) return t2; var n2, r2; if (e2 && typeof (n2 = t2.toString) == "function" && !B(r2 = n2.call(t2))) return r2; if (typeof (n2 = t2.valueOf) == "function" && !B(r2 = n2.call(t2))) return r2; if (!e2 && typeof (n2 = t2.toString) == "function" && !B(r2 = n2.call(t2))) return r2; throw TypeError("Can't convert object to primitive value"); }, J = Object.defineProperty, Y = { f: V ? Object.defineProperty : function(t2, e2, n2) { if (D(t2), e2 = K(e2, true), D(n2), $) try { return J(t2, e2, n2); } catch (t3) { } if ("get" in n2 || "set" in n2) throw TypeError("Accessors not supported!"); return "value" in n2 && (t2[e2] = n2.value), t2; } }, X = function(t2, e2) { return { enumerable: !(1 & t2), configurable: !(2 & t2), writable: !(4 & t2), value: e2 }; }, q = V ? function(t2, e2, n2) { return Y.f(t2, e2, X(1, n2)); } : function(t2, e2, n2) { return t2[e2] = n2, t2; }, Z = function(t2, e2, n2) { var r2, i2, o2, s2 = t2 & Z.F, a2 = t2 & Z.G, u2 = t2 & Z.S, c2 = t2 & Z.P, l2 = t2 & Z.B, f2 = t2 & Z.W, h2 = a2 ? O : O[e2] || (O[e2] = {}), d2 = h2.prototype, p2 = a2 ? E : u2 ? E[e2] : (E[e2] || {}).prototype; a2 && (n2 = e2); for (r2 in n2) (i2 = !s2 && p2 && p2[r2] !== void 0) && S(h2, r2) || (o2 = i2 ? p2[r2] : n2[r2], h2[r2] = a2 && typeof p2[r2] != "function" ? n2[r2] : l2 && i2 ? z(o2, E) : f2 && p2[r2] == o2 ? function(t3) { var e3 = function(e4, n3, r3) { if (this instanceof t3) { switch (arguments.length) { case 0: return new t3(); case 1: return new t3(e4); case 2: return new t3(e4, n3); } return new t3(e4, n3, r3); } return t3.apply(this, arguments); }; return e3.prototype = t3.prototype, e3; }(o2) : c2 && typeof o2 == "function" ? z(Function.call, o2) : o2, c2 && ((h2.virtual || (h2.virtual = {}))[r2] = o2, t2 & Z.R && d2 && !d2[r2] && q(d2, r2, o2))); }; Z.F = 1, Z.G = 2, Z.S = 4, Z.P = 8, Z.B = 16, Z.W = 32, Z.U = 64, Z.R = 128; var Q = Z, tt = function(t2, e2) { var n2 = (O.Object || {})[t2] || Object[t2], r2 = {}; r2[t2] = e2(n2), Q(Q.S + Q.F * H(function() { n2(1); }), "Object", r2); }; tt("getPrototypeOf", function() { return function(t2) { return I(w(t2)); }; }); var et = O.Object.getPrototypeOf, nt = t(e(function(t2) { t2.exports = { default: et, __esModule: true }; })), rt = t(e(function(t2, e2) { e2.__esModule = true, e2.default = function(t3, e3) { if (!(t3 instanceof e3)) throw new TypeError("Cannot call a class as a function"); }; })), it = Math.ceil, ot = Math.floor, st = function(t2) { return isNaN(t2 = +t2) ? 0 : (t2 > 0 ? ot : it)(t2); }, at = q, ut = {}, ct = {}.toString, lt = function(t2) { return ct.call(t2).slice(8, -1); }, ft = Object("z").propertyIsEnumerable(0) ? Object : function(t2) { return lt(t2) == "String" ? t2.split("") : Object(t2); }, ht = function(t2) { return ft(k(t2)); }, dt = Math.min, pt = function(t2) { return t2 > 0 ? dt(st(t2), 9007199254740991) : 0; }, vt = Math.max, yt = Math.min, gt = function(t2, e2) { return t2 = st(t2), t2 < 0 ? vt(t2 + e2, 0) : yt(t2, e2); }, mt = function(t2) { return function(e2, n2, r2) { var i2, o2 = ht(e2), s2 = pt(o2.length), a2 = gt(r2, s2); if (t2 && n2 != n2) { for (; s2 > a2; ) if ((i2 = o2[a2++]) != i2) return true; } else for (; s2 > a2; a2++) if ((t2 || a2 in o2) && o2[a2] === n2) return t2 || a2 || 0; return !t2 && -1; }; }(false), _t = R("IE_PROTO"), xt = function(t2, e2) { var n2, r2 = ht(t2), i2 = 0, o2 = []; for (n2 in r2) n2 != _t && S(r2, n2) && o2.push(n2); for (; e2.length > i2; ) S(r2, n2 = e2[i2++]) && (~mt(o2, n2) || o2.push(n2)); return o2; }, bt = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), kt = Object.keys || function(t2) { return xt(t2, bt); }, wt = V ? Object.defineProperties : function(t2, e2) { D(t2); for (var n2, r2 = kt(e2), i2 = r2.length, o2 = 0; i2 > o2; ) Y.f(t2, n2 = r2[o2++], e2[n2]); return t2; }, Tt = E.document, St = Tt && Tt.documentElement, Ot = R("IE_PROTO"), Et = function() { }, Pt = function() { var t2, e2 = U("iframe"), n2 = bt.length; for (e2.style.display = "none", St.appendChild(e2), e2.src = "javascript:", (t2 = e2.contentWindow.document).open(), t2.write("