mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:39:41 -08:00
6777 lines
301 KiB
JavaScript
6777 lines
301 KiB
JavaScript
(function (global, factory) {
|
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
(global = global || self, global.ArtplayerReact = factory());
|
|
}(this, (function () { 'use strict';
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
target[key] = source[key];
|
|
}
|
|
|
|
return target;
|
|
}
|
|
|
|
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
|
|
function _objectWithoutProperties(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
var key, i;
|
|
|
|
if (Object.getOwnPropertySymbols) {
|
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
key = sourceSymbolKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
|
|
return target;
|
|
}
|
|
|
|
var objectWithoutProperties = _objectWithoutProperties;
|
|
|
|
function _defineProperty(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
|
|
return obj;
|
|
}
|
|
|
|
var defineProperty = _defineProperty;
|
|
|
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
|
|
function createCommonjsModule(fn, module) {
|
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
}
|
|
|
|
var _typeof_1 = createCommonjsModule(function (module) {
|
|
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
|
|
|
|
function _typeof(obj) {
|
|
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
|
|
module.exports = _typeof = function _typeof(obj) {
|
|
return _typeof2(obj);
|
|
};
|
|
} else {
|
|
module.exports = _typeof = function _typeof(obj) {
|
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
|
|
};
|
|
}
|
|
|
|
return _typeof(obj);
|
|
}
|
|
|
|
module.exports = _typeof;
|
|
});
|
|
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
|
|
var classCallCheck = _classCallCheck;
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
|
|
var createClass = _createClass;
|
|
|
|
function _assertThisInitialized(self) {
|
|
if (self === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
var assertThisInitialized = _assertThisInitialized;
|
|
|
|
function _possibleConstructorReturn(self, call) {
|
|
if (call && (_typeof_1(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
|
|
return assertThisInitialized(self);
|
|
}
|
|
|
|
var possibleConstructorReturn = _possibleConstructorReturn;
|
|
|
|
var getPrototypeOf = createCommonjsModule(function (module) {
|
|
function _getPrototypeOf(o) {
|
|
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
};
|
|
return _getPrototypeOf(o);
|
|
}
|
|
|
|
module.exports = _getPrototypeOf;
|
|
});
|
|
|
|
var setPrototypeOf = createCommonjsModule(function (module) {
|
|
function _setPrototypeOf(o, p) {
|
|
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
o.__proto__ = p;
|
|
return o;
|
|
};
|
|
|
|
return _setPrototypeOf(o, p);
|
|
}
|
|
|
|
module.exports = _setPrototypeOf;
|
|
});
|
|
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
constructor: {
|
|
value: subClass,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
if (superClass) setPrototypeOf(subClass, superClass);
|
|
}
|
|
|
|
var inherits = _inherits;
|
|
|
|
/*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*/
|
|
/* eslint-disable no-unused-vars */
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
|
|
function toObject(val) {
|
|
if (val === null || val === undefined) {
|
|
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
}
|
|
|
|
return Object(val);
|
|
}
|
|
|
|
function shouldUseNative() {
|
|
try {
|
|
if (!Object.assign) {
|
|
return false;
|
|
}
|
|
|
|
// Detect buggy property enumeration order in older V8 versions.
|
|
|
|
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
test1[5] = 'de';
|
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
return false;
|
|
}
|
|
|
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
var test2 = {};
|
|
for (var i = 0; i < 10; i++) {
|
|
test2['_' + String.fromCharCode(i)] = i;
|
|
}
|
|
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
return test2[n];
|
|
});
|
|
if (order2.join('') !== '0123456789') {
|
|
return false;
|
|
}
|
|
|
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
var test3 = {};
|
|
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
test3[letter] = letter;
|
|
});
|
|
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
'abcdefghijklmnopqrst') {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
} catch (err) {
|
|
// We don't expect any of the above to throw, but better to be safe.
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
var from;
|
|
var to = toObject(target);
|
|
var symbols;
|
|
|
|
for (var s = 1; s < arguments.length; s++) {
|
|
from = Object(arguments[s]);
|
|
|
|
for (var key in from) {
|
|
if (hasOwnProperty.call(from, key)) {
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
|
|
if (getOwnPropertySymbols) {
|
|
symbols = getOwnPropertySymbols(from);
|
|
for (var i = 0; i < symbols.length; i++) {
|
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
to[symbols[i]] = from[symbols[i]];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return to;
|
|
};
|
|
|
|
var n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113;var z=n?Symbol.for("react.memo"):60115,aa=n?Symbol.for("react.lazy"):60116;var A="function"===typeof Symbol&&Symbol.iterator;
|
|
function B(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D={};
|
|
function E(a,b,c){this.props=a;this.context=b;this.refs=D;this.updater=c||C;}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(B(85));this.updater.enqueueSetState(this,a,b,"setState");};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F(){}F.prototype=E.prototype;function G(a,b,c){this.props=a;this.context=b;this.refs=D;this.updater=c||C;}var H=G.prototype=new F;
|
|
H.constructor=G;objectAssign(H,E.prototype);H.isPureReactComponent=!0;var I={current:null},J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};
|
|
function M(a,b,c){var e,d={},g=null,l=null;if(null!=b)for(e in void 0!==b.ref&&(l=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,e)&&!L.hasOwnProperty(e)&&(d[e]=b[e]);var f=arguments.length-2;if(1===f)d.children=c;else if(1<f){for(var k=Array(f),m=0;m<f;m++)k[m]=arguments[m+2];d.children=k;}if(a&&a.defaultProps)for(e in f=a.defaultProps,f)void 0===d[e]&&(d[e]=f[e]);return {$$typeof:p,type:a,key:g,ref:l,props:d,_owner:J.current}}
|
|
function ba(a,b){return {$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function N(a){return "object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return "$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var O=/\/+/g,P=[];function Q(a,b,c,e){if(P.length){var d=P.pop();d.result=a;d.keyPrefix=b;d.func=c;d.context=e;d.count=0;return d}return {result:a,keyPrefix:b,func:c,context:e,count:0}}
|
|
function R(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>P.length&&P.push(a);}
|
|
function S(a,b,c,e){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0;}}if(g)return c(e,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var l=0;l<a.length;l++){d=a[l];var f=b+T(d,l);g+=S(d,f,c,e);}else if(null===a||"object"!==typeof a?f=null:(f=A&&a[A]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),l=
|
|
0;!(d=a.next()).done;)d=d.value,f=b+T(d,l++),g+=S(d,f,c,e);else if("object"===d)throw c=""+a,Error(B(31,"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c,""));return g}function U(a,b,c){return null==a?0:S(a,"",b,c)}function T(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++);}
|
|
function da(a,b,c){var e=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?V(a,e,c,function(a){return a}):null!=a&&(N(a)&&(a=ba(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+c)),e.push(a));}function V(a,b,c,e,d){var g="";null!=c&&(g=(""+c).replace(O,"$&/")+"/");b=Q(b,g,e,d);U(a,da,b);R(b);}function W(){var a=I.current;if(null===a)throw Error(B(321));return a}
|
|
var X={Children:{map:function(a,b,c){if(null==a)return a;var e=[];V(a,e,null,b,c);return e},forEach:function(a,b,c){if(null==a)return a;b=Q(null,null,b,c);U(a,ca,b);R(b);},count:function(a){return U(a,function(){return null},null)},toArray:function(a){var b=[];V(a,b,null,function(a){return a});return b},only:function(a){if(!N(a))throw Error(B(143));return a}},createRef:function(){return {current:null}},Component:E,PureComponent:G,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
|
|
_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return {$$typeof:x,render:a}},lazy:function(a){return {$$typeof:aa,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return {$$typeof:z,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return W().useCallback(a,b)},useContext:function(a,b){return W().useContext(a,b)},useEffect:function(a,b){return W().useEffect(a,b)},useImperativeHandle:function(a,
|
|
b,c){return W().useImperativeHandle(a,b,c)},useDebugValue:function(){},useLayoutEffect:function(a,b){return W().useLayoutEffect(a,b)},useMemo:function(a,b){return W().useMemo(a,b)},useReducer:function(a,b,c){return W().useReducer(a,b,c)},useRef:function(a){return W().useRef(a)},useState:function(a){return W().useState(a)},Fragment:r,Profiler:u,StrictMode:t,Suspense:y,createElement:M,cloneElement:function(a,b,c){if(null===a||void 0===a)throw Error(B(267,a));var e=objectAssign({},a.props),d=a.key,g=a.ref,l=a._owner;
|
|
if(null!=b){void 0!==b.ref&&(g=b.ref,l=J.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(k in b)K.call(b,k)&&!L.hasOwnProperty(k)&&(e[k]=void 0===b[k]&&void 0!==f?f[k]:b[k]);}var k=arguments.length-2;if(1===k)e.children=c;else if(1<k){f=Array(k);for(var m=0;m<k;m++)f[m]=arguments[m+2];e.children=f;}return {$$typeof:p,type:a.type,key:d,ref:g,props:e,_owner:l}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.12.0",
|
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:J,IsSomeRendererActing:{current:!1},assign:objectAssign}},Y={default:X},Z=Y&&X||Y;var react_production_min=Z.default||Z;
|
|
|
|
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
|
|
var printWarning = function() {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
var loggedTypeFailures = {};
|
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
|
|
printWarning = function(text) {
|
|
var message = 'Warning: ' + text;
|
|
if (typeof console !== 'undefined') {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
// --- Welcome to debugging React ---
|
|
// This error was thrown as a convenience so that you can use this stack
|
|
// to find the callsite that caused this warning to fire.
|
|
throw new Error(message);
|
|
} catch (x) {}
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Assert that the values match with the type specs.
|
|
* Error messages are memorized and will only be shown once.
|
|
*
|
|
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
* @param {object} values Runtime values that need to be type-checked
|
|
* @param {string} location e.g. "prop", "context", "child context"
|
|
* @param {string} componentName Name of the component for error messages.
|
|
* @param {?Function} getStack Returns the component stack.
|
|
* @private
|
|
*/
|
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error;
|
|
// Prop type validation may throw. In case they do, we don't want to
|
|
// fail the render phase where it didn't fail before. So we log it.
|
|
// After these have been cleaned up, we'll let them throw.
|
|
try {
|
|
// This is intentionally an invariant that gets caught. It's the same
|
|
// behavior as without this statement except with a better message.
|
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
var err = Error(
|
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
);
|
|
err.name = 'Invariant Violation';
|
|
throw err;
|
|
}
|
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
if (error && !(error instanceof Error)) {
|
|
printWarning(
|
|
(componentName || 'React class') + ': type specification of ' +
|
|
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
'You may have forgotten to pass an argument to the type checker ' +
|
|
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
'shape all require an argument).'
|
|
);
|
|
}
|
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
// Only monitor this failure once because there tends to be a lot of the
|
|
// same error.
|
|
loggedTypeFailures[error.message] = true;
|
|
|
|
var stack = getStack ? getStack() : '';
|
|
|
|
printWarning(
|
|
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Resets warning cache when testing.
|
|
*
|
|
* @private
|
|
*/
|
|
checkPropTypes.resetWarningCache = function() {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
loggedTypeFailures = {};
|
|
}
|
|
};
|
|
|
|
var checkPropTypes_1 = checkPropTypes;
|
|
|
|
var react_development = createCommonjsModule(function (module) {
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
(function() {
|
|
|
|
var _assign = objectAssign;
|
|
var checkPropTypes = checkPropTypes_1;
|
|
|
|
// TODO: this is special because it gets imported during build.
|
|
|
|
var ReactVersion = '16.12.0';
|
|
|
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
// nor polyfill, then a plain number is used for performance.
|
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
|
|
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
function getIteratorFn(maybeIterable) {
|
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
return null;
|
|
}
|
|
|
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
|
|
if (typeof maybeIterator === 'function') {
|
|
return maybeIterator;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
// template literal strings. The messages will be replaced with error codes
|
|
// during build.
|
|
|
|
/**
|
|
* Use invariant() to assert state which your program assumes to be true.
|
|
*
|
|
* Provide sprintf-style format (only %s is supported) and arguments
|
|
* to provide information about what broke and what you were
|
|
* expecting.
|
|
*
|
|
* The invariant message will be stripped in production, but the invariant
|
|
* will remain to ensure logic does not differ in production.
|
|
*/
|
|
|
|
/**
|
|
* Forked from fbjs/warning:
|
|
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
*
|
|
* Only change is we use console.warn instead of console.error,
|
|
* and do nothing when 'console' is not supported.
|
|
* This really simplifies the code.
|
|
* ---
|
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
* This can be used to log issues in development environments in critical
|
|
* paths. Removing the logging code for production environments will keep the
|
|
* same logic and follow the same code paths.
|
|
*/
|
|
var lowPriorityWarningWithoutStack = function () {};
|
|
|
|
{
|
|
var printWarning = function (format) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
|
|
var argIndex = 0;
|
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
});
|
|
|
|
if (typeof console !== 'undefined') {
|
|
console.warn(message);
|
|
}
|
|
|
|
try {
|
|
// --- Welcome to debugging React ---
|
|
// This error was thrown as a convenience so that you can use this stack
|
|
// to find the callsite that caused this warning to fire.
|
|
throw new Error(message);
|
|
} catch (x) {}
|
|
};
|
|
|
|
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
if (format === undefined) {
|
|
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
}
|
|
|
|
if (!condition) {
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
args[_key2 - 2] = arguments[_key2];
|
|
}
|
|
|
|
printWarning.apply(void 0, [format].concat(args));
|
|
}
|
|
};
|
|
}
|
|
|
|
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
|
|
/**
|
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
* This can be used to log issues in development environments in critical
|
|
* paths. Removing the logging code for production environments will keep the
|
|
* same logic and follow the same code paths.
|
|
*/
|
|
var warningWithoutStack = function () {};
|
|
|
|
{
|
|
warningWithoutStack = function (condition, format) {
|
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
|
|
if (format === undefined) {
|
|
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
}
|
|
|
|
if (args.length > 8) {
|
|
// Check before the condition to catch violations early.
|
|
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
|
}
|
|
|
|
if (condition) {
|
|
return;
|
|
}
|
|
|
|
if (typeof console !== 'undefined') {
|
|
var argsWithFormat = args.map(function (item) {
|
|
return '' + item;
|
|
});
|
|
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
|
|
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
|
}
|
|
|
|
try {
|
|
// --- Welcome to debugging React ---
|
|
// This error was thrown as a convenience so that you can use this stack
|
|
// to find the callsite that caused this warning to fire.
|
|
var argIndex = 0;
|
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
});
|
|
throw new Error(message);
|
|
} catch (x) {}
|
|
};
|
|
}
|
|
|
|
var warningWithoutStack$1 = warningWithoutStack;
|
|
|
|
var didWarnStateUpdateForUnmountedComponent = {};
|
|
|
|
function warnNoop(publicInstance, callerName) {
|
|
{
|
|
var _constructor = publicInstance.constructor;
|
|
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
var warningKey = componentName + "." + callerName;
|
|
|
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
return;
|
|
}
|
|
|
|
warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
}
|
|
}
|
|
/**
|
|
* This is the abstract API for an update queue.
|
|
*/
|
|
|
|
|
|
var ReactNoopUpdateQueue = {
|
|
/**
|
|
* Checks whether or not this composite component is mounted.
|
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
* @return {boolean} True if mounted, false otherwise.
|
|
* @protected
|
|
* @final
|
|
*/
|
|
isMounted: function (publicInstance) {
|
|
return false;
|
|
},
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} callerName name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
|
warnNoop(publicInstance, 'forceUpdate');
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
* You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} completeState Next state.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} callerName name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
|
warnNoop(publicInstance, 'replaceState');
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the state. This only exists because _pendingState is
|
|
* internal. This provides a merging strategy that is not available to deep
|
|
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
* during the merge.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialState Next partial state to be merged with state.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} Name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
|
warnNoop(publicInstance, 'setState');
|
|
}
|
|
};
|
|
|
|
var emptyObject = {};
|
|
|
|
{
|
|
Object.freeze(emptyObject);
|
|
}
|
|
/**
|
|
* Base class helpers for the updating state of a component.
|
|
*/
|
|
|
|
|
|
function Component(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
|
|
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
|
|
// renderer.
|
|
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
|
|
Component.prototype.isReactComponent = {};
|
|
/**
|
|
* Sets a subset of the state. Always use this to mutate
|
|
* state. You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* There is no guarantee that calls to `setState` will run synchronously,
|
|
* as they may eventually be batched together. You can provide an optional
|
|
* callback that will be executed when the call to setState is actually
|
|
* completed.
|
|
*
|
|
* When a function is provided to setState, it will be called at some point in
|
|
* the future (not synchronously). It will be called with the up to date
|
|
* component arguments (state, props, context). These values can be different
|
|
* from this.* because your function may be called after receiveProps but before
|
|
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
* assigned to this.
|
|
*
|
|
* @param {object|function} partialState Next partial state or function to
|
|
* produce next partial state to be merged with current state.
|
|
* @param {?function} callback Called after state is updated.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
|
|
Component.prototype.setState = function (partialState, callback) {
|
|
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
{
|
|
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
}
|
|
}
|
|
|
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
};
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {?function} callback Called after update is complete.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
|
|
|
|
Component.prototype.forceUpdate = function (callback) {
|
|
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
};
|
|
/**
|
|
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
* we would like to deprecate them, we're not going to move them over to this
|
|
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
*/
|
|
|
|
|
|
{
|
|
var deprecatedAPIs = {
|
|
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
};
|
|
|
|
var defineDeprecationWarning = function (methodName, info) {
|
|
Object.defineProperty(Component.prototype, methodName, {
|
|
get: function () {
|
|
lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
return undefined;
|
|
}
|
|
});
|
|
};
|
|
|
|
for (var fnName in deprecatedAPIs) {
|
|
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function ComponentDummy() {}
|
|
|
|
ComponentDummy.prototype = Component.prototype;
|
|
/**
|
|
* Convenience component with default shallow equality check for sCU.
|
|
*/
|
|
|
|
function PureComponent(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
|
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
|
|
_assign(pureComponentPrototype, Component.prototype);
|
|
|
|
pureComponentPrototype.isPureReactComponent = true;
|
|
|
|
// an immutable object with a single mutable value
|
|
function createRef() {
|
|
var refObject = {
|
|
current: null
|
|
};
|
|
|
|
{
|
|
Object.seal(refObject);
|
|
}
|
|
|
|
return refObject;
|
|
}
|
|
|
|
/**
|
|
* Keeps track of the current dispatcher.
|
|
*/
|
|
var ReactCurrentDispatcher = {
|
|
/**
|
|
* @internal
|
|
* @type {ReactComponent}
|
|
*/
|
|
current: null
|
|
};
|
|
|
|
/**
|
|
* Keeps track of the current batch's configuration such as how long an update
|
|
* should suspend for if it needs to.
|
|
*/
|
|
var ReactCurrentBatchConfig = {
|
|
suspense: null
|
|
};
|
|
|
|
/**
|
|
* Keeps track of the current owner.
|
|
*
|
|
* The current owner is the component who should own any components that are
|
|
* currently being constructed.
|
|
*/
|
|
var ReactCurrentOwner = {
|
|
/**
|
|
* @internal
|
|
* @type {ReactComponent}
|
|
*/
|
|
current: null
|
|
};
|
|
|
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
var sourceInfo = '';
|
|
|
|
if (source) {
|
|
var path = source.fileName;
|
|
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
|
|
{
|
|
// In DEV, include code for a common special case:
|
|
// prefer "folder/index.js" instead of just "index.js".
|
|
if (/^index\./.test(fileName)) {
|
|
var match = path.match(BEFORE_SLASH_RE);
|
|
|
|
if (match) {
|
|
var pathBeforeSlash = match[1];
|
|
|
|
if (pathBeforeSlash) {
|
|
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
fileName = folderName + '/' + fileName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
} else if (ownerName) {
|
|
sourceInfo = ' (created by ' + ownerName + ')';
|
|
}
|
|
|
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
};
|
|
|
|
var Resolved = 1;
|
|
|
|
function refineResolvedLazyComponent(lazyComponent) {
|
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
}
|
|
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || '';
|
|
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
}
|
|
|
|
function getComponentName(type) {
|
|
if (type == null) {
|
|
// Host root, text node or just invalid type.
|
|
return null;
|
|
}
|
|
|
|
{
|
|
if (typeof type.tag === 'number') {
|
|
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
}
|
|
}
|
|
|
|
if (typeof type === 'function') {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
|
|
if (typeof type === 'string') {
|
|
return type;
|
|
}
|
|
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return 'Fragment';
|
|
|
|
case REACT_PORTAL_TYPE:
|
|
return 'Portal';
|
|
|
|
case REACT_PROFILER_TYPE:
|
|
return "Profiler";
|
|
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return 'StrictMode';
|
|
|
|
case REACT_SUSPENSE_TYPE:
|
|
return 'Suspense';
|
|
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return 'SuspenseList';
|
|
}
|
|
|
|
if (typeof type === 'object') {
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
return 'Context.Consumer';
|
|
|
|
case REACT_PROVIDER_TYPE:
|
|
return 'Context.Provider';
|
|
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
|
|
case REACT_LAZY_TYPE:
|
|
{
|
|
var thenable = type;
|
|
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
|
|
if (resolvedThenable) {
|
|
return getComponentName(resolvedThenable);
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
var ReactDebugCurrentFrame = {};
|
|
var currentlyValidatingElement = null;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
currentlyValidatingElement = element;
|
|
}
|
|
}
|
|
|
|
{
|
|
// Stack implementation injected by the current renderer.
|
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
|
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
var stack = ''; // Add an extra top frame while an element is being validated
|
|
|
|
if (currentlyValidatingElement) {
|
|
var name = getComponentName(currentlyValidatingElement.type);
|
|
var owner = currentlyValidatingElement._owner;
|
|
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
} // Delegate to the injected renderer-specific implementation
|
|
|
|
|
|
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
|
|
if (impl) {
|
|
stack += impl() || '';
|
|
}
|
|
|
|
return stack;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Used by act() to track whether you're inside an act() scope.
|
|
*/
|
|
var IsSomeRendererActing = {
|
|
current: false
|
|
};
|
|
|
|
var ReactSharedInternals = {
|
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
IsSomeRendererActing: IsSomeRendererActing,
|
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
assign: _assign
|
|
};
|
|
|
|
{
|
|
_assign(ReactSharedInternals, {
|
|
// These should not be included in production.
|
|
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
// TODO: remove in React 17.0.
|
|
ReactComponentTreeHook: {}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
* This can be used to log issues in development environments in critical
|
|
* paths. Removing the logging code for production environments will keep the
|
|
* same logic and follow the same code paths.
|
|
*/
|
|
|
|
var warning = warningWithoutStack$1;
|
|
|
|
{
|
|
warning = function (condition, format) {
|
|
if (condition) {
|
|
return;
|
|
}
|
|
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
|
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
|
|
warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
|
};
|
|
}
|
|
|
|
var warning$1 = warning;
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
var specialPropKeyWarningShown;
|
|
var specialPropRefWarningShown;
|
|
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, 'ref')) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
return config.ref !== undefined;
|
|
}
|
|
|
|
function hasValidKey(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, 'key')) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
return config.key !== undefined;
|
|
}
|
|
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingKey = function () {
|
|
if (!specialPropKeyWarningShown) {
|
|
specialPropKeyWarningShown = true;
|
|
warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
}
|
|
};
|
|
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, 'key', {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
|
|
function defineRefPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingRef = function () {
|
|
if (!specialPropRefWarningShown) {
|
|
specialPropRefWarningShown = true;
|
|
warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
}
|
|
};
|
|
|
|
warnAboutAccessingRef.isReactWarning = true;
|
|
Object.defineProperty(props, 'ref', {
|
|
get: warnAboutAccessingRef,
|
|
configurable: true
|
|
});
|
|
}
|
|
/**
|
|
* Factory method to create a new React element. This no longer adheres to
|
|
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
* if something is a React Element.
|
|
*
|
|
* @param {*} type
|
|
* @param {*} props
|
|
* @param {*} key
|
|
* @param {string|object} ref
|
|
* @param {*} owner
|
|
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
* different from the `owner` when React.createElement is called, so that we
|
|
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
* functions, and as long as `this` and owner are the same, there will be no
|
|
* change in behavior.
|
|
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
* indicating filename, line number, and/or other information.
|
|
* @internal
|
|
*/
|
|
|
|
|
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
var element = {
|
|
// This tag allows us to uniquely identify this as a React Element
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
// Built-in properties that belong on the element
|
|
type: type,
|
|
key: key,
|
|
ref: ref,
|
|
props: props,
|
|
// Record the component responsible for creating this element.
|
|
_owner: owner
|
|
};
|
|
|
|
{
|
|
// The validation flag is currently mutative. We put it on
|
|
// an external backing store so that we can freeze the whole object.
|
|
// This can be replaced with a WeakMap once they are implemented in
|
|
// commonly used development environments.
|
|
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
// the validation flag non-enumerable (where possible, which should
|
|
// include every environment we run tests in), so the test framework
|
|
// ignores it.
|
|
|
|
Object.defineProperty(element._store, 'validated', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: false
|
|
}); // self and source are DEV only properties.
|
|
|
|
Object.defineProperty(element, '_self', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: self
|
|
}); // Two elements created in two different places should be considered
|
|
// equal for testing purposes and therefore we hide it from enumeration.
|
|
|
|
Object.defineProperty(element, '_source', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: source
|
|
});
|
|
|
|
if (Object.freeze) {
|
|
Object.freeze(element.props);
|
|
Object.freeze(element);
|
|
}
|
|
}
|
|
|
|
return element;
|
|
};
|
|
/**
|
|
* Create and return a new ReactElement of the given type.
|
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
*/
|
|
|
|
function createElement(type, config, children) {
|
|
var propName; // Reserved names are extracted
|
|
|
|
var props = {};
|
|
var key = null;
|
|
var ref = null;
|
|
var self = null;
|
|
var source = null;
|
|
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
}
|
|
|
|
if (hasValidKey(config)) {
|
|
key = '' + config.key;
|
|
}
|
|
|
|
self = config.__self === undefined ? null : config.__self;
|
|
source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
|
|
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
} // Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
|
|
|
|
var childrenLength = arguments.length - 2;
|
|
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
|
|
{
|
|
if (Object.freeze) {
|
|
Object.freeze(childArray);
|
|
}
|
|
}
|
|
|
|
props.children = childArray;
|
|
} // Resolve default props
|
|
|
|
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
|
|
for (propName in defaultProps) {
|
|
if (props[propName] === undefined) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
{
|
|
if (key || ref) {
|
|
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
}
|
|
|
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
}
|
|
/**
|
|
* Return a function that produces ReactElements of a given type.
|
|
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
*/
|
|
|
|
|
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
return newElement;
|
|
}
|
|
/**
|
|
* Clone and return a new ReactElement using element as the starting point.
|
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
*/
|
|
|
|
function cloneElement(element, config, children) {
|
|
if (!!(element === null || element === undefined)) {
|
|
{
|
|
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
}
|
|
}
|
|
|
|
var propName; // Original props are copied
|
|
|
|
var props = _assign({}, element.props); // Reserved names are extracted
|
|
|
|
|
|
var key = element.key;
|
|
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
|
|
var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
|
|
// transpiler, and the original source is probably a better indicator of the
|
|
// true owner.
|
|
|
|
var source = element._source; // Owner will be preserved, unless ref is overridden
|
|
|
|
var owner = element._owner;
|
|
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
// Silently steal the ref from the parent.
|
|
ref = config.ref;
|
|
owner = ReactCurrentOwner.current;
|
|
}
|
|
|
|
if (hasValidKey(config)) {
|
|
key = '' + config.key;
|
|
} // Remaining properties override existing props
|
|
|
|
|
|
var defaultProps;
|
|
|
|
if (element.type && element.type.defaultProps) {
|
|
defaultProps = element.type.defaultProps;
|
|
}
|
|
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
if (config[propName] === undefined && defaultProps !== undefined) {
|
|
// Resolve default props
|
|
props[propName] = defaultProps[propName];
|
|
} else {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
} // Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
|
|
|
|
var childrenLength = arguments.length - 2;
|
|
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
|
|
props.children = childArray;
|
|
}
|
|
|
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
}
|
|
/**
|
|
* Verifies the object is a ReactElement.
|
|
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
* @param {?object} object
|
|
* @return {boolean} True if `object` is a ReactElement.
|
|
* @final
|
|
*/
|
|
|
|
function isValidElement(object) {
|
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
|
|
var SEPARATOR = '.';
|
|
var SUBSEPARATOR = ':';
|
|
/**
|
|
* Escape and wrap key so it is safe to use as a reactid
|
|
*
|
|
* @param {string} key to be escaped.
|
|
* @return {string} the escaped key.
|
|
*/
|
|
|
|
function escape(key) {
|
|
var escapeRegex = /[=:]/g;
|
|
var escaperLookup = {
|
|
'=': '=0',
|
|
':': '=2'
|
|
};
|
|
var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
|
return escaperLookup[match];
|
|
});
|
|
return '$' + escapedString;
|
|
}
|
|
/**
|
|
* TODO: Test that a single child and an array with one item have the same key
|
|
* pattern.
|
|
*/
|
|
|
|
|
|
var didWarnAboutMaps = false;
|
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
|
|
function escapeUserProvidedKey(text) {
|
|
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
|
}
|
|
|
|
var POOL_SIZE = 10;
|
|
var traverseContextPool = [];
|
|
|
|
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
if (traverseContextPool.length) {
|
|
var traverseContext = traverseContextPool.pop();
|
|
traverseContext.result = mapResult;
|
|
traverseContext.keyPrefix = keyPrefix;
|
|
traverseContext.func = mapFunction;
|
|
traverseContext.context = mapContext;
|
|
traverseContext.count = 0;
|
|
return traverseContext;
|
|
} else {
|
|
return {
|
|
result: mapResult,
|
|
keyPrefix: keyPrefix,
|
|
func: mapFunction,
|
|
context: mapContext,
|
|
count: 0
|
|
};
|
|
}
|
|
}
|
|
|
|
function releaseTraverseContext(traverseContext) {
|
|
traverseContext.result = null;
|
|
traverseContext.keyPrefix = null;
|
|
traverseContext.func = null;
|
|
traverseContext.context = null;
|
|
traverseContext.count = 0;
|
|
|
|
if (traverseContextPool.length < POOL_SIZE) {
|
|
traverseContextPool.push(traverseContext);
|
|
}
|
|
}
|
|
/**
|
|
* @param {?*} children Children tree container.
|
|
* @param {!string} nameSoFar Name of the key path so far.
|
|
* @param {!function} callback Callback to invoke with each child found.
|
|
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
* process.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
|
|
|
|
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
var type = typeof children;
|
|
|
|
if (type === 'undefined' || type === 'boolean') {
|
|
// All of the above are perceived as null.
|
|
children = null;
|
|
}
|
|
|
|
var invokeCallback = false;
|
|
|
|
if (children === null) {
|
|
invokeCallback = true;
|
|
} else {
|
|
switch (type) {
|
|
case 'string':
|
|
case 'number':
|
|
invokeCallback = true;
|
|
break;
|
|
|
|
case 'object':
|
|
switch (children.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
invokeCallback = true;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (invokeCallback) {
|
|
callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
|
|
// so that it's consistent if the number of children grows.
|
|
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
return 1;
|
|
}
|
|
|
|
var child;
|
|
var nextName;
|
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
|
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
child = children[i];
|
|
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
|
|
if (typeof iteratorFn === 'function') {
|
|
{
|
|
// Warn about using Maps as children
|
|
if (iteratorFn === children.entries) {
|
|
!didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
|
didWarnAboutMaps = true;
|
|
}
|
|
}
|
|
|
|
var iterator = iteratorFn.call(children);
|
|
var step;
|
|
var ii = 0;
|
|
|
|
while (!(step = iterator.next()).done) {
|
|
child = step.value;
|
|
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else if (type === 'object') {
|
|
var addendum = '';
|
|
|
|
{
|
|
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
}
|
|
|
|
var childrenString = '' + children;
|
|
|
|
{
|
|
{
|
|
throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return subtreeCount;
|
|
}
|
|
/**
|
|
* Traverses children that are typically specified as `props.children`, but
|
|
* might also be specified through attributes:
|
|
*
|
|
* - `traverseAllChildren(this.props.children, ...)`
|
|
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
*
|
|
* The `traverseContext` is an optional argument that is passed through the
|
|
* entire traversal. It can be used to store accumulations or anything else that
|
|
* the callback might find relevant.
|
|
*
|
|
* @param {?*} children Children tree object.
|
|
* @param {!function} callback To invoke upon traversing each child.
|
|
* @param {?*} traverseContext Context for traversal.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
|
|
|
|
function traverseAllChildren(children, callback, traverseContext) {
|
|
if (children == null) {
|
|
return 0;
|
|
}
|
|
|
|
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
}
|
|
/**
|
|
* Generate a key string that identifies a component within a set.
|
|
*
|
|
* @param {*} component A component that could contain a manual key.
|
|
* @param {number} index Index that is used if a manual key is not provided.
|
|
* @return {string}
|
|
*/
|
|
|
|
|
|
function getComponentKey(component, index) {
|
|
// Do some typechecking here since we call this blindly. We want to ensure
|
|
// that we don't block potential future ES APIs.
|
|
if (typeof component === 'object' && component !== null && component.key != null) {
|
|
// Explicit key
|
|
return escape(component.key);
|
|
} // Implicit key determined by the index in the set
|
|
|
|
|
|
return index.toString(36);
|
|
}
|
|
|
|
function forEachSingleChild(bookKeeping, child, name) {
|
|
var func = bookKeeping.func,
|
|
context = bookKeeping.context;
|
|
func.call(context, child, bookKeeping.count++);
|
|
}
|
|
/**
|
|
* Iterates through children that are typically specified as `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
*
|
|
* The provided forEachFunc(child, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} forEachFunc
|
|
* @param {*} forEachContext Context for forEachContext.
|
|
*/
|
|
|
|
|
|
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
|
|
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
|
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
releaseTraverseContext(traverseContext);
|
|
}
|
|
|
|
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
var result = bookKeeping.result,
|
|
keyPrefix = bookKeeping.keyPrefix,
|
|
func = bookKeeping.func,
|
|
context = bookKeeping.context;
|
|
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
|
|
if (Array.isArray(mappedChild)) {
|
|
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
|
return c;
|
|
});
|
|
} else if (mappedChild != null) {
|
|
if (isValidElement(mappedChild)) {
|
|
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
// traverseAllChildren used to do for objects as children
|
|
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
}
|
|
|
|
result.push(mappedChild);
|
|
}
|
|
}
|
|
|
|
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
var escapedPrefix = '';
|
|
|
|
if (prefix != null) {
|
|
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
}
|
|
|
|
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
|
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
releaseTraverseContext(traverseContext);
|
|
}
|
|
/**
|
|
* Maps children that are typically specified as `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
*
|
|
* The provided mapFunction(child, key, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} func The map function.
|
|
* @param {*} context Context for mapFunction.
|
|
* @return {object} Object containing the ordered map of results.
|
|
*/
|
|
|
|
|
|
function mapChildren(children, func, context) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
return result;
|
|
}
|
|
/**
|
|
* Count the number of children that are typically specified as
|
|
* `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @return {number} The number of children.
|
|
*/
|
|
|
|
|
|
function countChildren(children) {
|
|
return traverseAllChildren(children, function () {
|
|
return null;
|
|
}, null);
|
|
}
|
|
/**
|
|
* Flatten a children object (typically specified as `props.children`) and
|
|
* return an array with appropriately re-keyed children.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
|
*/
|
|
|
|
|
|
function toArray(children) {
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
|
return child;
|
|
});
|
|
return result;
|
|
}
|
|
/**
|
|
* Returns the first child in a collection of children and verifies that there
|
|
* is only one child in the collection.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
|
*
|
|
* The current implementation of this function assumes that a single child gets
|
|
* passed without a wrapper, but the purpose of this helper function is to
|
|
* abstract away the particular structure of children.
|
|
*
|
|
* @param {?object} children Child collection structure.
|
|
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
* structure.
|
|
*/
|
|
|
|
|
|
function onlyChild(children) {
|
|
if (!isValidElement(children)) {
|
|
{
|
|
throw Error("React.Children.only expected to receive a single React element child.");
|
|
}
|
|
}
|
|
|
|
return children;
|
|
}
|
|
|
|
function createContext(defaultValue, calculateChangedBits) {
|
|
if (calculateChangedBits === undefined) {
|
|
calculateChangedBits = null;
|
|
} else {
|
|
{
|
|
!(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
|
}
|
|
}
|
|
|
|
var context = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_calculateChangedBits: calculateChangedBits,
|
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
// some renderers as primary and others as secondary. We only expect
|
|
// there to be two concurrent renderers at most: React Native (primary) and
|
|
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
// Secondary renderers store their context values on separate fields.
|
|
_currentValue: defaultValue,
|
|
_currentValue2: defaultValue,
|
|
// Used to track how many concurrent renderers this context currently
|
|
// supports within in a single renderer. Such as parallel server rendering.
|
|
_threadCount: 0,
|
|
// These are circular
|
|
Provider: null,
|
|
Consumer: null
|
|
};
|
|
context.Provider = {
|
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
_context: context
|
|
};
|
|
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
var hasWarnedAboutUsingConsumerProvider = false;
|
|
|
|
{
|
|
// A separate object, but proxies back to the original context object for
|
|
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
// warn for the incorrect usage of Context as a Consumer.
|
|
var Consumer = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_context: context,
|
|
_calculateChangedBits: context._calculateChangedBits
|
|
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
|
|
Object.defineProperties(Consumer, {
|
|
Provider: {
|
|
get: function () {
|
|
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
}
|
|
|
|
return context.Provider;
|
|
},
|
|
set: function (_Provider) {
|
|
context.Provider = _Provider;
|
|
}
|
|
},
|
|
_currentValue: {
|
|
get: function () {
|
|
return context._currentValue;
|
|
},
|
|
set: function (_currentValue) {
|
|
context._currentValue = _currentValue;
|
|
}
|
|
},
|
|
_currentValue2: {
|
|
get: function () {
|
|
return context._currentValue2;
|
|
},
|
|
set: function (_currentValue2) {
|
|
context._currentValue2 = _currentValue2;
|
|
}
|
|
},
|
|
_threadCount: {
|
|
get: function () {
|
|
return context._threadCount;
|
|
},
|
|
set: function (_threadCount) {
|
|
context._threadCount = _threadCount;
|
|
}
|
|
},
|
|
Consumer: {
|
|
get: function () {
|
|
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
}
|
|
|
|
return context.Consumer;
|
|
}
|
|
}
|
|
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
|
|
context.Consumer = Consumer;
|
|
}
|
|
|
|
{
|
|
context._currentRenderer = null;
|
|
context._currentRenderer2 = null;
|
|
}
|
|
|
|
return context;
|
|
}
|
|
|
|
function lazy(ctor) {
|
|
var lazyType = {
|
|
$$typeof: REACT_LAZY_TYPE,
|
|
_ctor: ctor,
|
|
// React uses these fields to store the result.
|
|
_status: -1,
|
|
_result: null
|
|
};
|
|
|
|
{
|
|
// In production, this would just set it on the object.
|
|
var defaultProps;
|
|
var propTypes;
|
|
Object.defineProperties(lazyType, {
|
|
defaultProps: {
|
|
configurable: true,
|
|
get: function () {
|
|
return defaultProps;
|
|
},
|
|
set: function (newDefaultProps) {
|
|
warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
|
|
Object.defineProperty(lazyType, 'defaultProps', {
|
|
enumerable: true
|
|
});
|
|
}
|
|
},
|
|
propTypes: {
|
|
configurable: true,
|
|
get: function () {
|
|
return propTypes;
|
|
},
|
|
set: function (newPropTypes) {
|
|
warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
propTypes = newPropTypes; // Match production behavior more closely:
|
|
|
|
Object.defineProperty(lazyType, 'propTypes', {
|
|
enumerable: true
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
return lazyType;
|
|
}
|
|
|
|
function forwardRef(render) {
|
|
{
|
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
} else if (typeof render !== 'function') {
|
|
warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
} else {
|
|
!( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
|
|
render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
|
|
}
|
|
|
|
if (render != null) {
|
|
!(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
|
|
}
|
|
}
|
|
|
|
return {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render: render
|
|
};
|
|
}
|
|
|
|
function isValidElementType(type) {
|
|
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
}
|
|
|
|
function memo(type, compare) {
|
|
{
|
|
if (!isValidElementType(type)) {
|
|
warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
}
|
|
}
|
|
|
|
return {
|
|
$$typeof: REACT_MEMO_TYPE,
|
|
type: type,
|
|
compare: compare === undefined ? null : compare
|
|
};
|
|
}
|
|
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
|
|
if (!(dispatcher !== null)) {
|
|
{
|
|
throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
|
|
}
|
|
}
|
|
|
|
return dispatcher;
|
|
}
|
|
|
|
function useContext(Context, unstable_observedBits) {
|
|
var dispatcher = resolveDispatcher();
|
|
|
|
{
|
|
!(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values.
|
|
|
|
if (Context._context !== undefined) {
|
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
// and nobody should be using this in existing code.
|
|
|
|
if (realContext.Consumer === Context) {
|
|
warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
} else if (realContext.Provider === Context) {
|
|
warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
}
|
|
}
|
|
}
|
|
|
|
return dispatcher.useContext(Context, unstable_observedBits);
|
|
}
|
|
function useState(initialState) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useState(initialState);
|
|
}
|
|
function useReducer(reducer, initialArg, init) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useReducer(reducer, initialArg, init);
|
|
}
|
|
function useRef(initialValue) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useRef(initialValue);
|
|
}
|
|
function useEffect(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useEffect(create, inputs);
|
|
}
|
|
function useLayoutEffect(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useLayoutEffect(create, inputs);
|
|
}
|
|
function useCallback(callback, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useCallback(callback, inputs);
|
|
}
|
|
function useMemo(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useMemo(create, inputs);
|
|
}
|
|
function useImperativeHandle(ref, create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useImperativeHandle(ref, create, inputs);
|
|
}
|
|
function useDebugValue(value, formatterFn) {
|
|
{
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* ReactElementValidator provides a wrapper around a element factory
|
|
* which validates the props passed to the element. This is intended to be
|
|
* used only in DEV and could be replaced by a static type checker for languages
|
|
* that support it.
|
|
*/
|
|
var propTypesMisspellWarningShown;
|
|
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
|
|
function getDeclarationErrorAddendum() {
|
|
if (ReactCurrentOwner.current) {
|
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
|
|
if (name) {
|
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
function getSourceInfoErrorAddendum(source) {
|
|
if (source !== undefined) {
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
var lineNumber = source.lineNumber;
|
|
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
if (elementProps !== null && elementProps !== undefined) {
|
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
}
|
|
|
|
return '';
|
|
}
|
|
/**
|
|
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
* object keys are not valid. This allows us to keep track of children between
|
|
* updates.
|
|
*/
|
|
|
|
|
|
var ownerHasKeyUseWarning = {};
|
|
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
var info = getDeclarationErrorAddendum();
|
|
|
|
if (!info) {
|
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
|
|
if (parentName) {
|
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
}
|
|
}
|
|
|
|
return info;
|
|
}
|
|
/**
|
|
* Warn if the element doesn't have an explicit key assigned to it.
|
|
* This element is in an array. The array could grow and shrink or be
|
|
* reordered. All children that haven't already been validated are required to
|
|
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
* will only be shown once.
|
|
*
|
|
* @internal
|
|
* @param {ReactElement} element Element that requires a key.
|
|
* @param {*} parentType element's parent's type.
|
|
*/
|
|
|
|
|
|
function validateExplicitKey(element, parentType) {
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
|
|
element._store.validated = true;
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
// property, it may be the creator of the child that's responsible for
|
|
// assigning it a key.
|
|
|
|
var childOwner = '';
|
|
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
// Give the component that originally created this child.
|
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
}
|
|
|
|
setCurrentlyValidatingElement(element);
|
|
|
|
{
|
|
warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
}
|
|
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
/**
|
|
* Ensure that every element either is passed in a static location, in an
|
|
* array with an explicit keys property defined, or in an object literal
|
|
* with valid key property.
|
|
*
|
|
* @internal
|
|
* @param {ReactNode} node Statically passed child of any type.
|
|
* @param {*} parentType node's parent's type.
|
|
*/
|
|
|
|
|
|
function validateChildKeys(node, parentType) {
|
|
if (typeof node !== 'object') {
|
|
return;
|
|
}
|
|
|
|
if (Array.isArray(node)) {
|
|
for (var i = 0; i < node.length; i++) {
|
|
var child = node[i];
|
|
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
// This element was passed in a valid location.
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
|
|
if (typeof iteratorFn === 'function') {
|
|
// Entry iterators used to provide implicit keys,
|
|
// but now we print a separate warning for them later.
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Given an element, validate that its props follow the propTypes definition,
|
|
* provided by the type.
|
|
*
|
|
* @param {ReactElement} element
|
|
*/
|
|
|
|
|
|
function validatePropTypes(element) {
|
|
var type = element.type;
|
|
|
|
if (type === null || type === undefined || typeof type === 'string') {
|
|
return;
|
|
}
|
|
|
|
var name = getComponentName(type);
|
|
var propTypes;
|
|
|
|
if (typeof type === 'function') {
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
// Inner props are checked in the reconciler.
|
|
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
|
|
if (propTypes) {
|
|
setCurrentlyValidatingElement(element);
|
|
checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
|
setCurrentlyValidatingElement(null);
|
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
}
|
|
|
|
if (typeof type.getDefaultProps === 'function') {
|
|
!type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
|
}
|
|
}
|
|
/**
|
|
* Given a fragment, validate that it can only be provided with fragment props
|
|
* @param {ReactElement} fragment
|
|
*/
|
|
|
|
|
|
function validateFragmentProps(fragment) {
|
|
setCurrentlyValidatingElement(fragment);
|
|
var keys = Object.keys(fragment.props);
|
|
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
|
|
if (key !== 'children' && key !== 'key') {
|
|
warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (fragment.ref !== null) {
|
|
warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
}
|
|
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
function createElementWithValidation(type, props, children) {
|
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
// succeed and there will likely be errors in render.
|
|
|
|
if (!validType) {
|
|
var info = '';
|
|
|
|
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
}
|
|
|
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
|
|
var typeString;
|
|
|
|
if (type === null) {
|
|
typeString = 'null';
|
|
} else if (Array.isArray(type)) {
|
|
typeString = 'array';
|
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
|
|
warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
}
|
|
|
|
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
|
|
if (element == null) {
|
|
return element;
|
|
} // Skip key warning if the type isn't valid since our key validation logic
|
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
// We don't want exception behavior to differ between dev and prod.
|
|
// (Rendering will throw with a helpful message and as soon as the type is
|
|
// fixed, the key warnings will appear.)
|
|
|
|
|
|
if (validType) {
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], type);
|
|
}
|
|
}
|
|
|
|
if (type === REACT_FRAGMENT_TYPE) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
|
|
return element;
|
|
}
|
|
function createFactoryWithValidation(type) {
|
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
validatedFactory.type = type; // Legacy hook: remove it
|
|
|
|
{
|
|
Object.defineProperty(validatedFactory, 'type', {
|
|
enumerable: false,
|
|
get: function () {
|
|
lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
Object.defineProperty(this, 'type', {
|
|
value: type
|
|
});
|
|
return type;
|
|
}
|
|
});
|
|
}
|
|
|
|
return validatedFactory;
|
|
}
|
|
function cloneElementWithValidation(element, props, children) {
|
|
var newElement = cloneElement.apply(this, arguments);
|
|
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], newElement.type);
|
|
}
|
|
|
|
validatePropTypes(newElement);
|
|
return newElement;
|
|
}
|
|
|
|
{
|
|
|
|
try {
|
|
var frozenObject = Object.freeze({});
|
|
var testMap = new Map([[frozenObject, null]]);
|
|
var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
|
|
// https://github.com/rollup/rollup/issues/1771
|
|
// TODO: we can remove these if Rollup fixes the bug.
|
|
|
|
testMap.set(0, 0);
|
|
testSet.add(0);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
|
|
// For tests, we flush suspense fallbacks in an act scope;
|
|
// *except* in some of our own tests, where we test incremental loading states.
|
|
|
|
// Add a callback property to suspense to notify which promises are currently
|
|
// in the update queue. This allows reporting and tracing of what is causing
|
|
// the user to see a loading state.
|
|
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
// hydrated or deleted.
|
|
|
|
// Part of the simplification of React.createElement so we can eventually move
|
|
// from React.createElement to React.jsx
|
|
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
|
|
|
|
|
|
|
|
|
|
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
|
|
|
|
var React = {
|
|
Children: {
|
|
map: mapChildren,
|
|
forEach: forEachChildren,
|
|
count: countChildren,
|
|
toArray: toArray,
|
|
only: onlyChild
|
|
},
|
|
createRef: createRef,
|
|
Component: Component,
|
|
PureComponent: PureComponent,
|
|
createContext: createContext,
|
|
forwardRef: forwardRef,
|
|
lazy: lazy,
|
|
memo: memo,
|
|
useCallback: useCallback,
|
|
useContext: useContext,
|
|
useEffect: useEffect,
|
|
useImperativeHandle: useImperativeHandle,
|
|
useDebugValue: useDebugValue,
|
|
useLayoutEffect: useLayoutEffect,
|
|
useMemo: useMemo,
|
|
useReducer: useReducer,
|
|
useRef: useRef,
|
|
useState: useState,
|
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
Profiler: REACT_PROFILER_TYPE,
|
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
Suspense: REACT_SUSPENSE_TYPE,
|
|
createElement: createElementWithValidation,
|
|
cloneElement: cloneElementWithValidation,
|
|
createFactory: createFactoryWithValidation,
|
|
isValidElement: isValidElement,
|
|
version: ReactVersion,
|
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
};
|
|
|
|
|
|
|
|
var React$2 = Object.freeze({
|
|
default: React
|
|
});
|
|
|
|
var React$3 = ( React$2 && React ) || React$2;
|
|
|
|
// TODO: decide on the top-level export form.
|
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
|
|
|
|
var react = React$3.default || React$3;
|
|
|
|
module.exports = react;
|
|
})();
|
|
}
|
|
});
|
|
|
|
var react = createCommonjsModule(function (module) {
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
module.exports = react_production_min;
|
|
} else {
|
|
module.exports = react_development;
|
|
}
|
|
});
|
|
|
|
function styleInject(css, ref) {
|
|
if ( ref === void 0 ) ref = {};
|
|
var insertAt = ref.insertAt;
|
|
|
|
if (!css || typeof document === 'undefined') { return; }
|
|
|
|
var head = document.head || document.getElementsByTagName('head')[0];
|
|
var style = document.createElement('style');
|
|
style.type = 'text/css';
|
|
|
|
if (insertAt === 'top') {
|
|
if (head.firstChild) {
|
|
head.insertBefore(style, head.firstChild);
|
|
} else {
|
|
head.appendChild(style);
|
|
}
|
|
} else {
|
|
head.appendChild(style);
|
|
}
|
|
|
|
if (style.styleSheet) {
|
|
style.styleSheet.cssText = css;
|
|
} else {
|
|
style.appendChild(document.createTextNode(css));
|
|
}
|
|
}
|
|
|
|
var css = ".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFydHBsYXllci5zY3NzIl0sIm5hbWV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4O1xuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgbGluZS1oZWlnaHQ6IDEuNTsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtaWNvbiBzdmcge1xuICAgICAgZmlsbDogI2ZmZjsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciBpbWcge1xuICAgIG1heC13aWR0aDogMTAwJTtcbiAgICB2ZXJ0aWNhbC1hbGlnbjogdG9wOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyID4gPiA+IG9iamVjdCB7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogMDtcbiAgICBsZWZ0OiAwO1xuICAgIGhlaWdodDogMTAwJTtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICAgIHotaW5kZXg6IC0xOyB9XG4gIEBzdXBwb3J0cyAoLXdlYmtpdC1iYWNrZHJvcC1maWx0ZXI6IGluaXRpYWwpIG9yIChiYWNrZHJvcC1maWx0ZXI6IGluaXRpYWwpIHtcbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWJhY2tkcm9wLWZpbHRlciB7XG4gICAgICAtd2Via2l0LWJhY2tkcm9wLWZpbHRlcjogc2F0dXJhdGUoMTgwJSkgYmx1cigyMHB4KTtcbiAgICAgIGJhY2tkcm9wLWZpbHRlcjogc2F0dXJhdGUoMTgwJSkgYmx1cigyMHB4KTtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC43KSAhaW1wb3J0YW50OyB9IH1cbiJdfQ== */";
|
|
styleInject(css);
|
|
|
|
var css$1 = ".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZpZGVvLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNkJBQ0UsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxNQUFPLENBQ1AsS0FBTSxDQUNOLE9BQVEsQ0FDUixRQUFTLENBQ1QsVUFBVyxDQUNYLFdBQVksQ0FDWixxQkFBc0IsQ0FDdEIsY0FBaUIiLCJmaWxlIjoidmlkZW8uc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW8tcGxheWVyIC5hcnQtdmlkZW8ge1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDEwO1xuICBsZWZ0OiAwO1xuICB0b3A6IDA7XG4gIHJpZ2h0OiAwO1xuICBib3R0b206IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGJhY2tncm91bmQtY29sb3I6ICMwMDA7XG4gIGN1cnNvcjogcG9pbnRlcjsgfVxuIl19 */";
|
|
styleInject(css$1);
|
|
|
|
var css$2 = ".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN1YnRpdGxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0NBQ0UsWUFBYSxDQUNiLGlCQUFrQixDQUNsQixVQUFXLENBQ1gsV0FBWSxDQUNaLFVBQVcsQ0FDWCxjQUFlLENBQ2YsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxjQUFlLENBQ2YsbUJBQW9CLENBQ3BCLHlDQUFtRCxDQUNuRCxrQ0FDRSxZQUFlLENBRW5CLGtEQUNFLGFBQWdCIiwiZmlsZSI6InN1YnRpdGxlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LXN1YnRpdGxlIHtcbiAgZGlzcGxheTogbm9uZTtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiAyMDtcbiAgYm90dG9tOiA0MHB4O1xuICB3aWR0aDogMTAwJTtcbiAgcGFkZGluZzogMCAyMHB4O1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIGNvbG9yOiAjZmZmO1xuICBmb250LXNpemU6IDIwcHg7XG4gIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICB0ZXh0LXNoYWRvdzogMC41cHggMC41cHggMC41cHggcmdiYSgwLCAwLCAwLCAwLjUpOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtc3VidGl0bGUgcCB7XG4gICAgbWFyZ2luOiA1cHggMDsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtc3VidGl0bGUtc2hvdyAuYXJ0LXN1YnRpdGxlIHtcbiAgZGlzcGxheTogYmxvY2s7IH1cbiJdfQ== */";
|
|
styleInject(css$2);
|
|
|
|
var css$3 = ".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRhbm11a3Uuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwrQkFDRSxpQkFBa0IsQ0FDbEIsVUFBVyxDQUNYLE1BQU8sQ0FDUCxLQUFNLENBQ04sT0FBUSxDQUNSLFFBQVMsQ0FDVCxVQUFXLENBQ1gsV0FBWSxDQUNaLGVBQWdCLENBQ2hCLG1CQUFzQiIsImZpbGUiOiJkYW5tdWt1LnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWRhbm11a3Uge1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDMwO1xuICBsZWZ0OiAwO1xuICB0b3A6IDA7XG4gIHJpZ2h0OiAwO1xuICBib3R0b206IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHBvaW50ZXItZXZlbnRzOiBub25lOyB9XG4iXX0= */";
|
|
styleInject(css$3);
|
|
|
|
var css$4 = ".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxheWVycy5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhCQUNFLFlBQWEsQ0FDYixpQkFBa0IsQ0FDbEIsVUFBVyxDQUNYLE1BQU8sQ0FDUCxLQUFNLENBQ04sT0FBUSxDQUNSLFFBQVMsQ0FDVCxVQUFXLENBQ1gsV0FBWSxDQUNaLGVBQWdCLENBQ2hCLG1CQUFzQixDQUN0Qix5Q0FDRSxtQkFBc0IsQ0FFMUIsNkNBQ0UsYUFBZ0IiLCJmaWxlIjoibGF5ZXJzLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWxheWVycyB7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgei1pbmRleDogNDA7XG4gIGxlZnQ6IDA7XG4gIHRvcDogMDtcbiAgcmlnaHQ6IDA7XG4gIGJvdHRvbTogMDtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogMTAwJTtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1sYXllcnMgLmFydC1sYXllciB7XG4gICAgcG9pbnRlci1ldmVudHM6IGF1dG87IH1cblxuLmFydC12aWRlby1wbGF5ZXIuYXJ0LWxheWVyLXNob3cgLmFydC1sYXllcnMge1xuICBkaXNwbGF5OiBibG9jazsgfVxuIl19 */";
|
|
styleInject(css$4);
|
|
|
|
var css$5 = ".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.art-video-player .art-mask .art-state{right:30px;bottom:55px;width:60px;height:60px;opacity:.6}.art-video-player.art-mask-show .art-mask,.art-video-player .art-mask .art-state{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hc2suc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0QkFDRSxZQUFhLENBSWIsVUFBVyxDQUNYLE1BQU8sQ0FDUCxLQUFNLENBQ04sT0FBUSxDQUNSLFFBQVMsQ0FDVCxVQUFXLENBQ1gsV0FBWSxDQUNaLGVBQWdCLENBQ2hCLG1CQUFzQixDQUN0QixtRUFaQSx3QkFBbUIsQ0FBbkIscUJBQW1CLENBQW5CLGtCQUFtQixDQUNuQix1QkFBdUIsQ0FBdkIsb0JBQXVCLENBQXZCLHNCQUF1QixDQUN2QixpQkFtQmdCLENBVGhCLHVDQUtFLFVBQVcsQ0FDWCxXQUFZLENBQ1osVUFBVyxDQUNYLFdBQVksQ0FDWixVQUFjLENBRWxCLGlGQVZJLG1CQUFhLENBQWIsbUJBQWEsQ0FBYixZQVdhIiwiZmlsZSI6Im1hc2suc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW8tcGxheWVyIC5hcnQtbWFzayB7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDUwO1xuICBsZWZ0OiAwO1xuICB0b3A6IDA7XG4gIHJpZ2h0OiAwO1xuICBib3R0b206IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHBvaW50ZXItZXZlbnRzOiBub25lOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtbWFzayAuYXJ0LXN0YXRlIHtcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHJpZ2h0OiAzMHB4O1xuICAgIGJvdHRvbTogNTVweDtcbiAgICB3aWR0aDogNjBweDtcbiAgICBoZWlnaHQ6IDYwcHg7XG4gICAgb3BhY2l0eTogMC42OyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1tYXNrLXNob3cgLmFydC1tYXNrIHtcbiAgZGlzcGxheTogZmxleDsgfVxuIl19 */";
|
|
styleInject(css$5);
|
|
|
|
var css$6 = ".art-video-player .art-loading{display:none;position:absolute;z-index:70;left:0;top:0;right:0;bottom:0;width:100%;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;pointer-events:none}.art-video-player.art-loading-show .art-loading{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxvYWRpbmcuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwrQkFDRSxZQUFhLENBQ2IsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxNQUFPLENBQ1AsS0FBTSxDQUNOLE9BQVEsQ0FDUixRQUFTLENBQ1QsVUFBVyxDQUNYLFdBQVksQ0FDWix3QkFBbUIsQ0FBbkIscUJBQW1CLENBQW5CLGtCQUFtQixDQUNuQix1QkFBdUIsQ0FBdkIsb0JBQXVCLENBQXZCLHNCQUF1QixDQUN2QixtQkFBc0IsQ0FFeEIsZ0RBQ0UsbUJBQWEsQ0FBYixtQkFBYSxDQUFiLFlBQWUiLCJmaWxlIjoibG9hZGluZy5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIgLmFydC1sb2FkaW5nIHtcbiAgZGlzcGxheTogbm9uZTtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiA3MDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICByaWdodDogMDtcbiAgYm90dG9tOiAwO1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7IH1cblxuLmFydC12aWRlby1wbGF5ZXIuYXJ0LWxvYWRpbmctc2hvdyAuYXJ0LWxvYWRpbmcge1xuICBkaXNwbGF5OiBmbGV4OyB9XG4iXX0= */";
|
|
styleInject(css$6);
|
|
|
|
var css$7 = ".art-video-player .art-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:55px 10px 0;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.art-video-player .art-bottom .art-progress{position:relative;pointer-events:auto}.art-video-player .art-bottom .art-progress .art-control-progress{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:4px;cursor:pointer}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner{position:relative;height:50%;width:100%;background:hsla(0,0%,100%,.2)}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:100%;pointer-events:none}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:100%;background:#fff;pointer-events:auto}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.art-show-indicator{display:block}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner{height:100%}.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner .art-progress-indicator,.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner .art-progress-tip{display:block}.art-video-player .art-bottom .art-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.art-video-player .art-bottom .art-controls{position:relative;pointer-events:auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:40px;padding:5px 0}.art-video-player .art-bottom .art-controls,.art-video-player .art-bottom .art-controls .art-controls-left,.art-video-player .art-bottom .art-controls .art-controls-right{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-bottom .art-controls .art-control{opacity:.9;font-size:12px;height:36px;min-width:36px;line-height:36px;text-align:center;cursor:pointer}.art-video-player .art-bottom .art-controls .art-control .art-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;float:left;height:36px;width:36px}.art-video-player .art-bottom .art-controls .art-control:hover{opacity:1}.art-video-player .art-bottom .art-controls .art-control-onlyText{padding:0 10px}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;-webkit-transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:\"\";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.art-video-player .art-bottom .art-controls .art-control-volume:hover .art-volume-panel{width:60px}.art-video-player .art-bottom .art-controls .art-control-quality{position:relative;z-index:30}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys{display:none;position:absolute;bottom:35px;width:100px;padding:5px 0;text-align:center;color:#fff;background:rgba(0,0,0,.8);border-radius:3px}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys .art-quality-item{height:30px;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5)}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys .art-quality-item:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-bottom .art-controls .art-control-quality:hover .art-qualitys{display:block}.art-video-player.art-control-show .art-bottom,.art-video-player.art-hover .art-bottom{opacity:1;visibility:visible}.art-video-player.art-destroy .art-progress-indicator,.art-video-player.art-destroy .art-progress-tip,.art-video-player.art-error .art-progress-indicator,.art-video-player.art-error .art-progress-tip{display:none!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJvdHRvbS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhCQUNFLGlCQUFrQixDQUNsQixVQUFXLENBQ1gsTUFBTyxDQUNQLE9BQVEsQ0FDUixRQUFTLENBQ1QsWUFBYSxDQUNiLG1CQUFvQixDQUNwQixTQUFVLENBQ1YsaUJBQWtCLENBQ2xCLHNDQUFnQyxDQUFoQy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WluZGV4OiA0MDtcbiAgICAgICAgICB0b3A6IC01cHg7XG4gICAgICAgICAgbGVmdDogLTYuNXB4O1xuICAgICAgICAgIHdpZHRoOiAxM3B4O1xuICAgICAgICAgIGhlaWdodDogMTNweDtcbiAgICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7IH1cbiAgICAgICAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWJvdHRvbSAuYXJ0LXByb2dyZXNzIC5hcnQtY29udHJvbC1wcm9ncmVzcyAuYXJ0LWNvbnRyb2wtcHJvZ3Jlc3MtaW5uZXIgLmFydC1wcm9ncmVzcy1pbmRpY2F0b3IuYXJ0LXNob3ctaW5kaWNhdG9yIHtcbiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOyB9XG4gICAgICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtYm90dG9tIC5hcnQtcHJvZ3Jlc3MgLmFydC1jb250cm9sLXByb2dyZXNzIC5hcnQtY29udHJvbC1wcm9ncmVzcy1pbm5lciAuYXJ0LXByb2dyZXNzLXRpcCB7XG4gICAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgICAgei1pbmRleDogNTA7XG4gICAgICAgICAgdG9wOiAtMjVweDtcbiAgICAgICAgICBsZWZ0OiAwO1xuICAgICAgICAgIGhlaWdodDogMjBweDtcbiAgICAgICAgICBwYWRkaW5nOiAwIDVweDtcbiAgICAgICAgICBsaW5lLWhlaWdodDogMjBweDtcbiAgICAgICAgICBjb2xvcjogI2ZmZjtcbiAgICAgICAgICBmb250LXNpemU6IDEycHg7XG4gICAgICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgICAgIGJhY2tncm91bmQ6IHJnYmEoMCwgMCwgMCwgMC43KTtcbiAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7XG4gICAgICAgICAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gICAgICAgIC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ZW1zOiBjZW50ZXI7XG4gICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgIGhlaWdodDogNDBweDtcbiAgICBwYWRkaW5nOiA1cHggMDsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtYm90dG9tIC5hcnQtY29udHJvbHMgLmFydC1jb250cm9scy1sZWZ0LFxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtYm90dG9tIC5hcnQtY29udHJvbHMgLmFydC1jb250cm9scy1yaWdodCB7XG4gICAgICBkaXNwbGF5OiBmbGV4OyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1ib3R0b20gLmFydC1jb250cm9scyAuYXJ0LWNvbnRyb2wge1xuICAgICAgb3BhY2l0eTogMC45O1xuICAgICAgZm9udC1zaXplOiAxMnB4O1xuICAgICAgaGVpZ2h0OiAzNnB4O1xuICAgICAgbWluLXdpZHRoOiAzNnB4O1xuICAgICAgbGluZS1oZWlnaHQ6IDM2cHg7XG4gICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgICBjdXJzb3I6IHBvaW50ZXI7IH1cbiAgICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtYm90dG9tIC5hcnQtY29udHJvbHMgLmFydC1jb250cm9sIC5hcnQtaWNvbiB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgICBmbG9hdDogbGVmdDtcbiAgICAgICAgaGVpZ2h0OiAzNnB4O1xuICAgICAgICB3aWR0aDogMzZweDsgfVxuICAgICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1ib3R0b20gLmFydC1jb250cm9scyAuYXJ0LWNvbnRyb2w6aG92ZXIge1xuICAgICAgICBvcGFjaXR5OiAxOyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1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ZXIge1xuICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpOyB9XG4gICAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWJvdHRvbSAuYXJ0LWNvbnRyb2xzIC5hcnQtY29udHJvbC1xdWFsaXR5OmhvdmVyIC5hcnQtcXVhbGl0eXMge1xuICAgICAgICBkaXNwbGF5OiBibG9jazsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtY29udHJvbC1zaG93IC5hcnQtYm90dG9tLCAuYXJ0LXZpZGVvLXBsYXllci5hcnQtaG92ZXIgLmFydC1ib3R0b20ge1xuICBvcGFjaXR5OiAxO1xuICB2aXNpYmlsaXR5OiB2aXNpYmxlOyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1lcnJvciAuYXJ0LXByb2dyZXNzLWluZGljYXRvcixcbi5hcnQtdmlkZW8tcGxheWVyLmFydC1lcnJvciAuYXJ0LXByb2dyZXNzLXRpcCwgLmFydC12aWRlby1wbGF5ZXIuYXJ0LWRlc3Ryb3kgLmFydC1wcm9ncmVzcy1pbmRpY2F0b3IsXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtZGVzdHJveSAuYXJ0LXByb2dyZXNzLXRpcCB7XG4gIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDsgfVxuIl19 */";
|
|
styleInject(css$7);
|
|
|
|
var css$8 = ".art-video-player .art-notice{display:none;font-size:14px;position:absolute;z-index:80;left:0;top:0;padding:10px;width:100%;pointer-events:none}.art-video-player .art-notice .art-notice-inner{display:inline-block;padding:5px 10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px}.art-video-player.art-notice-show .art-notice{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vdGljZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhCQUNFLFlBQWEsQ0FDYixjQUFlLENBQ2YsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxNQUFPLENBQ1AsS0FBTSxDQUNOLFlBQWEsQ0FDYixVQUFXLENBQ1gsbUJBQXNCLENBQ3RCLGdEQUNFLG9CQUFxQixDQUNyQixnQkFBaUIsQ0FDakIsVUFBVyxDQUNYLHlCQUE4QixDQUM5QixpQkFBb0IsQ0FFeEIsOENBQ0UsbUJBQWEsQ0FBYixtQkFBYSxDQUFiLFlBQWUiLCJmaWxlIjoibm90aWNlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LW5vdGljZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIGZvbnQtc2l6ZTogMTRweDtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiA4MDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICBwYWRkaW5nOiAxMHB4O1xuICB3aWR0aDogMTAwJTtcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1ub3RpY2UgLmFydC1ub3RpY2UtaW5uZXIge1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICBwYWRkaW5nOiA1cHggMTBweDtcbiAgICBjb2xvcjogI2ZmZjtcbiAgICBiYWNrZ3JvdW5kOiByZ2JhKDAsIDAsIDAsIDAuNik7XG4gICAgYm9yZGVyLXJhZGl1czogM3B4OyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1ub3RpY2Utc2hvdyAuYXJ0LW5vdGljZSB7XG4gIGRpc3BsYXk6IGZsZXg7IH1cbiJdfQ== */";
|
|
styleInject(css$8);
|
|
|
|
var css$9 = ".art-video-player .art-contextmenus{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:120;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.9);border-radius:3px}.art-video-player .art-contextmenus .art-contextmenu{cursor:pointer;font-size:13px;display:block;color:#fff;padding:7px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu a{color:#fff;text-decoration:none}.art-video-player .art-contextmenus .art-contextmenu span{display:inline-block;padding:0 7px}.art-video-player .art-contextmenus .art-contextmenu span.art-current,.art-video-player .art-contextmenus .art-contextmenu span:hover{color:#00c9ff}.art-video-player .art-contextmenus .art-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu:last-child{border-bottom:none}.art-video-player.art-contextmenu-show .art-contextmenus{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRleHRtZW51LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0NBQ0UsWUFBYSxDQUNiLDJCQUFzQixDQUF0Qiw0QkFBc0IsQ0FBdEIseUJBQXNCLENBQXRCLHFCQUFzQixDQUN0QixpQkFBa0IsQ0FDbEIsV0FBWSxDQUNaLE1BQU8sQ0FDUCxLQUFNLENBQ04sZUFBZ0IsQ0FDaEIsYUFBYyxDQUNkLHlCQUE4QixDQUM5QixpQkFBb0IsQ0FDcEIscURBQ0UsY0FBZSxDQUNmLGNBQWUsQ0FDZixhQUFjLENBQ2QsVUFBVyxDQUNYLGdCQUFpQixDQUNqQixlQUFnQixDQUNoQixzQkFBdUIsQ0FDdkIsa0JBQW1CLENBQ25CLGtDQUF1QyxDQUN2QywwQ0FBbUQsQ0FDbkQsdURBQ0UsVUFBVyxDQUNYLG9CQUF1QixDQUN6QiwwREFDRSxvQkFBcUIsQ0FDckIsYUFBZ0IsQ0FDaEIsc0lBQ0UsYUFBZ0Is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U7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51IHNwYW4ge1xuICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgICAgcGFkZGluZzogMCA3cHg7IH1cbiAgICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtY29udGV4dG1lbnVzIC5hcnQtY29udGV4dG1lbnUgc3Bhbjpob3ZlciwgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSBzcGFuLmFydC1jdXJyZW50IHtcbiAgICAgICAgY29sb3I6ICMwMGM5ZmY7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51OmhvdmVyIHtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4xKTsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtY29udGV4dG1lbnVzIC5hcnQtY29udGV4dG1lbnU6bGFzdC1jaGlsZCB7XG4gICAgICBib3JkZXItYm90dG9tOiBub25lOyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1jb250ZXh0bWVudS1zaG93IC5hcnQtY29udGV4dG1lbnVzIHtcbiAgZGlzcGxheTogZmxleDsgfVxuIl19 */";
|
|
styleInject(css$9);
|
|
|
|
var css$a = ".art-video-player .art-settings{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;z-index:90;left:0;top:0;height:100%;width:100%;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden}.art-video-player .art-settings .art-setting-inner{position:absolute;top:0;right:-300px;bottom:0;width:300px;height:100%;font-size:12px;background:rgba(0,0,0,.9);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;overflow:auto}.art-video-player .art-settings .art-setting-inner .art-setting-body{overflow-y:auto;width:100%;height:100%}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting{border-bottom:1px solid hsla(0,0%,100%,.1);padding:10px 15px}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting .art-setting-header{margin-bottom:5px}.art-video-player .art-settings .art-setting-radio{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-radio .art-radio-item{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 2px}.art-video-player .art-settings .art-setting-radio .art-radio-item button{height:22px;width:100%;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px}.art-video-player .art-settings .art-setting-radio .art-radio-item.current button{background-color:#00a1d6}.art-video-player .art-settings .art-setting-range input{width:100%;height:3px;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:hsla(0,0%,100%,.5)}.art-video-player .art-settings .art-setting-checkbox input{height:14px;width:14px;margin-right:5px}.art-video-player .art-settings .art-setting-upload{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-upload .art-upload-btn{width:80px;height:22px;line-height:22px;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px;text-align:center}.art-video-player .art-settings .art-setting-upload .art-upload-value{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:22px;line-height:22px;padding-left:10px}.art-video-player.art-setting-show .art-settings{opacity:1;visibility:visible;pointer-events:auto}.art-video-player.art-setting-show .art-settings .art-setting-inner{right:0}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNldHRpbmcuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQ0FDRSxtQkFBYSxDQUFiLG1CQUFhLENBQWIsWUFBYSxDQUNiLHdCQUFtQixDQUFuQixxQkFBbUIsQ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ZS1oZWlnaHQ6IDIycHg7XG4gICAgICBib3JkZXI6IG5vbmU7XG4gICAgICBvdXRsaW5lOiBub25lO1xuICAgICAgY29sb3I6ICNmZmY7XG4gICAgICBiYWNrZ3JvdW5kOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMik7XG4gICAgICBib3JkZXItcmFkaXVzOiAycHg7XG4gICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LXNldHRpbmdzIC5hcnQtc2V0dGluZy11cGxvYWQgLmFydC11cGxvYWQtdmFsdWUge1xuICAgICAgZmxleDogMTtcbiAgICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbiAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgICBoZWlnaHQ6IDIycHg7XG4gICAgICBsaW5lLWhlaWdodDogMjJweDtcbiAgICAgIHBhZGRpbmctbGVmdDogMTBweDsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtc2V0dGluZy1zaG93IC5hcnQtc2V0dGluZ3Mge1xuICBvcGFjaXR5OiAxO1xuICB2aXNpYmlsaXR5OiB2aXNpYmxlO1xuICBwb2ludGVyLWV2ZW50czogYXV0bzsgfVxuICAuYXJ0LXZpZGVvLXBsYXllci5hcnQtc2V0dGluZy1zaG93IC5hcnQtc2V0dGluZ3MgLmFydC1zZXR0aW5nLWlubmVyIHtcbiAgICByaWdodDogMDsgfVxuIl19 */";
|
|
styleInject(css$a);
|
|
|
|
var css$b = ".art-video-player .art-info{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;left:10px;top:10px;z-index:100;width:350px;min-height:150px;padding:10px;color:#fff;font-size:12px;font-family:Noto Sans CJK SC DemiLight,Roboto,Segoe UI,Tahoma,Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased;background:rgba(0,0,0,.9)}.art-video-player .art-info .art-info-item{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px}.art-video-player .art-info .art-info-item .art-info-title{width:100px;text-align:right}.art-video-player .art-info .art-info-item .art-info-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:5px}.art-video-player .art-info .art-info-close{position:absolute;top:5px;right:5px;cursor:pointer}.art-video-player.art-info-show .art-info{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZm8uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0QkFDRSxZQUFhLENBQ2IsMkJBQXNCLENBQXRCLDRCQUFzQixDQUF0Qix5QkFBc0IsQ0FBdEIscUJBQXNCLENBQ3RCLGlCQUFrQixDQUNsQixTQUFVLENBQ1YsUUFBUyxDQUNULFdBQVksQ0FDWixXQUFZLENBQ1osZ0JBQWlCLENBQ2pCLFlBQWEsQ0FDYixVQUFXLENBQ1gsY0FBZSxDQUNmLHdGQUErRixDQUMvRixrQ0FBbUMsQ0FDbkMseUJBQWdDLENBQ2hDLDJDQUNFLG1CQUFhLENBQWIsbUJBQWEsQ0FBYixZQUFhLENBQ2IsaUJBQW9CLENBQ3BCLDJEQUNFLFdBQVksQ0FDWixnQkFBbUIsQ0FDckIsNkRBQ0Usa0JBQU8sQ0FBUCxVQUFPLENBQVAsTUFBTyxDQUNQLGVBQWdCLENBQ2hCLHNCQUF1QixDQUN2QixrQkFBbUIsQ0FDbkIsZ0JBQW1CLENBQ3ZCLDRDQUNFLGlCQUFrQixDQUNsQixPQUFRLENBQ1IsU0FBVSxDQUNWLGNBQWlCLENBRXJCLDBDQUNFLG1CQUFhLENBQWIsbUJBQWEsQ0FBYixZQUFlIiwiZmlsZSI6ImluZm8uc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW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cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1pbmZvIC5hcnQtaW5mby1jbG9zZSB7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogNXB4O1xuICAgIHJpZ2h0OiA1cHg7XG4gICAgY3Vyc29yOiBwb2ludGVyOyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1pbmZvLXNob3cgLmFydC1pbmZvIHtcbiAgZGlzcGxheTogZmxleDsgfVxuIl19 */";
|
|
styleInject(css$b);
|
|
|
|
var css$c = ".art-video-player.art-hide-cursor *{cursor:none!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhpZGVDdXJzb3Iuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxvQ0FDRSxxQkFBeUIiLCJmaWxlIjoiaGlkZUN1cnNvci5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIuYXJ0LWhpZGUtY3Vyc29yICoge1xuICBjdXJzb3I6IG5vbmUgIWltcG9ydGFudDsgfVxuIl19 */";
|
|
styleInject(css$c);
|
|
|
|
var css$d = ".art-video-player[data-aspect-ratio] video{-webkit-box-sizing:content-box;box-sizing:content-box;-o-object-fit:fill;object-fit:fill}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzcGVjdFJhdGlvLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMkNBQ0UsOEJBQXVCLENBQXZCLHNCQUF1QixDQUN2QixrQkFBZ0IsQ0FBaEIsZUFBa0IiLCJmaWxlIjoiYXNwZWN0UmF0aW8uc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW8tcGxheWVyW2RhdGEtYXNwZWN0LXJhdGlvXSB2aWRlbyB7XG4gIGJveC1zaXppbmc6IGNvbnRlbnQtYm94O1xuICBvYmplY3QtZml0OiBmaWxsOyB9XG4iXX0= */";
|
|
styleInject(css$d);
|
|
|
|
var css$e = ".art-video-player.art-web-fullscreen{position:fixed;z-index:9999;width:100%;height:100%;left:0;top:0;right:0;bottom:0}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZ1bGxzY3JlZW5XZWIuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxxQ0FDRSxjQUFlLENBQ2YsWUFBYSxDQUNiLFVBQVcsQ0FDWCxXQUFZLENBQ1osTUFBTyxDQUNQLEtBQU0sQ0FDTixPQUFRLENBQ1IsUUFBVyIsImZpbGUiOiJmdWxsc2NyZWVuV2ViLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllci5hcnQtd2ViLWZ1bGxzY3JlZW4ge1xuICBwb3NpdGlvbjogZml4ZWQ7XG4gIHotaW5kZXg6IDk5OTk7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGxlZnQ6IDA7XG4gIHRvcDogMDtcbiAgcmlnaHQ6IDA7XG4gIGJvdHRvbTogMDsgfVxuIl19 */";
|
|
styleInject(css$e);
|
|
|
|
var css$f = ".art-video-player .art-pip-header{display:none;position:absolute;z-index:110;left:0;top:0;right:0;height:35px;line-height:35px;color:#fff;background:rgba(0,0,0,.5);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.art-video-player .art-pip-header .art-pip-title{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:move}.art-video-player .art-pip-header .art-pip-close{width:35px;text-align:center;font-size:22px;cursor:pointer}.art-video-player.art-is-dragging{opacity:.7}.art-video-player.art-pip{position:fixed;z-index:9999;width:400px;height:225px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2);box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2)}.art-video-player.art-pip .art-pip-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.art-video-player.art-pip.art-hover .art-pip-header{opacity:1;visibility:visible}.art-video-player.art-pip .art-mask .art-state{position:static}.art-video-player.art-pip .art-bottom,.art-video-player.art-pip .art-contextmenu,.art-video-player.art-pip .art-danmu,.art-video-player.art-pip .art-info,.art-video-player.art-pip .art-layers,.art-video-player.art-pip .art-notice,.art-video-player.art-pip .art-setting,.art-video-player.art-pip .art-subtitle{display:none!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBpcC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtDQUNFLFlBQWEsQ0FDYixpQkFBa0IsQ0FDbEIsV0FBWSxDQUNaLE1BQU8sQ0FDUCxLQUFNLENBQ04sT0FBUSxDQUNSLFdBQVksQ0FDWixnQkFBaUIsQ0FDakIsVUFBVyxDQUNYLHlCQUE4QixDQUM5Qix3QkFBbUIsQ0FBbkIscUJBQW1CLENBQW5CLGtCQUFtQixDQUNuQix3QkFBOEIsQ0FBOUIscUJBQThCLENBQTlCLDZCQUE4QixDQUM5QixTQUFVLENBQ1YsaUJBQWtCLENBQ2xCLHNDQUFnQyxDQUFoQyw4QkFBa0MsQ0FDbEMsaURBQ0Usa0JBQU8sQ0FBUCxVQUFPLENBQVAsTUFBTyxDQUNQLGNBQWUsQ0FDZixlQUFnQixDQUNoQixzQkFBdUIsQ0FDdkIsa0JBQW1CLENBQ25CLFdBQWMsQ0FDaEIsaURBQ0UsVUFBVyxDQUNYLGlCQUFrQixDQUNsQixjQUFlLENBQ2YsY0FBaUIsQ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cGlwIC5hcnQtZGFubXUsXG4gIC5hcnQtdmlkZW8tcGxheWVyLmFydC1waXAgLmFydC1pbmZvLFxuICAuYXJ0LXZpZGVvLXBsYXllci5hcnQtcGlwIC5hcnQtbGF5ZXJzLFxuICAuYXJ0LXZpZGVvLXBsYXllci5hcnQtcGlwIC5hcnQtbm90aWNlLFxuICAuYXJ0LXZpZGVvLXBsYXllci5hcnQtcGlwIC5hcnQtc2V0dGluZyxcbiAgLmFydC12aWRlby1wbGF5ZXIuYXJ0LXBpcCAuYXJ0LXN1YnRpdGxlIHtcbiAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7IH1cbiJdfQ== */";
|
|
styleInject(css$f);
|
|
|
|
var css$g = ".art-auto-size{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF1dG9TaXplLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFDRSxtQkFBYSxDQUFiLG1CQUFhLENBQWIsWUFBYSxDQUNiLHdCQUFtQixDQUFuQixxQkFBbUIsQ0FBbkIsa0JBQW1CLENBQ25CLHVCQUF1QixDQUF2QixvQkFBdUIsQ0FBdkIsc0JBQXlCIiwiZmlsZSI6ImF1dG9TaXplLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LWF1dG8tc2l6ZSB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyOyB9XG4iXX0= */";
|
|
styleInject(css$g);
|
|
|
|
var css$h = ".art-video-player[data-flip=horizontal] .art-video{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.art-video-player[data-flip=vertical] .art-video{-webkit-transform:scaleY(-1);transform:scaleY(-1)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZsaXAuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtREFDRSw0QkFBcUIsQ0FBckIsb0JBQXVCLENBRXpCLGlEQUNFLDRCQUFxQixDQUFyQixvQkFBdUIiLCJmaWxlIjoiZmxpcC5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXJbZGF0YS1mbGlwPVwiaG9yaXpvbnRhbFwiXSAuYXJ0LXZpZGVvIHtcbiAgdHJhbnNmb3JtOiBzY2FsZVgoLTEpOyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyW2RhdGEtZmxpcD1cInZlcnRpY2FsXCJdIC5hcnQtdmlkZW8ge1xuICB0cmFuc2Zvcm06IHNjYWxlWSgtMSk7IH1cbiJdfQ== */";
|
|
styleInject(css$h);
|
|
|
|
var css$i = ":root{--balloon-color:rgba(16,16,16,0.95);--balloon-font-size:12px;--balloon-move:4px}button[aria-label][data-balloon-pos]{overflow:visible}[aria-label][data-balloon-pos]{position:relative;cursor:pointer}[aria-label][data-balloon-pos]:after{text-indent:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-weight:400;font-style:normal;text-shadow:none;font-size:var(--balloon-font-size);background:var(--balloon-color);border-radius:2px;color:#fff;content:attr(aria-label);padding:.5em 1em;white-space:nowrap;line-height:1.2}[aria-label][data-balloon-pos]:after,[aria-label][data-balloon-pos]:before{opacity:0;pointer-events:none;-webkit-transition:all .18s ease-out .18s;transition:all .18s ease-out .18s;position:absolute;z-index:10}[aria-label][data-balloon-pos]:before{width:0;height:0;border:5px solid transparent;border-top:5px solid var(--balloon-color);content:\"\"}[aria-label][data-balloon-pos]:hover:after,[aria-label][data-balloon-pos]:hover:before{opacity:1;pointer-events:none}[aria-label][data-balloon-pos][data-balloon-pos=up]:after{margin-bottom:10px}[aria-label][data-balloon-pos][data-balloon-pos=up]:after,[aria-label][data-balloon-pos][data-balloon-pos=up]:before{bottom:100%;left:50%;-webkit-transform:translate(-50%,var(--balloon-move));transform:translate(-50%,var(--balloon-move));-webkit-transform-origin:top;transform-origin:top}[aria-label][data-balloon-pos][data-balloon-pos=up]:hover:after,[aria-label][data-balloon-pos][data-balloon-pos=up]:hover:before{-webkit-transform:translate(-50%);transform:translate(-50%)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhbGxvb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUNFLG1DQUF1QyxDQUN2Qyx3QkFBeUIsQ0FDekIsa0JBQXFCLENBRXZCLHFDQUNFLGdCQUFtQixDQUVyQiwrQkFDRSxpQkFBa0IsQ0FDbEIsY0FBaUIsQ0FDakIscUNBSUUsYUFBYyxDQUNkLHdIQUF3SSxDQUN4SSxlQUFtQixDQUNuQixpQkFBa0IsQ0FDbEIsZ0JBQWlCLENBQ2pCLGtDQUFtQyxDQUNuQywrQkFBZ0MsQ0FDaEMsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCx3QkFBeUIsQ0FDekIsZ0JBQWtCLENBRWxCLGtCQUFtQixDQUNuQixlQUNhLENBQ2YsMkVBbEJFLFNBQVUsQ0FDVixtQkFBb0IsQ0FDcEIseUNBQW9DLENBQXBDLGlDQUFvQyxDQVlwQyxpQkFBa0IsQ0FHbEIsVUFXYSxDQVZmLHNDQUNFLE9BQVEsQ0FDUixRQUFTLENBRVQsNEJBQXNDLENBQXRDLHlDQUFzQyxDQUl0QyxVQUVhLENBQ2YsdUZBQ0UsU0FBVSxDQUNWLG1CQUFzQixDQUN4QiwwREFHRSxrQkFFdUIsQ0FDekIscUhBTEUsV0FBWSxDQUNaLFFBQVMsQ0FFVCxxREFBK0MsQ0FBL0MsNkNBQStDLENBQy9DLDRCQUFxQixD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Zvcm0tb3JpZ2luOiB0b3A7IH1cbiAgW2FyaWEtbGFiZWxdW2RhdGEtYmFsbG9vbi1wb3NdW2RhdGEtYmFsbG9vbi1wb3M9J3VwJ106YmVmb3JlIHtcbiAgICBib3R0b206IDEwMCU7XG4gICAgbGVmdDogNTAlO1xuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIHZhcigtLWJhbGxvb24tbW92ZSkpO1xuICAgIHRyYW5zZm9ybS1vcmlnaW46IHRvcDsgfVxuICBbYXJpYS1sYWJlbF1bZGF0YS1iYWxsb29uLXBvc11bZGF0YS1iYWxsb29uLXBvcz0ndXAnXTpob3ZlcjphZnRlciB7XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUoLTUwJSwgMCk7IH1cbiAgW2FyaWEtbGFiZWxdW2RhdGEtYmFsbG9vbi1wb3NdW2RhdGEtYmFsbG9vbi1wb3M9J3VwJ106aG92ZXI6YmVmb3JlIHtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgtNTAlLCAwKTsgfVxuIl19 */";
|
|
styleInject(css$i);
|
|
|
|
var optionValidator = createCommonjsModule(function (module, exports) {
|
|
!function(r,t){module.exports=t();}(commonjsGlobal,function(){function e(r){return (e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var n=Object.prototype.toString,c=function(r){if(void 0===r)return "undefined";if(null===r)return "null";var t=e(r);if("boolean"===t)return "boolean";if("string"===t)return "string";if("number"===t)return "number";if("symbol"===t)return "symbol";if("function"===t)return function(r){return "GeneratorFunction"===o(r)}(r)?"generatorfunction":"function";if(function(r){return Array.isArray?Array.isArray(r):r instanceof Array}(r))return "array";if(function(r){if(r.constructor&&"function"==typeof r.constructor.isBuffer)return r.constructor.isBuffer(r);return !1}(r))return "buffer";if(function(r){try{if("number"==typeof r.length&&"function"==typeof r.callee)return !0}catch(r){if(-1!==r.message.indexOf("callee"))return !0}return !1}(r))return "arguments";if(function(r){return r instanceof Date||"function"==typeof r.toDateString&&"function"==typeof r.getDate&&"function"==typeof r.setDate}(r))return "date";if(function(r){return r instanceof Error||"string"==typeof r.message&&r.constructor&&"number"==typeof r.constructor.stackTraceLimit}(r))return "error";if(function(r){return r instanceof RegExp||"string"==typeof r.flags&&"boolean"==typeof r.ignoreCase&&"boolean"==typeof r.multiline&&"boolean"==typeof r.global}(r))return "regexp";switch(o(r)){case"Symbol":return "symbol";case"Promise":return "promise";case"WeakMap":return "weakmap";case"WeakSet":return "weakset";case"Map":return "map";case"Set":return "set";case"Int8Array":return "int8array";case"Uint8Array":return "uint8array";case"Uint8ClampedArray":return "uint8clampedarray";case"Int16Array":return "int16array";case"Uint16Array":return "uint16array";case"Int32Array":return "int32array";case"Uint32Array":return "uint32array";case"Float32Array":return "float32array";case"Float64Array":return "float64array"}if(function(r){return "function"==typeof r.throw&&"function"==typeof r.return&&"function"==typeof r.next}(r))return "generator";switch(t=n.call(r)){case"[object Object]":return "object";case"[object Map Iterator]":return "mapiterator";case"[object Set Iterator]":return "setiterator";case"[object String Iterator]":return "stringiterator";case"[object Array Iterator]":return "arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function o(r){return r.constructor?r.constructor.name:null}function f(r,t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return s(r,t,e),y(r,t,e),function(a,i,u){var r=c(i),t=c(a);if("object"===r){if("object"!==t)throw new Error("[Type Error]: '".concat(u.join("."),"' require 'object' type, but got '").concat(t,"'"));Object.keys(i).forEach(function(r){var t=a[r],e=i[r],n=u.slice();n.push(r),s(t,e,n),y(t,e,n),f(t,e,n);});}if("array"===r){if("array"!==t)throw new Error("[Type Error]: '".concat(u.join("."),"' require 'array' type, but got '").concat(t,"'"));a.forEach(function(r,t){var e=a[t],n=i[t]||i[0],o=u.slice();o.push(t),s(e,n,o),y(e,n,o),f(e,n,o);});}}(r,t,e),r}function s(r,t,e){if("string"===c(t)){var n=c(r);if(!(-1<t.indexOf("|")?t.split("|").map(function(r){return r.toLowerCase().trim()}).filter(Boolean).some(function(r){return n===r}):t.toLowerCase().trim()===n))throw new Error("[Type Error]: '".concat(e.join("."),"' require '").concat(t,"' type, but got '").concat(n,"'"))}}function y(r,t,e){if("function"===c(t)){var n=t(r,c(r),e);if(!0!==n){var o=c(n);throw "string"===o?new Error(n):"error"===o?n:new Error("[Validator Error]: The scheme for '".concat(e.join("."),"' validator require return true, but got '").concat(n,"'"))}}}return f.kindOf=c,f});
|
|
});
|
|
|
|
var Emitter =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Emitter() {
|
|
classCallCheck(this, Emitter);
|
|
}
|
|
|
|
createClass(Emitter, [{
|
|
key: "on",
|
|
value: function on(name, fn, ctx) {
|
|
var e = this.e || (this.e = {});
|
|
(e[name] || (e[name] = [])).push({
|
|
fn: fn,
|
|
ctx: ctx
|
|
});
|
|
return this;
|
|
}
|
|
}, {
|
|
key: "once",
|
|
value: function once(name, fn, ctx) {
|
|
var self = this;
|
|
|
|
function listener() {
|
|
self.off(name, listener);
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
fn.apply(ctx, args);
|
|
}
|
|
|
|
listener._ = fn;
|
|
return this.on(name, listener, ctx);
|
|
}
|
|
}, {
|
|
key: "emit",
|
|
value: function emit(name) {
|
|
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
|
|
for (var _len2 = arguments.length, data = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
data[_key2 - 1] = arguments[_key2];
|
|
}
|
|
|
|
for (var i = 0; i < evtArr.length; i += 1) {
|
|
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
}
|
|
|
|
return this;
|
|
}
|
|
}, {
|
|
key: "off",
|
|
value: function off(name, callback) {
|
|
var e = this.e || (this.e = {});
|
|
var evts = e[name];
|
|
var liveEvents = [];
|
|
|
|
if (evts && callback) {
|
|
for (var i = 0, len = evts.length; i < len; i += 1) {
|
|
if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]);
|
|
}
|
|
}
|
|
|
|
if (liveEvents.length) {
|
|
e[name] = liveEvents;
|
|
} else {
|
|
delete e[name];
|
|
}
|
|
|
|
return this;
|
|
}
|
|
}]);
|
|
|
|
return Emitter;
|
|
}();
|
|
|
|
function query(selector) {
|
|
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
return parent.querySelector(selector);
|
|
}
|
|
function queryAll(selector) {
|
|
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
return Array.from(parent.querySelectorAll(selector));
|
|
}
|
|
function addClass(target, className) {
|
|
return target.classList.add(className);
|
|
}
|
|
function removeClass(target, className) {
|
|
return target.classList.remove(className);
|
|
}
|
|
function hasClass(target, className) {
|
|
return target.classList.contains(className);
|
|
}
|
|
function append(parent, child) {
|
|
if (child instanceof Element) {
|
|
parent.appendChild(child);
|
|
} else {
|
|
parent.insertAdjacentHTML('beforeend', String(child));
|
|
}
|
|
|
|
return parent.lastElementChild || parent.lastChild;
|
|
}
|
|
function remove(child) {
|
|
return child.parentNode.removeChild(child);
|
|
}
|
|
function setStyle(element, key, value) {
|
|
element.style[key] = value;
|
|
return element;
|
|
}
|
|
function setStyles(element, styles) {
|
|
Object.keys(styles).forEach(function (key) {
|
|
setStyle(element, key, styles[key]);
|
|
});
|
|
return element;
|
|
}
|
|
function getStyle(element, key) {
|
|
var numberType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
var value = window.getComputedStyle(element, null).getPropertyValue(key);
|
|
return numberType ? parseFloat(value) : value;
|
|
}
|
|
function sublings(target) {
|
|
return Array.from(target.parentElement.children).filter(function (item) {
|
|
return item !== target;
|
|
});
|
|
}
|
|
function inverseClass(target, className) {
|
|
sublings(target).forEach(function (item) {
|
|
return removeClass(item, className);
|
|
});
|
|
addClass(target, className);
|
|
}
|
|
function tooltip(target, msg) {
|
|
var pos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'up';
|
|
target.setAttribute('aria-label', msg);
|
|
target.setAttribute('data-balloon-pos', pos);
|
|
}
|
|
|
|
function _isNativeFunction(fn) {
|
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
}
|
|
|
|
var isNativeFunction = _isNativeFunction;
|
|
|
|
var construct = createCommonjsModule(function (module) {
|
|
function isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
if (Reflect.construct.sham) return false;
|
|
if (typeof Proxy === "function") return true;
|
|
|
|
try {
|
|
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function _construct(Parent, args, Class) {
|
|
if (isNativeReflectConstruct()) {
|
|
module.exports = _construct = Reflect.construct;
|
|
} else {
|
|
module.exports = _construct = function _construct(Parent, args, Class) {
|
|
var a = [null];
|
|
a.push.apply(a, args);
|
|
var Constructor = Function.bind.apply(Parent, a);
|
|
var instance = new Constructor();
|
|
if (Class) setPrototypeOf(instance, Class.prototype);
|
|
return instance;
|
|
};
|
|
}
|
|
|
|
return _construct.apply(null, arguments);
|
|
}
|
|
|
|
module.exports = _construct;
|
|
});
|
|
|
|
var wrapNativeSuper = createCommonjsModule(function (module) {
|
|
function _wrapNativeSuper(Class) {
|
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
|
|
module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
if (Class === null || !isNativeFunction(Class)) return Class;
|
|
|
|
if (typeof Class !== "function") {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
|
|
if (typeof _cache !== "undefined") {
|
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
|
|
_cache.set(Class, Wrapper);
|
|
}
|
|
|
|
function Wrapper() {
|
|
return construct(Class, arguments, getPrototypeOf(this).constructor);
|
|
}
|
|
|
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
constructor: {
|
|
value: Wrapper,
|
|
enumerable: false,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
return setPrototypeOf(Wrapper, Class);
|
|
};
|
|
|
|
return _wrapNativeSuper(Class);
|
|
}
|
|
|
|
module.exports = _wrapNativeSuper;
|
|
});
|
|
|
|
var ArtPlayerError =
|
|
/*#__PURE__*/
|
|
function (_Error) {
|
|
inherits(ArtPlayerError, _Error);
|
|
|
|
function ArtPlayerError(message, context) {
|
|
var _this;
|
|
|
|
classCallCheck(this, ArtPlayerError);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(ArtPlayerError).call(this, message));
|
|
|
|
if (typeof Error.captureStackTrace === 'function') {
|
|
Error.captureStackTrace(assertThisInitialized(_this), context || _this.constructor);
|
|
}
|
|
|
|
_this.name = 'ArtPlayerError';
|
|
return _this;
|
|
}
|
|
|
|
return ArtPlayerError;
|
|
}(wrapNativeSuper(Error));
|
|
function errorHandle(condition, msg) {
|
|
if (!condition) {
|
|
throw new ArtPlayerError(msg);
|
|
}
|
|
|
|
return condition;
|
|
}
|
|
|
|
function srtToVtt(srtText) {
|
|
return 'WEBVTT \r\n\r\n'.concat(srtText.replace(/{[\s\S]*?}/g, '').replace(/\{\\([ibu])\}/g, '</$1>').replace(/\{\\([ibu])1\}/g, '<$1>').replace(/\{([ibu])\}/g, '<$1>').replace(/\{\/([ibu])\}/g, '</$1>').replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2').concat('\r\n\r\n'));
|
|
}
|
|
function vttToBlob(vttText) {
|
|
return URL.createObjectURL(new Blob([vttText], {
|
|
type: 'text/vtt'
|
|
}));
|
|
}
|
|
function assToVtt(ass) {
|
|
var reAss = new RegExp('Dialogue:\\s\\d,' + '(\\d+:\\d\\d:\\d\\d.\\d\\d),' + '(\\d+:\\d\\d:\\d\\d.\\d\\d),' + '([^,]*),' + '([^,]*),' + '(?:[^,]*,){4}' + '([\\s\\S]*)$', 'i');
|
|
|
|
function fixTime() {
|
|
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
return time.split(/[:.]/).map(function (item, index, arr) {
|
|
if (index === arr.length - 1) {
|
|
if (item.length === 1) {
|
|
return ".".concat(item, "00");
|
|
}
|
|
|
|
if (item.length === 2) {
|
|
return ".".concat(item, "0");
|
|
}
|
|
} else if (item.length === 1) {
|
|
return (index === 0 ? '0' : ':0') + item;
|
|
} // eslint-disable-next-line no-nested-ternary
|
|
|
|
|
|
return index === 0 ? item : index === arr.length - 1 ? ".".concat(item) : ":".concat(item);
|
|
}).join('');
|
|
}
|
|
|
|
return "WEBVTT\n\n".concat(ass.split(/\r?\n/).map(function (line) {
|
|
var m = line.match(reAss);
|
|
if (!m) return null;
|
|
return {
|
|
start: fixTime(m[1].trim()),
|
|
end: fixTime(m[2].trim()),
|
|
text: m[5].replace(/{[\s\S]*?}/g, '').replace(/(\\N)/g, '\n').trim().split(/\r?\n/).map(function (item) {
|
|
return item.trim();
|
|
}).join('\n')
|
|
};
|
|
}).filter(function (line) {
|
|
return line;
|
|
}).map(function (line, index) {
|
|
if (line) {
|
|
return "".concat(index + 1, "\n").concat(line.start, " --> ").concat(line.end, "\n").concat(line.text);
|
|
}
|
|
|
|
return '';
|
|
}).filter(function (line) {
|
|
return line.trim();
|
|
}).join('\n\n'));
|
|
}
|
|
|
|
function getExt(url) {
|
|
if (url.includes('?')) {
|
|
return getExt(url.split('?')[0]);
|
|
}
|
|
|
|
if (url.includes('#')) {
|
|
return getExt(url.split('#')[0]);
|
|
}
|
|
|
|
return url.trim().toLowerCase().split('.').pop();
|
|
}
|
|
function downloadFile(url, name) {
|
|
var elink = document.createElement('a');
|
|
elink.style.display = 'none';
|
|
elink.href = url;
|
|
elink.download = name;
|
|
document.body.appendChild(elink);
|
|
elink.click();
|
|
document.body.removeChild(elink);
|
|
}
|
|
|
|
function _arrayWithoutHoles(arr) {
|
|
if (Array.isArray(arr)) {
|
|
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
|
arr2[i] = arr[i];
|
|
}
|
|
|
|
return arr2;
|
|
}
|
|
}
|
|
|
|
var arrayWithoutHoles = _arrayWithoutHoles;
|
|
|
|
function _iterableToArray(iter) {
|
|
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
}
|
|
|
|
var iterableToArray = _iterableToArray;
|
|
|
|
function _nonIterableSpread() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
}
|
|
|
|
var nonIterableSpread = _nonIterableSpread;
|
|
|
|
function _toConsumableArray(arr) {
|
|
return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
|
|
}
|
|
|
|
var toConsumableArray = _toConsumableArray;
|
|
|
|
var def = Object.defineProperty;
|
|
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
function has$1(obj, name) {
|
|
return hasOwnProperty$1.call(obj, name);
|
|
}
|
|
function proxyPropertys(target) {
|
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
sources[_key - 1] = arguments[_key];
|
|
}
|
|
|
|
return sources.reduce(function (result, source) {
|
|
Object.getOwnPropertyNames(source).forEach(function (key) {
|
|
errorHandle(!has$1(result, key), "Target attribute name is duplicated: ".concat(key));
|
|
def(result, key, Object.getOwnPropertyDescriptor(source, key));
|
|
});
|
|
return result;
|
|
}, target);
|
|
}
|
|
function mergeDeep() {
|
|
var isObject = function isObject(item) {
|
|
return item && _typeof_1(item) === 'object' && !Array.isArray(item);
|
|
};
|
|
|
|
for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
objects[_key2] = arguments[_key2];
|
|
}
|
|
|
|
return objects.reduce(function (prev, obj) {
|
|
Object.keys(obj).forEach(function (key) {
|
|
var pVal = prev[key];
|
|
var oVal = obj[key];
|
|
|
|
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
prev[key] = pVal.concat.apply(pVal, toConsumableArray(oVal));
|
|
} else if (isObject(pVal) && isObject(oVal) && !(oVal instanceof Element)) {
|
|
prev[key] = mergeDeep(pVal, oVal);
|
|
} else {
|
|
prev[key] = oVal;
|
|
}
|
|
});
|
|
return prev;
|
|
}, {});
|
|
}
|
|
|
|
function sleep() {
|
|
var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
return new Promise(function (resolve) {
|
|
return setTimeout(resolve, ms);
|
|
});
|
|
}
|
|
function debounce(func, wait, context) {
|
|
var timeout;
|
|
|
|
function fn() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
var later = function later() {
|
|
timeout = null;
|
|
func.apply(context, args);
|
|
};
|
|
|
|
clearTimeout(timeout);
|
|
timeout = setTimeout(later, wait);
|
|
}
|
|
|
|
fn.clearTimeout = function ct() {
|
|
clearTimeout(timeout);
|
|
};
|
|
|
|
return fn;
|
|
}
|
|
function throttle(callback, delay) {
|
|
var isThrottled = false;
|
|
var args;
|
|
var context;
|
|
|
|
function fn() {
|
|
for (var _len2 = arguments.length, args2 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
args2[_key2] = arguments[_key2];
|
|
}
|
|
|
|
if (isThrottled) {
|
|
args = args2;
|
|
context = this;
|
|
return;
|
|
}
|
|
|
|
isThrottled = true;
|
|
callback.apply(this, args2);
|
|
setTimeout(function () {
|
|
isThrottled = false;
|
|
|
|
if (args) {
|
|
fn.apply(context, args);
|
|
args = null;
|
|
context = null;
|
|
}
|
|
}, delay);
|
|
}
|
|
|
|
return fn;
|
|
}
|
|
|
|
function clamp(num, a, b) {
|
|
return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
|
|
}
|
|
function secondToTime(second) {
|
|
var add0 = function add0(num) {
|
|
return num < 10 ? "0".concat(num) : String(num);
|
|
};
|
|
|
|
var hour = Math.floor(second / 3600);
|
|
var min = Math.floor((second - hour * 3600) / 60);
|
|
var sec = Math.floor(second - hour * 3600 - min * 60);
|
|
return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');
|
|
}
|
|
|
|
|
|
|
|
var utils = /*#__PURE__*/Object.freeze({
|
|
__proto__: null,
|
|
query: query,
|
|
queryAll: queryAll,
|
|
addClass: addClass,
|
|
removeClass: removeClass,
|
|
hasClass: hasClass,
|
|
append: append,
|
|
remove: remove,
|
|
setStyle: setStyle,
|
|
setStyles: setStyles,
|
|
getStyle: getStyle,
|
|
sublings: sublings,
|
|
inverseClass: inverseClass,
|
|
tooltip: tooltip,
|
|
ArtPlayerError: ArtPlayerError,
|
|
errorHandle: errorHandle,
|
|
srtToVtt: srtToVtt,
|
|
vttToBlob: vttToBlob,
|
|
assToVtt: assToVtt,
|
|
getExt: getExt,
|
|
downloadFile: downloadFile,
|
|
def: def,
|
|
has: has$1,
|
|
proxyPropertys: proxyPropertys,
|
|
mergeDeep: mergeDeep,
|
|
sleep: sleep,
|
|
debounce: debounce,
|
|
throttle: throttle,
|
|
clamp: clamp,
|
|
secondToTime: secondToTime
|
|
});
|
|
|
|
function validElement(value, type, paths) {
|
|
return errorHandle(type === 'string' || value instanceof Element, "".concat(paths.join('.'), " require 'string' or 'Element' type"));
|
|
}
|
|
|
|
var scheme = {
|
|
container: validElement,
|
|
url: 'string',
|
|
poster: 'string',
|
|
title: 'string',
|
|
theme: 'string',
|
|
lang: 'string',
|
|
volume: 'number',
|
|
isLive: 'boolean',
|
|
muted: 'boolean',
|
|
autoplay: 'boolean',
|
|
autoSize: 'boolean',
|
|
loop: 'boolean',
|
|
flip: 'boolean',
|
|
playbackRate: 'boolean',
|
|
aspectRatio: 'boolean',
|
|
screenshot: 'boolean',
|
|
setting: 'boolean',
|
|
hotkey: 'boolean',
|
|
pip: 'boolean',
|
|
mutex: 'boolean',
|
|
backdrop: 'boolean',
|
|
fullscreen: 'boolean',
|
|
fullscreenWeb: 'boolean',
|
|
subtitleOffset: 'boolean',
|
|
miniProgressBar: 'boolean',
|
|
localVideo: 'boolean',
|
|
localSubtitle: 'boolean',
|
|
networkMonitor: 'boolean',
|
|
plugins: ['function'],
|
|
whitelist: ['string|function|regexp'],
|
|
layers: [{
|
|
disable: 'boolean|undefined',
|
|
name: 'string|undefined',
|
|
index: 'number|undefined',
|
|
html: validElement,
|
|
style: 'object|undefined',
|
|
click: 'function|undefined',
|
|
mounted: 'function|undefined',
|
|
tooltip: 'string|undefined'
|
|
}],
|
|
contextmenu: [{
|
|
disable: 'boolean|undefined',
|
|
name: 'string|undefined',
|
|
index: 'number|undefined',
|
|
html: validElement,
|
|
style: 'object|undefined',
|
|
click: 'function|undefined',
|
|
mounted: 'function|undefined',
|
|
tooltip: 'string|undefined'
|
|
}],
|
|
quality: [{
|
|
default: 'boolean|undefined',
|
|
name: 'string',
|
|
url: 'string'
|
|
}],
|
|
controls: [{
|
|
disable: 'boolean|undefined',
|
|
name: 'string|undefined',
|
|
index: 'number|undefined',
|
|
html: validElement,
|
|
style: 'object|undefined',
|
|
click: 'function|undefined',
|
|
mounted: 'function|undefined',
|
|
tooltip: 'string|undefined',
|
|
position: function position(value, type, paths) {
|
|
var position = ['top', 'left', 'right'];
|
|
return errorHandle(position.includes(value), "".concat(paths.join('.'), " only accept ").concat(position.toString(), " as parameters"));
|
|
}
|
|
}],
|
|
highlight: [{
|
|
time: 'number',
|
|
text: 'string'
|
|
}],
|
|
thumbnails: {
|
|
url: 'string',
|
|
number: 'number',
|
|
width: 'number',
|
|
height: 'number',
|
|
column: 'number'
|
|
},
|
|
subtitle: {
|
|
url: 'string',
|
|
style: 'object'
|
|
},
|
|
moreVideoAttr: 'object',
|
|
icons: 'object',
|
|
customType: 'object'
|
|
};
|
|
|
|
var config = {
|
|
propertys: ['audioTracks', 'autoplay', 'buffered', 'controller', 'controls', 'crossOrigin', 'currentSrc', 'currentTime', 'defaultMuted', 'defaultPlaybackRate', 'duration', 'ended', 'error', 'loop', 'mediaGroup', 'muted', 'networkState', 'paused', 'playbackRate', 'played', 'preload', 'readyState', 'seekable', 'seeking', 'src', 'startDate', 'textTracks', 'videoTracks', 'volume'],
|
|
methods: ['addTextTrack', 'canPlayType', 'load', 'play', 'pause'],
|
|
events: ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']
|
|
};
|
|
|
|
var Whitelist = function Whitelist(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Whitelist);
|
|
|
|
var kindOf = art.constructor.kindOf,
|
|
whitelist = art.option.whitelist;
|
|
this.ua = navigator.userAgent;
|
|
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua);
|
|
this.state = !this.isMobile || whitelist.some(function (item) {
|
|
switch (kindOf(item)) {
|
|
case 'string':
|
|
return _this.ua.indexOf(item) > -1;
|
|
|
|
case 'function':
|
|
return item(_this.ua);
|
|
|
|
case 'regexp':
|
|
return item.test(_this.ua);
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
});
|
|
};
|
|
|
|
var Template =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Template(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Template);
|
|
|
|
this.art = art;
|
|
|
|
if (art.option.container instanceof Element) {
|
|
this.$container = art.option.container;
|
|
} else {
|
|
this.$container = query(art.option.container);
|
|
errorHandle(this.$container, "No container element found by ".concat(art.option.container));
|
|
}
|
|
|
|
errorHandle(art.constructor.instances.every(function (art) {
|
|
return art.template.$container !== _this.$container;
|
|
}), 'Cannot mount multiple instances on the same dom element');
|
|
errorHandle(this.$container.clientWidth && this.$container.clientHeight, 'The width and height of the container cannot be 0');
|
|
|
|
if (art.whitelist.state) {
|
|
this.desktop();
|
|
} else {
|
|
this.mobile();
|
|
}
|
|
}
|
|
|
|
createClass(Template, [{
|
|
key: "query",
|
|
value: function query$1(className) {
|
|
return query(className, this.$container);
|
|
}
|
|
}, {
|
|
key: "desktop",
|
|
value: function desktop() {
|
|
var _this$art$option = this.art.option,
|
|
theme = _this$art$option.theme,
|
|
backdrop = _this$art$option.backdrop;
|
|
this.$container.innerHTML = "\n <div class=\"art-video-player art-subtitle-show art-layer-show\" style=\"--theme: ".concat(theme, "\">\n <video class=\"art-video\">\n <track default kind=\"metadata\"></track>\n </video>\n <div class=\"art-subtitle\"></div>\n <div class=\"art-danmuku\"></div>\n <div class=\"art-layers\"></div>\n <div class=\"art-mask\">\n <div class=\"art-state\"></div>\n </div>\n <div class=\"art-bottom\">\n <div class=\"art-progress\"></div>\n <div class=\"art-controls\">\n <div class=\"art-controls-left\"></div>\n <div class=\"art-controls-right\"></div>\n </div>\n </div>\n <div class=\"art-loading\"></div>\n <div class=\"art-notice\">\n <div class=\"art-notice-inner\"></div>\n </div>\n <div class=\"art-settings\">\n <div class=\"art-setting-inner\">\n <div class=\"art-setting-body\"></div>\n </div>\n </div>\n <div class=\"art-info\">\n <div class=\"art-info-panel\">\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Player version:</div>\n <div class=\"art-info-content\">3.3.3</div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video url:</div>\n <div class=\"art-info-content\" data-video=\"src\"></div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video volume:</div>\n <div class=\"art-info-content\" data-video=\"volume\"></div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video time:</div>\n <div class=\"art-info-content\" data-video=\"currentTime\"></div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video duration:</div>\n <div class=\"art-info-content\" data-video=\"duration\"></div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video resolution:</div>\n <div class=\"art-info-content\">\n <span data-video=\"videoWidth\"></span> x <span data-video=\"videoHeight\"></span>\n </div>\n </div>\n </div>\n <div class=\"art-info-close\">[x]</div>\n </div>\n <div class=\"art-pip-header\">\n <div class=\"art-pip-title\"></div>\n <div class=\"art-pip-close\">\xD7</div>\n </div>\n <div class=\"art-contextmenus\"></div>\n </div>\n ");
|
|
this.$player = this.query('.art-video-player');
|
|
this.$video = this.query('.art-video');
|
|
this.$track = this.query('.art-video track');
|
|
this.$subtitle = this.query('.art-subtitle');
|
|
this.$danmuku = this.query('.art-danmuku');
|
|
this.$bottom = this.query('.art-bottom');
|
|
this.$progress = this.query('.art-progress');
|
|
this.$controls = this.query('.art-controls');
|
|
this.$controlsLeft = this.query('.art-controls-left');
|
|
this.$controlsRight = this.query('.art-controls-right');
|
|
this.$layer = this.query('.art-layers');
|
|
this.$loading = this.query('.art-loading');
|
|
this.$notice = this.query('.art-notice');
|
|
this.$noticeInner = this.query('.art-notice-inner');
|
|
this.$mask = this.query('.art-mask');
|
|
this.$state = this.query('.art-state');
|
|
this.$setting = this.query('.art-settings');
|
|
this.$settingInner = this.query('.art-setting-inner');
|
|
this.$settingBody = this.query('.art-setting-body');
|
|
this.$info = this.query('.art-info');
|
|
this.$infoPanel = this.query('.art-info-panel');
|
|
this.$infoClose = this.query('.art-info-close');
|
|
this.$pipHeader = this.query('.art-pip-header');
|
|
this.$pipTitle = this.query('.art-pip-title');
|
|
this.$pipClose = this.query('.art-pip-close');
|
|
this.$contextmenu = this.query('.art-contextmenus');
|
|
|
|
if (backdrop) {
|
|
addClass(this.$settingInner, 'art-backdrop-filter');
|
|
addClass(this.$info, 'art-backdrop-filter');
|
|
addClass(this.$contextmenu, 'art-backdrop-filter');
|
|
}
|
|
}
|
|
}, {
|
|
key: "mobile",
|
|
value: function mobile() {
|
|
this.$container.innerHTML = "\n <div class=\"art-video-player\">\n <video class=\"art-video\"></video>\n </div>\n ";
|
|
this.$player = this.query('.art-video-player');
|
|
this.$video = this.query('.art-video');
|
|
}
|
|
}, {
|
|
key: "destroy",
|
|
value: function destroy(remove) {
|
|
if (remove) {
|
|
this.$container.innerHTML = '';
|
|
} else {
|
|
addClass(this.$player, 'art-destroy');
|
|
}
|
|
}
|
|
}]);
|
|
|
|
return Template;
|
|
}();
|
|
|
|
var Close = "关闭";
|
|
var Volume = "音量";
|
|
var Play = "播放";
|
|
var Pause = "暂停";
|
|
var Rate = "速度";
|
|
var Mute = "静音";
|
|
var Flip = "视频翻转";
|
|
var Horizontal = "水平";
|
|
var Vertical = "垂直";
|
|
var Reconnect = "重新连接";
|
|
var Screenshot = "截图";
|
|
var Default = "默认";
|
|
var Normal = "正常";
|
|
var Open = "打开";
|
|
var Fullscreen = "全屏";
|
|
var zhCn = {
|
|
"Video info": "视频统计信息",
|
|
Close: Close,
|
|
"Video load failed": "视频加载失败",
|
|
Volume: Volume,
|
|
Play: Play,
|
|
Pause: Pause,
|
|
Rate: Rate,
|
|
Mute: Mute,
|
|
Flip: Flip,
|
|
Horizontal: Horizontal,
|
|
Vertical: Vertical,
|
|
Reconnect: Reconnect,
|
|
"Hide subtitle": "隐藏字幕",
|
|
"Show subtitle": "显示字幕",
|
|
"Hide danmu": "隐藏弹幕",
|
|
"Show danmu": "显示弹幕",
|
|
"Show setting": "显示设置",
|
|
"Hide setting": "隐藏设置",
|
|
Screenshot: Screenshot,
|
|
"Play speed": "播放速度",
|
|
"Aspect ratio": "画面比例",
|
|
Default: Default,
|
|
Normal: Normal,
|
|
Open: Open,
|
|
"Switch video": "切换",
|
|
"Switch subtitle": "切换字幕",
|
|
Fullscreen: Fullscreen,
|
|
"Exit fullscreen": "退出全屏",
|
|
"Web fullscreen": "网页全屏",
|
|
"Exit web fullscreen": "退出网页全屏",
|
|
"Mini player": "迷你播放器",
|
|
"Exit mini player": "退出迷你播放器",
|
|
"Local Subtitle": "本地字幕",
|
|
"Local Video": "本地视频",
|
|
"Subtitle offset time": "字幕偏移时间",
|
|
"No subtitles found": "未发现字幕"
|
|
};
|
|
|
|
var Close$1 = "關閉";
|
|
var Volume$1 = "音量";
|
|
var Play$1 = "播放";
|
|
var Pause$1 = "暫停";
|
|
var Rate$1 = "速度";
|
|
var Mute$1 = "靜音";
|
|
var Flip$1 = "影片翻轉";
|
|
var Horizontal$1 = "水平";
|
|
var Vertical$1 = "垂直";
|
|
var Reconnect$1 = "重新連接";
|
|
var Screenshot$1 = "截圖";
|
|
var Default$1 = "默認";
|
|
var Normal$1 = "正常";
|
|
var Open$1 = "打開";
|
|
var Fullscreen$1 = "全屏";
|
|
var zhTw = {
|
|
"Video info": "影片統計訊息",
|
|
Close: Close$1,
|
|
"Video load failed": "影片載入失敗",
|
|
Volume: Volume$1,
|
|
Play: Play$1,
|
|
Pause: Pause$1,
|
|
Rate: Rate$1,
|
|
Mute: Mute$1,
|
|
Flip: Flip$1,
|
|
Horizontal: Horizontal$1,
|
|
Vertical: Vertical$1,
|
|
Reconnect: Reconnect$1,
|
|
"Hide subtitle": "隱藏字幕",
|
|
"Show subtitle": "顯示字幕",
|
|
"Hide danmu": "隱藏彈幕",
|
|
"Show danmu": "顯示彈幕",
|
|
"Show setting": "顯示设置",
|
|
"Hide setting": "隱藏设置",
|
|
Screenshot: Screenshot$1,
|
|
"Play speed": "播放速度",
|
|
"Aspect ratio": "畫面比例",
|
|
Default: Default$1,
|
|
Normal: Normal$1,
|
|
Open: Open$1,
|
|
"Switch video": "切換",
|
|
"Switch subtitle": "切換字幕",
|
|
Fullscreen: Fullscreen$1,
|
|
"Exit fullscreen": "退出全屏",
|
|
"Web fullscreen": "網頁全屏",
|
|
"Exit web fullscreen": "退出網頁全屏",
|
|
"Mini player": "迷你播放器",
|
|
"Exit mini player": "退出迷你播放器",
|
|
"Local Subtitle": "本地字幕",
|
|
"Local Video": "本地視頻",
|
|
"Subtitle offset time": "字幕偏移時間",
|
|
"No subtitles found": "未發現字幕"
|
|
};
|
|
|
|
var I18n =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function I18n(art) {
|
|
classCallCheck(this, I18n);
|
|
|
|
this.art = art;
|
|
this.languages = {
|
|
'zh-cn': zhCn,
|
|
'zh-tw': zhTw
|
|
};
|
|
this.init();
|
|
}
|
|
|
|
createClass(I18n, [{
|
|
key: "init",
|
|
value: function init() {
|
|
var lang = this.art.option.lang.toLowerCase();
|
|
this.language = this.languages[lang] || {};
|
|
}
|
|
}, {
|
|
key: "get",
|
|
value: function get(key) {
|
|
return this.language[key] || key;
|
|
}
|
|
}, {
|
|
key: "update",
|
|
value: function update(value) {
|
|
this.languages = mergeDeep(this.languages, value);
|
|
this.init();
|
|
}
|
|
}]);
|
|
|
|
return I18n;
|
|
}();
|
|
|
|
function urlMix(art, player) {
|
|
var _art$option = art.option,
|
|
type = _art$option.type,
|
|
customType = _art$option.customType,
|
|
$video = art.template.$video;
|
|
def(player, 'url', {
|
|
get: function get() {
|
|
return $video.src;
|
|
},
|
|
set: function set(url) {
|
|
var typeName = type || getExt(url);
|
|
var typeCallback = customType[typeName];
|
|
|
|
if (typeName && typeCallback) {
|
|
sleep().then(function () {
|
|
art.loading.show = true;
|
|
typeCallback.call(art, $video, url, art);
|
|
art.emit('customType', typeName);
|
|
});
|
|
} else {
|
|
$video.src = url;
|
|
art.option.url = url;
|
|
art.emit('urlChange', url);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function attrInit(art, player) {
|
|
var option = art.option,
|
|
storage = art.storage,
|
|
$video = art.template.$video;
|
|
Object.keys(option.moreVideoAttr).forEach(function (key) {
|
|
$video[key] = option.moreVideoAttr[key];
|
|
});
|
|
|
|
if (option.muted) {
|
|
$video.muted = option.muted;
|
|
}
|
|
|
|
if (option.volume) {
|
|
$video.volume = clamp(option.volume, 0, 1);
|
|
}
|
|
|
|
var volume = storage.get('volume');
|
|
|
|
if (volume) {
|
|
$video.volume = clamp(volume, 0, 1);
|
|
}
|
|
|
|
if (option.poster) {
|
|
$video.poster = option.poster;
|
|
}
|
|
|
|
if (option.autoplay) {
|
|
$video.autoplay = option.autoplay;
|
|
}
|
|
|
|
$video.controls = false;
|
|
player.url = option.url;
|
|
}
|
|
|
|
function eventInit(art, player) {
|
|
var option = art.option,
|
|
proxy = art.events.proxy,
|
|
_art$template = art.template,
|
|
$player = _art$template.$player,
|
|
$video = _art$template.$video,
|
|
i18n = art.i18n,
|
|
notice = art.notice;
|
|
var reconnectTime = 0;
|
|
var maxReconnectTime = 5;
|
|
proxy($video, 'click', function () {
|
|
player.toggle = true;
|
|
});
|
|
config.events.forEach(function (eventName) {
|
|
proxy($video, eventName, function (event) {
|
|
art.emit("video:".concat(event.type), event);
|
|
});
|
|
}); // art.on('video:abort', () => {
|
|
// });
|
|
|
|
art.on('video:canplay', function () {
|
|
reconnectTime = 0;
|
|
art.loading.show = false;
|
|
});
|
|
art.once('video:canplay', function () {
|
|
art.controls.show = true;
|
|
art.mask.show = true;
|
|
art.emit('ready');
|
|
}); // art.on('video:canplaythrough', () => {
|
|
// });
|
|
// art.on('video:durationchange', () => {
|
|
// });
|
|
// art.on('video:emptied', () => {
|
|
// });
|
|
|
|
art.on('video:ended', function () {
|
|
if (option.loop) {
|
|
player.seek = 0;
|
|
player.play = true;
|
|
art.controls.show = false;
|
|
art.mask.show = false;
|
|
} else {
|
|
art.controls.show = true;
|
|
art.mask.show = true;
|
|
}
|
|
});
|
|
art.on('video:error', function () {
|
|
if (reconnectTime < maxReconnectTime) {
|
|
sleep(1000).then(function () {
|
|
reconnectTime += 1;
|
|
player.url = option.url;
|
|
notice.show = "".concat(i18n.get('Reconnect'), ": ").concat(reconnectTime);
|
|
});
|
|
} else {
|
|
art.loading.show = false;
|
|
art.controls.show = false;
|
|
addClass($player, 'art-error');
|
|
sleep(1000).then(function () {
|
|
notice.show = i18n.get('Video load failed');
|
|
art.destroy(false);
|
|
});
|
|
}
|
|
}); // art.on('video:loadeddata', () => {
|
|
// });
|
|
|
|
art.on('video:loadedmetadata', function () {
|
|
if (option.autoSize) {
|
|
player.autoSize = true;
|
|
}
|
|
});
|
|
art.on('video:loadstart', function () {
|
|
art.loading.show = true;
|
|
});
|
|
art.on('video:pause', function () {
|
|
art.controls.show = true;
|
|
art.mask.show = true;
|
|
});
|
|
art.on('video:play', function () {
|
|
art.mask.show = false;
|
|
});
|
|
art.on('video:playing', function () {
|
|
art.mask.show = false;
|
|
}); // art.on('video:progress', () => {
|
|
// });
|
|
// art.on('video:ratechange', () => {
|
|
// });
|
|
|
|
art.on('video:seeked', function () {
|
|
art.loading.show = false;
|
|
});
|
|
art.on('video:seeking', function () {
|
|
art.loading.show = true;
|
|
}); // art.on('video:stalled', () => {
|
|
// });
|
|
// art.on('video:suspend', () => {
|
|
// });
|
|
|
|
art.on('video:timeupdate', function () {
|
|
art.mask.show = false;
|
|
}); // art.on('video:volumechange', () => {
|
|
// });
|
|
|
|
art.on('video:waiting', function () {
|
|
art.loading.show = true;
|
|
});
|
|
}
|
|
|
|
function playMix(art, player) {
|
|
var i18n = art.i18n,
|
|
notice = art.notice,
|
|
instances = art.constructor.instances,
|
|
mutex = art.option.mutex,
|
|
$video = art.template.$video;
|
|
def(player, 'play', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
var promise = $video.play();
|
|
|
|
if (promise.then) {
|
|
promise.then().catch(function (err) {
|
|
notice.show = err;
|
|
throw err;
|
|
});
|
|
}
|
|
|
|
if (mutex) {
|
|
instances.filter(function (item) {
|
|
return item !== art;
|
|
}).forEach(function (item) {
|
|
item.player.pause = true;
|
|
});
|
|
}
|
|
|
|
notice.show = i18n.get('Play');
|
|
art.emit('play');
|
|
} else {
|
|
player.pause = true;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function pauseMin(art, player) {
|
|
var $video = art.template.$video,
|
|
i18n = art.i18n,
|
|
notice = art.notice;
|
|
def(player, 'pause', {
|
|
get: function get() {
|
|
return $video.paused;
|
|
},
|
|
set: function set(value) {
|
|
if (value) {
|
|
$video.pause();
|
|
notice.show = i18n.get('Pause');
|
|
art.emit('pause');
|
|
} else {
|
|
player.play = true;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function toggleMix(art, player) {
|
|
def(player, 'toggle', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
if (player.playing) {
|
|
player.pause = true;
|
|
} else {
|
|
player.play = true;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function seekMix(art, player) {
|
|
var notice = art.notice;
|
|
def(player, 'seek', {
|
|
set: function set(time) {
|
|
player.currentTime = time;
|
|
notice.show = "".concat(secondToTime(time), " / ").concat(secondToTime(player.duration));
|
|
art.emit('seek', time);
|
|
}
|
|
});
|
|
}
|
|
|
|
function volumeMix(art, player) {
|
|
var $video = art.template.$video,
|
|
i18n = art.i18n,
|
|
notice = art.notice,
|
|
storage = art.storage;
|
|
def(player, 'volume', {
|
|
get: function get() {
|
|
return $video.volume || 0;
|
|
},
|
|
set: function set(percentage) {
|
|
$video.volume = clamp(percentage, 0, 1);
|
|
notice.show = "".concat(i18n.get('Volume'), ": ").concat(parseInt($video.volume * 100, 10));
|
|
|
|
if ($video.volume !== 0) {
|
|
storage.set('volume', $video.volume);
|
|
}
|
|
|
|
art.emit('volume', $video.volume);
|
|
}
|
|
});
|
|
def(player, 'muted', {
|
|
get: function get() {
|
|
return $video.muted;
|
|
},
|
|
set: function set(muted) {
|
|
$video.muted = muted;
|
|
art.emit('volume', $video.volume);
|
|
}
|
|
});
|
|
}
|
|
|
|
function currentTimeMix(art, player) {
|
|
def(player, 'currentTime', {
|
|
get: function get() {
|
|
return art.template.$video.currentTime || 0;
|
|
},
|
|
set: function set(currentTime) {
|
|
art.template.$video.currentTime = clamp(currentTime, 0, player.duration);
|
|
}
|
|
});
|
|
}
|
|
|
|
function durationMix(art, player) {
|
|
def(player, 'duration', {
|
|
get: function get() {
|
|
return art.template.$video.duration || 0;
|
|
}
|
|
});
|
|
}
|
|
|
|
function switchMix(art, player) {
|
|
var i18n = art.i18n,
|
|
notice = art.notice;
|
|
|
|
function switchUrl(url, name, currentTime) {
|
|
if (url === player.url) return;
|
|
URL.revokeObjectURL(player.url);
|
|
var playing = player.playing;
|
|
player.url = url;
|
|
player.playbackRate = false;
|
|
player.aspectRatio = false;
|
|
art.once('video:canplay', function () {
|
|
player.currentTime = currentTime;
|
|
});
|
|
|
|
if (playing) {
|
|
player.play = true;
|
|
}
|
|
|
|
if (name) {
|
|
notice.show = "".concat(i18n.get('Switch video'), ": ").concat(name);
|
|
}
|
|
|
|
art.emit('switch', url);
|
|
}
|
|
|
|
def(player, 'switchQuality', {
|
|
value: function value(url, name) {
|
|
return switchUrl(url, name, player.currentTime);
|
|
}
|
|
});
|
|
def(player, 'switchUrl', {
|
|
value: function value(url, name) {
|
|
return switchUrl(url, name, 0);
|
|
}
|
|
});
|
|
}
|
|
|
|
function playbackRateMix(art, player) {
|
|
var _art$template = art.template,
|
|
$video = _art$template.$video,
|
|
$player = _art$template.$player,
|
|
i18n = art.i18n,
|
|
notice = art.notice;
|
|
def(player, 'playbackRate', {
|
|
get: function get() {
|
|
return $player.dataset.playbackRate;
|
|
},
|
|
set: function set(rate) {
|
|
if (rate) {
|
|
if (rate === $player.dataset.playbackRate) return;
|
|
var rateList = [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0];
|
|
errorHandle(rateList.includes(rate), "'playbackRate' only accept ".concat(rateList.toString(), " as parameters"));
|
|
$video.playbackRate = rate;
|
|
$player.dataset.playbackRate = rate;
|
|
notice.show = "".concat(i18n.get('Rate'), ": ").concat(rate === 1.0 ? i18n.get('Normal') : "".concat(rate, "x"));
|
|
art.emit('playbackRateChange', rate);
|
|
} else if (player.playbackRate) {
|
|
player.playbackRate = 1;
|
|
delete $player.dataset.playbackRate;
|
|
art.emit('playbackRateRemove');
|
|
}
|
|
}
|
|
});
|
|
def(player, 'playbackRateReset', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
var playbackRate = $player.dataset.playbackRate;
|
|
|
|
if (playbackRate) {
|
|
player.playbackRate = Number(playbackRate);
|
|
art.emit('playbackRateReset');
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function aspectRatioMix(art, player) {
|
|
var _art$template = art.template,
|
|
$video = _art$template.$video,
|
|
$player = _art$template.$player,
|
|
i18n = art.i18n,
|
|
notice = art.notice;
|
|
def(player, 'aspectRatio', {
|
|
get: function get() {
|
|
return $player.dataset.aspectRatio || '';
|
|
},
|
|
set: function set(ratio) {
|
|
if (ratio) {
|
|
var ratioList = ['default', '4:3', '16:9'];
|
|
errorHandle(ratioList.includes(ratio), "'aspectRatio' only accept ".concat(ratioList.toString(), " as parameters"));
|
|
|
|
if (ratio === 'default') {
|
|
player.aspectRatio = false;
|
|
} else {
|
|
var ratioArray = ratio.split(':');
|
|
var videoWidth = $video.videoWidth,
|
|
videoHeight = $video.videoHeight;
|
|
var clientWidth = $player.clientWidth,
|
|
clientHeight = $player.clientHeight;
|
|
var videoRatio = videoWidth / videoHeight;
|
|
var setupRatio = ratioArray[0] / ratioArray[1];
|
|
|
|
if (videoRatio > setupRatio) {
|
|
var percentage = setupRatio * videoHeight / videoWidth;
|
|
setStyle($video, 'width', "".concat(percentage * 100, "%"));
|
|
setStyle($video, 'height', '100%');
|
|
setStyle($video, 'padding', "0 ".concat((clientWidth - clientWidth * percentage) / 2, "px"));
|
|
} else {
|
|
var _percentage = videoWidth / setupRatio / videoHeight;
|
|
|
|
setStyle($video, 'width', '100%');
|
|
setStyle($video, 'height', "".concat(_percentage * 100, "%"));
|
|
setStyle($video, 'padding', "".concat((clientHeight - clientHeight * _percentage) / 2, "px 0"));
|
|
}
|
|
}
|
|
|
|
$player.dataset.aspectRatio = ratio;
|
|
notice.show = "".concat(i18n.get('Aspect ratio'), ": ").concat(ratio === 'default' ? i18n.get('Default') : ratio);
|
|
art.emit('aspectRatioChange', ratio);
|
|
} else if (player.aspectRatio) {
|
|
setStyle($video, 'width', null);
|
|
setStyle($video, 'height', null);
|
|
setStyle($video, 'padding', null);
|
|
delete $player.dataset.aspectRatio;
|
|
art.emit('aspectRatioRemove');
|
|
}
|
|
}
|
|
});
|
|
def(player, 'aspectRatioReset', {
|
|
set: function set(value) {
|
|
if (value && player.aspectRatio) {
|
|
var aspectRatio = player.aspectRatio;
|
|
player.aspectRatio = aspectRatio;
|
|
art.emit('aspectRatioReset');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function screenshotMix(art, player) {
|
|
var option = art.option,
|
|
notice = art.notice,
|
|
$video = art.template.$video;
|
|
def(player, 'getScreenshotDataURL', {
|
|
value: function value() {
|
|
try {
|
|
var canvas = document.createElement('canvas');
|
|
canvas.width = $video.videoWidth;
|
|
canvas.height = $video.videoHeight;
|
|
canvas.getContext('2d').drawImage($video, 0, 0);
|
|
return canvas.toDataURL('image/png');
|
|
} catch (err) {
|
|
notice.show = err;
|
|
throw err;
|
|
}
|
|
}
|
|
});
|
|
def(player, 'getScreenshotBlobUrl', {
|
|
value: function value() {
|
|
return new Promise(function (resolve, reject) {
|
|
try {
|
|
var canvas = document.createElement('canvas');
|
|
canvas.width = $video.videoWidth;
|
|
canvas.height = $video.videoHeight;
|
|
canvas.getContext('2d').drawImage($video, 0, 0);
|
|
canvas.toBlob(function (blob) {
|
|
resolve(URL.createObjectURL(blob));
|
|
});
|
|
} catch (err) {
|
|
notice.show = err;
|
|
reject(err);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
def(player, 'screenshot', {
|
|
value: function value() {
|
|
var dataUri = player.getScreenshotDataURL();
|
|
|
|
if (dataUri) {
|
|
downloadFile(dataUri, "".concat(option.title || 'artplayer', "_").concat(secondToTime($video.currentTime), ".png"));
|
|
art.emit('screenshot', dataUri);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
var screenfull = createCommonjsModule(function (module) {
|
|
/*!
|
|
* screenfull
|
|
* v5.0.0 - 2019-09-09
|
|
* (c) Sindre Sorhus; MIT License
|
|
*/
|
|
(function () {
|
|
|
|
var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};
|
|
var isCommonjs = module.exports;
|
|
|
|
var fn = (function () {
|
|
var val;
|
|
|
|
var fnMap = [
|
|
[
|
|
'requestFullscreen',
|
|
'exitFullscreen',
|
|
'fullscreenElement',
|
|
'fullscreenEnabled',
|
|
'fullscreenchange',
|
|
'fullscreenerror'
|
|
],
|
|
// New WebKit
|
|
[
|
|
'webkitRequestFullscreen',
|
|
'webkitExitFullscreen',
|
|
'webkitFullscreenElement',
|
|
'webkitFullscreenEnabled',
|
|
'webkitfullscreenchange',
|
|
'webkitfullscreenerror'
|
|
|
|
],
|
|
// Old WebKit
|
|
[
|
|
'webkitRequestFullScreen',
|
|
'webkitCancelFullScreen',
|
|
'webkitCurrentFullScreenElement',
|
|
'webkitCancelFullScreen',
|
|
'webkitfullscreenchange',
|
|
'webkitfullscreenerror'
|
|
|
|
],
|
|
[
|
|
'mozRequestFullScreen',
|
|
'mozCancelFullScreen',
|
|
'mozFullScreenElement',
|
|
'mozFullScreenEnabled',
|
|
'mozfullscreenchange',
|
|
'mozfullscreenerror'
|
|
],
|
|
[
|
|
'msRequestFullscreen',
|
|
'msExitFullscreen',
|
|
'msFullscreenElement',
|
|
'msFullscreenEnabled',
|
|
'MSFullscreenChange',
|
|
'MSFullscreenError'
|
|
]
|
|
];
|
|
|
|
var i = 0;
|
|
var l = fnMap.length;
|
|
var ret = {};
|
|
|
|
for (; i < l; i++) {
|
|
val = fnMap[i];
|
|
if (val && val[1] in document) {
|
|
for (i = 0; i < val.length; i++) {
|
|
ret[fnMap[0][i]] = val[i];
|
|
}
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
})();
|
|
|
|
var eventNameMap = {
|
|
change: fn.fullscreenchange,
|
|
error: fn.fullscreenerror
|
|
};
|
|
|
|
var screenfull = {
|
|
request: function (element) {
|
|
return new Promise(function (resolve, reject) {
|
|
var onFullScreenEntered = function () {
|
|
this.off('change', onFullScreenEntered);
|
|
resolve();
|
|
}.bind(this);
|
|
|
|
this.on('change', onFullScreenEntered);
|
|
|
|
element = element || document.documentElement;
|
|
|
|
Promise.resolve(element[fn.requestFullscreen]()).catch(reject);
|
|
}.bind(this));
|
|
},
|
|
exit: function () {
|
|
return new Promise(function (resolve, reject) {
|
|
if (!this.isFullscreen) {
|
|
resolve();
|
|
return;
|
|
}
|
|
|
|
var onFullScreenExit = function () {
|
|
this.off('change', onFullScreenExit);
|
|
resolve();
|
|
}.bind(this);
|
|
|
|
this.on('change', onFullScreenExit);
|
|
|
|
Promise.resolve(document[fn.exitFullscreen]()).catch(reject);
|
|
}.bind(this));
|
|
},
|
|
toggle: function (element) {
|
|
return this.isFullscreen ? this.exit() : this.request(element);
|
|
},
|
|
onchange: function (callback) {
|
|
this.on('change', callback);
|
|
},
|
|
onerror: function (callback) {
|
|
this.on('error', callback);
|
|
},
|
|
on: function (event, callback) {
|
|
var eventName = eventNameMap[event];
|
|
if (eventName) {
|
|
document.addEventListener(eventName, callback, false);
|
|
}
|
|
},
|
|
off: function (event, callback) {
|
|
var eventName = eventNameMap[event];
|
|
if (eventName) {
|
|
document.removeEventListener(eventName, callback, false);
|
|
}
|
|
},
|
|
raw: fn
|
|
};
|
|
|
|
if (!fn) {
|
|
if (isCommonjs) {
|
|
module.exports = {isEnabled: false};
|
|
} else {
|
|
window.screenfull = {isEnabled: false};
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
Object.defineProperties(screenfull, {
|
|
isFullscreen: {
|
|
get: function () {
|
|
return Boolean(document[fn.fullscreenElement]);
|
|
}
|
|
},
|
|
element: {
|
|
enumerable: true,
|
|
get: function () {
|
|
return document[fn.fullscreenElement];
|
|
}
|
|
},
|
|
isEnabled: {
|
|
enumerable: true,
|
|
get: function () {
|
|
// Coerce to boolean in case of old WebKit
|
|
return Boolean(document[fn.fullscreenEnabled]);
|
|
}
|
|
}
|
|
});
|
|
|
|
if (isCommonjs) {
|
|
module.exports = screenfull;
|
|
} else {
|
|
window.screenfull = screenfull;
|
|
}
|
|
})();
|
|
});
|
|
var screenfull_1 = screenfull.isEnabled;
|
|
|
|
function fullscreenMix(art, player) {
|
|
var $player = art.template.$player;
|
|
def(player, 'fullscreen', {
|
|
get: function get() {
|
|
return screenfull.isFullscreen;
|
|
},
|
|
set: function set(value) {
|
|
if (player.fullscreenWeb) {
|
|
player.fullscreenWeb = false;
|
|
}
|
|
|
|
if (value) {
|
|
screenfull.request($player).then(function () {
|
|
addClass($player, 'art-fullscreen');
|
|
player.aspectRatioReset = true;
|
|
art.emit('fullscreenChange', true);
|
|
});
|
|
} else {
|
|
screenfull.exit().then(function () {
|
|
removeClass($player, 'art-fullscreen');
|
|
player.aspectRatioReset = true;
|
|
art.emit('fullscreenChange', false);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
def(player, 'fullscreenToggle', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
player.fullscreen = !player.fullscreen;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function fullscreenWebMix(art, player) {
|
|
var $player = art.template.$player;
|
|
def(player, 'fullscreenWeb', {
|
|
get: function get() {
|
|
return hasClass($player, 'art-web-fullscreen');
|
|
},
|
|
set: function set(value) {
|
|
if (player.fullscreen) {
|
|
player.fullscreen = false;
|
|
}
|
|
|
|
if (value) {
|
|
addClass($player, 'art-web-fullscreen');
|
|
player.aspectRatioReset = true;
|
|
art.emit('fullscreenWebChange', true);
|
|
} else {
|
|
removeClass($player, 'art-web-fullscreen');
|
|
player.aspectRatioReset = true;
|
|
art.emit('fullscreenWebChange', false);
|
|
}
|
|
}
|
|
});
|
|
def(player, 'fullscreenWebToggle', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
player.fullscreenWeb = !player.fullscreenWeb;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function nativePip(art, player) {
|
|
var $video = art.template.$video,
|
|
proxy = art.events.proxy,
|
|
notice = art.notice;
|
|
$video.disablePictureInPicture = false;
|
|
def(player, 'pip', {
|
|
get: function get() {
|
|
return document.pictureInPictureElement;
|
|
},
|
|
set: function set(value) {
|
|
if (value) {
|
|
$video.requestPictureInPicture().catch(function (err) {
|
|
notice.show = err;
|
|
throw err;
|
|
});
|
|
} else {
|
|
document.exitPictureInPicture().catch(function (err) {
|
|
notice.show = err;
|
|
throw err;
|
|
});
|
|
}
|
|
}
|
|
});
|
|
proxy($video, 'enterpictureinpicture', function () {
|
|
art.emit('pipChange', true);
|
|
});
|
|
proxy($video, 'leavepictureinpicture', function () {
|
|
art.emit('pipChange', false);
|
|
});
|
|
}
|
|
|
|
function webkitPip(art, player) {
|
|
var $video = art.template.$video;
|
|
$video.webkitSetPresentationMode('inline');
|
|
def(player, 'pip', {
|
|
get: function get() {
|
|
return $video.webkitPresentationMode === 'picture-in-picture';
|
|
},
|
|
set: function set(value) {
|
|
if (value) {
|
|
$video.webkitSetPresentationMode('picture-in-picture');
|
|
art.emit('pipChange', true);
|
|
} else {
|
|
$video.webkitSetPresentationMode('inline');
|
|
art.emit('pipChange', false);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function customPip(art, player) {
|
|
var option = art.option,
|
|
i18n = art.i18n,
|
|
_art$template = art.template,
|
|
$player = _art$template.$player,
|
|
$pipClose = _art$template.$pipClose,
|
|
$pipTitle = _art$template.$pipTitle,
|
|
$pipHeader = _art$template.$pipHeader,
|
|
proxy = art.events.proxy;
|
|
var cacheStyle = '';
|
|
var isDroging = false;
|
|
var lastPageX = 0;
|
|
var lastPageY = 0;
|
|
var lastPlayerLeft = 0;
|
|
var lastPlayerTop = 0;
|
|
proxy($pipHeader, 'mousedown', function (event) {
|
|
isDroging = true;
|
|
lastPageX = event.pageX;
|
|
lastPageY = event.pageY;
|
|
lastPlayerLeft = player.left;
|
|
lastPlayerTop = player.top;
|
|
});
|
|
proxy($pipHeader, 'mousemove', function (event) {
|
|
if (isDroging) {
|
|
addClass($player, 'art-is-dragging');
|
|
setStyle($player, 'left', "".concat(lastPlayerLeft + event.pageX - lastPageX, "px"));
|
|
setStyle($player, 'top', "".concat(lastPlayerTop + event.pageY - lastPageY, "px"));
|
|
}
|
|
});
|
|
proxy(document, 'mouseup', function () {
|
|
isDroging = false;
|
|
removeClass($player, 'art-is-dragging');
|
|
});
|
|
proxy($pipClose, 'click', function () {
|
|
player.pip = false;
|
|
isDroging = false;
|
|
removeClass($player, 'art-is-dragging');
|
|
});
|
|
append($pipTitle, option.title || i18n.get('Mini player'));
|
|
def(player, 'pip', {
|
|
get: function get() {
|
|
return hasClass($player, 'art-pip');
|
|
},
|
|
set: function set(value) {
|
|
if (value) {
|
|
player.autoSize = false;
|
|
cacheStyle = $player.style.cssText;
|
|
addClass($player, 'art-pip');
|
|
var $body = document.body;
|
|
setStyle($player, 'top', "".concat($body.clientHeight - player.height - 50, "px"));
|
|
setStyle($player, 'left', "".concat($body.clientWidth - player.width - 50, "px"));
|
|
player.fullscreen = false;
|
|
player.fullscreenWeb = false;
|
|
player.aspectRatio = false;
|
|
player.playbackRate = false;
|
|
art.emit('pipChange', true);
|
|
} else if (player.pip) {
|
|
$player.style.cssText = cacheStyle;
|
|
removeClass($player, 'art-pip');
|
|
setStyle($player, 'top', null);
|
|
setStyle($player, 'left', null);
|
|
player.fullscreen = false;
|
|
player.fullscreenWeb = false;
|
|
player.aspectRatio = false;
|
|
player.playbackRate = false;
|
|
player.autoSize = true;
|
|
art.emit('pipChange', false);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function pipMix(art, player) {
|
|
var $video = art.template.$video;
|
|
|
|
if (document.pictureInPictureEnabled) {
|
|
nativePip(art, player);
|
|
} else if ($video.webkitSupportsPresentationMode) {
|
|
webkitPip(art, player);
|
|
} else {
|
|
customPip(art, player);
|
|
}
|
|
|
|
def(player, 'pipToggle', {
|
|
set: function set(value) {
|
|
if (value) {
|
|
player.pip = !player.pip;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function seekMix$1(art, player) {
|
|
var $video = art.template.$video;
|
|
def(player, 'loaded', {
|
|
get: function get() {
|
|
return player.loadedTime / $video.duration;
|
|
}
|
|
});
|
|
def(player, 'loadedTime', {
|
|
get: function get() {
|
|
return $video.buffered.length ? $video.buffered.end($video.buffered.length - 1) : 0;
|
|
}
|
|
});
|
|
}
|
|
|
|
function playedMix(art, player) {
|
|
def(player, 'played', {
|
|
get: function get() {
|
|
return player.currentTime / player.duration;
|
|
}
|
|
});
|
|
}
|
|
|
|
function playingMix(art, player) {
|
|
var $video = art.template.$video;
|
|
def(player, 'playing', {
|
|
get: function get() {
|
|
return !!($video.currentTime > 0 && !$video.paused && !$video.ended && $video.readyState > 2);
|
|
}
|
|
});
|
|
}
|
|
|
|
function resizeMix(art, player) {
|
|
var _art$template = art.template,
|
|
$container = _art$template.$container,
|
|
$player = _art$template.$player,
|
|
$video = _art$template.$video;
|
|
def(player, 'autoSize', {
|
|
get: function get() {
|
|
return hasClass($container, 'art-auto-size');
|
|
},
|
|
set: function set(value) {
|
|
if (value) {
|
|
var videoWidth = $video.videoWidth,
|
|
videoHeight = $video.videoHeight;
|
|
|
|
var _$container$getBoundi = $container.getBoundingClientRect(),
|
|
width = _$container$getBoundi.width,
|
|
height = _$container$getBoundi.height;
|
|
|
|
var videoRatio = videoWidth / videoHeight;
|
|
var containerRatio = width / height;
|
|
addClass($container, 'art-auto-size');
|
|
|
|
if (containerRatio > videoRatio) {
|
|
var percentage = height * videoRatio / width * 100;
|
|
setStyle($player, 'width', "".concat(percentage, "%"));
|
|
setStyle($player, 'height', '100%');
|
|
} else {
|
|
var _percentage = width / videoRatio / height * 100;
|
|
|
|
setStyle($player, 'width', '100%');
|
|
setStyle($player, 'height', "".concat(_percentage, "%"));
|
|
}
|
|
|
|
art.emit('autoSizeChange', {
|
|
width: player.width,
|
|
height: player.height
|
|
});
|
|
} else {
|
|
removeClass($container, 'art-auto-size');
|
|
setStyle($player, 'width', null);
|
|
setStyle($player, 'height', null);
|
|
art.emit('autoSizeRemove');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function rectMix(art, player) {
|
|
def(player, 'rect', {
|
|
get: function get() {
|
|
return art.template.$player.getBoundingClientRect();
|
|
}
|
|
});
|
|
['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (key) {
|
|
def(player, key, {
|
|
get: function get() {
|
|
return player.rect[key];
|
|
}
|
|
});
|
|
});
|
|
def(player, 'x', {
|
|
get: function get() {
|
|
return player.left + window.pageXOffset;
|
|
}
|
|
});
|
|
def(player, 'y', {
|
|
get: function get() {
|
|
return player.top + window.pageYOffset;
|
|
}
|
|
});
|
|
}
|
|
|
|
function flipMix(art, player) {
|
|
var $player = art.template.$player;
|
|
def(player, 'flip', {
|
|
get: function get() {
|
|
return $player.dataset.flip;
|
|
},
|
|
set: function set(flip) {
|
|
if (flip) {
|
|
var flipList = ['normal', 'horizontal', 'vertical'];
|
|
errorHandle(flipList.includes(flip), "'flip' only accept ".concat(flipList.toString(), " as parameters"));
|
|
$player.dataset.flip = flip;
|
|
art.emit('flipChange', flip);
|
|
} else {
|
|
delete $player.dataset.flip;
|
|
art.emit('flipRemove');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
var Player = function Player(art) {
|
|
classCallCheck(this, Player);
|
|
|
|
urlMix(art, this);
|
|
eventInit(art, this);
|
|
attrInit(art, this);
|
|
playMix(art, this);
|
|
pauseMin(art, this);
|
|
toggleMix(art, this);
|
|
seekMix(art, this);
|
|
volumeMix(art, this);
|
|
currentTimeMix(art, this);
|
|
durationMix(art, this);
|
|
switchMix(art, this);
|
|
playbackRateMix(art, this);
|
|
aspectRatioMix(art, this);
|
|
screenshotMix(art, this);
|
|
fullscreenMix(art, this);
|
|
fullscreenWebMix(art, this);
|
|
pipMix(art, this);
|
|
seekMix$1(art, this);
|
|
playedMix(art, this);
|
|
playingMix(art, this);
|
|
resizeMix(art, this);
|
|
rectMix(art, this);
|
|
flipMix(art, this);
|
|
proxyPropertys(art, this);
|
|
};
|
|
|
|
function _superPropBase(object, property) {
|
|
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
|
object = getPrototypeOf(object);
|
|
if (object === null) break;
|
|
}
|
|
|
|
return object;
|
|
}
|
|
|
|
var superPropBase = _superPropBase;
|
|
|
|
var get = createCommonjsModule(function (module) {
|
|
function _get(target, property, receiver) {
|
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
module.exports = _get = Reflect.get;
|
|
} else {
|
|
module.exports = _get = function _get(target, property, receiver) {
|
|
var base = superPropBase(target, property);
|
|
if (!base) return;
|
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
|
|
if (desc.get) {
|
|
return desc.get.call(receiver);
|
|
}
|
|
|
|
return desc.value;
|
|
};
|
|
}
|
|
|
|
return _get(target, property, receiver || target);
|
|
}
|
|
|
|
module.exports = _get;
|
|
});
|
|
|
|
var Component =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Component(art) {
|
|
classCallCheck(this, Component);
|
|
|
|
this.id = 0;
|
|
this.art = art;
|
|
this.add = this.add.bind(this);
|
|
}
|
|
|
|
createClass(Component, [{
|
|
key: "add",
|
|
value: function add(getOption, callback) {
|
|
var _this = this;
|
|
|
|
var option = typeof getOption === 'function' ? getOption(this.art) : getOption;
|
|
if (!this.$parent || !this.name || option.disable) return;
|
|
this.id += 1;
|
|
var name = option.name || "".concat(this.name).concat(this.id);
|
|
errorHandle(!has$1(this, name), "Cannot add an existing name [".concat(name, "] to the [").concat(this.name, "]"));
|
|
var $ref = document.createElement('div');
|
|
$ref.classList.value = "art-".concat(this.name, " art-").concat(this.name, "-").concat(name);
|
|
|
|
if (option.html) {
|
|
append($ref, option.html);
|
|
}
|
|
|
|
if (option.style) {
|
|
setStyles($ref, option.style);
|
|
}
|
|
|
|
if (option.tooltip) {
|
|
tooltip($ref, option.tooltip);
|
|
}
|
|
|
|
var childs = Array.from(this.$parent.children);
|
|
$ref.dataset.index = option.index || this.id;
|
|
var nextChild = childs.find(function (item) {
|
|
return Number(item.dataset.index) >= Number($ref.dataset.index);
|
|
});
|
|
|
|
if (nextChild) {
|
|
nextChild.insertAdjacentElement('beforebegin', $ref);
|
|
} else {
|
|
append(this.$parent, $ref);
|
|
}
|
|
|
|
if (option.click) {
|
|
this.art.events.proxy($ref, 'click', function (event) {
|
|
event.preventDefault();
|
|
option.click.call(_this.art, _this, event);
|
|
});
|
|
}
|
|
|
|
if (option.mounted) {
|
|
option.mounted($ref, this, this.art);
|
|
}
|
|
|
|
if (callback) {
|
|
callback($ref, this, this.art);
|
|
}
|
|
|
|
this.art.emit("".concat(this.name, ":add"), option);
|
|
def(this, name, {
|
|
get: function get() {
|
|
return option;
|
|
}
|
|
});
|
|
}
|
|
}, {
|
|
key: "show",
|
|
get: function get() {
|
|
return hasClass(this.art.template.$player, "art-".concat(this.name, "-show"));
|
|
},
|
|
set: function set(value) {
|
|
var $player = this.art.template.$player;
|
|
var className = "art-".concat(this.name, "-show");
|
|
|
|
if (value) {
|
|
addClass($player, className);
|
|
} else {
|
|
removeClass($player, className);
|
|
}
|
|
|
|
this.art.emit("".concat(this.name, ":toggle"), value);
|
|
}
|
|
}, {
|
|
key: "toggle",
|
|
set: function set(value) {
|
|
if (value) {
|
|
this.show = !this.show;
|
|
}
|
|
}
|
|
}]);
|
|
|
|
return Component;
|
|
}();
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function fullscreen(option) {
|
|
return function (art) {
|
|
return _objectSpread({}, option, {
|
|
tooltip: art.i18n.get('Fullscreen'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
player = art.player;
|
|
append($control, icons.fullscreen);
|
|
proxy($control, 'click', function () {
|
|
player.fullscreenToggle = true;
|
|
});
|
|
art.on('fullscreenChange', function (value) {
|
|
tooltip($control, i18n.get(value ? 'Exit fullscreen' : 'Fullscreen'));
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function fullscreenWeb(option) {
|
|
return function (art) {
|
|
return _objectSpread$1({}, option, {
|
|
tooltip: art.i18n.get('Web fullscreen'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
player = art.player;
|
|
append($control, icons.fullscreenWeb);
|
|
proxy($control, 'click', function () {
|
|
player.fullscreenWebToggle = true;
|
|
});
|
|
art.on('fullscreenWebChange', function (value) {
|
|
tooltip($control, i18n.get(value ? 'Exit web fullscreen' : 'Web fullscreen'));
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function pip(option) {
|
|
return function (art) {
|
|
return _objectSpread$2({}, option, {
|
|
tooltip: art.i18n.get('Mini player'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
player = art.player;
|
|
append($control, icons.pip);
|
|
proxy($control, 'click', function () {
|
|
player.pipToggle = true;
|
|
});
|
|
art.on('pipChange', function (value) {
|
|
tooltip($control, i18n.get(value ? 'Exit mini player' : 'Mini player'));
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function playAndPause(option) {
|
|
return function (art) {
|
|
return _objectSpread$3({}, option, {
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
player = art.player;
|
|
var $play = append($control, icons.play);
|
|
var $pause = append($control, icons.pause);
|
|
tooltip($play, i18n.get('Play'));
|
|
tooltip($pause, i18n.get('Pause'));
|
|
proxy($play, 'click', function () {
|
|
player.play = true;
|
|
});
|
|
proxy($pause, 'click', function () {
|
|
player.pause = true;
|
|
});
|
|
|
|
function showPlay() {
|
|
setStyle($play, 'display', 'flex');
|
|
setStyle($pause, 'display', 'none');
|
|
}
|
|
|
|
function showPause() {
|
|
setStyle($play, 'display', 'none');
|
|
setStyle($pause, 'display', 'flex');
|
|
}
|
|
|
|
if (player.playing) {
|
|
showPause();
|
|
} else {
|
|
showPlay();
|
|
}
|
|
|
|
art.on('video:playing', function () {
|
|
showPause();
|
|
});
|
|
art.on('video:pause', function () {
|
|
showPlay();
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function getPosFromEvent(art, event) {
|
|
var $progress = art.template.$progress,
|
|
player = art.player;
|
|
|
|
var _$progress$getBoundin = $progress.getBoundingClientRect(),
|
|
left = _$progress$getBoundin.left;
|
|
|
|
var width = clamp(event.pageX - left, 0, $progress.clientWidth);
|
|
var second = width / $progress.clientWidth * player.duration;
|
|
var time = secondToTime(second);
|
|
var percentage = clamp(width / $progress.clientWidth, 0, 1);
|
|
return {
|
|
second: second,
|
|
time: time,
|
|
width: width,
|
|
percentage: percentage
|
|
};
|
|
}
|
|
function progress(option) {
|
|
return function (art) {
|
|
var _art$option = art.option,
|
|
highlight = _art$option.highlight,
|
|
theme = _art$option.theme,
|
|
proxy = art.events.proxy,
|
|
player = art.player;
|
|
return _objectSpread$4({}, option, {
|
|
html: "\n <div class=\"art-control-progress-inner\">\n <div class=\"art-progress-loaded\"></div>\n <div class=\"art-progress-played\" style=\"background: ".concat(theme, "\"></div>\n <div class=\"art-progress-highlight\"></div>\n <div class=\"art-progress-indicator\" style=\"background: ").concat(theme, "\"></div>\n <div class=\"art-progress-tip art-tip\"></div>\n </div>\n "),
|
|
mounted: function mounted($control) {
|
|
var isDroging = false;
|
|
var $loaded = query('.art-progress-loaded', $control);
|
|
var $played = query('.art-progress-played', $control);
|
|
var $highlight = query('.art-progress-highlight', $control);
|
|
var $indicator = query('.art-progress-indicator', $control);
|
|
var $tip = query('.art-progress-tip', $control);
|
|
|
|
function showHighlight(event) {
|
|
var _getPosFromEvent = getPosFromEvent(art, event),
|
|
width = _getPosFromEvent.width;
|
|
|
|
var text = event.target.dataset.text;
|
|
$tip.innerHTML = text;
|
|
var tipWidth = $tip.clientWidth;
|
|
|
|
if (width <= tipWidth / 2) {
|
|
setStyle($tip, 'left', 0);
|
|
} else if (width > $control.clientWidth - tipWidth / 2) {
|
|
setStyle($tip, 'left', "".concat($control.clientWidth - tipWidth, "px"));
|
|
} else {
|
|
setStyle($tip, 'left', "".concat(width - tipWidth / 2, "px"));
|
|
}
|
|
}
|
|
|
|
function showTime(event) {
|
|
var _getPosFromEvent2 = getPosFromEvent(art, event),
|
|
width = _getPosFromEvent2.width,
|
|
time = _getPosFromEvent2.time;
|
|
|
|
$tip.innerHTML = time;
|
|
var tipWidth = $tip.clientWidth;
|
|
|
|
if (width <= tipWidth / 2) {
|
|
setStyle($tip, 'left', 0);
|
|
} else if (width > $control.clientWidth - tipWidth / 2) {
|
|
setStyle($tip, 'left', "".concat($control.clientWidth - tipWidth, "px"));
|
|
} else {
|
|
setStyle($tip, 'left', "".concat(width - tipWidth / 2, "px"));
|
|
}
|
|
}
|
|
|
|
function setBar(type, percentage) {
|
|
if (type === 'loaded') {
|
|
setStyle($loaded, 'width', "".concat(percentage * 100, "%"));
|
|
}
|
|
|
|
if (type === 'played') {
|
|
setStyle($played, 'width', "".concat(percentage * 100, "%"));
|
|
setStyle($indicator, 'left', "calc(".concat(percentage * 100, "% - ").concat(getStyle($indicator, 'width') / 2, "px)"));
|
|
}
|
|
}
|
|
|
|
highlight.forEach(function (item) {
|
|
var left = clamp(item.time, 0, player.duration) / player.duration * 100;
|
|
append($highlight, "<span data-text=\"".concat(item.text, "\" data-time=\"").concat(item.time, "\" style=\"left: ").concat(left, "%\"></span>"));
|
|
});
|
|
setBar('loaded', player.loaded);
|
|
art.on('video:progress', function () {
|
|
setBar('loaded', player.loaded);
|
|
});
|
|
art.on('video:timeupdate', function () {
|
|
setBar('played', player.played);
|
|
});
|
|
art.on('video:ended', function () {
|
|
setBar('played', 1);
|
|
});
|
|
proxy($control, 'mousemove', function (event) {
|
|
setStyle($tip, 'display', 'block');
|
|
|
|
if (event.composedPath().indexOf($highlight) > -1) {
|
|
showHighlight(event);
|
|
} else {
|
|
showTime(event);
|
|
}
|
|
});
|
|
proxy($control, 'mouseout', function () {
|
|
setStyle($tip, 'display', 'none');
|
|
});
|
|
proxy($control, 'click', function (event) {
|
|
if (event.target !== $indicator) {
|
|
var _getPosFromEvent3 = getPosFromEvent(art, event),
|
|
second = _getPosFromEvent3.second,
|
|
percentage = _getPosFromEvent3.percentage;
|
|
|
|
setBar('played', percentage);
|
|
player.seek = second;
|
|
}
|
|
});
|
|
proxy($indicator, 'mousedown', function () {
|
|
isDroging = true;
|
|
});
|
|
proxy(document, 'mousemove', function (event) {
|
|
if (isDroging) {
|
|
var _getPosFromEvent4 = getPosFromEvent(art, event),
|
|
second = _getPosFromEvent4.second,
|
|
percentage = _getPosFromEvent4.percentage;
|
|
|
|
addClass($indicator, 'art-show-indicator');
|
|
setBar('played', percentage);
|
|
player.seek = second;
|
|
}
|
|
});
|
|
proxy(document, 'mouseup', function () {
|
|
if (isDroging) {
|
|
isDroging = false;
|
|
removeClass($indicator, 'art-show-indicator');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function subtitle(option) {
|
|
return function (art) {
|
|
return _objectSpread$5({}, option, {
|
|
tooltip: art.i18n.get('Hide subtitle'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
subtitle = art.subtitle;
|
|
append($control, icons.subtitle);
|
|
proxy($control, 'click', function () {
|
|
subtitle.toggle = true;
|
|
});
|
|
art.on('subtitle:toggle', function (value) {
|
|
tooltip($control, i18n.get(value ? 'Hide subtitle' : 'Show subtitle'));
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function time(option) {
|
|
return function (art) {
|
|
return _objectSpread$6({}, option, {
|
|
mounted: function mounted($control) {
|
|
function getTime() {
|
|
var newTime = "".concat(secondToTime(art.player.currentTime), " / ").concat(secondToTime(art.player.duration));
|
|
|
|
if (newTime !== $control.innerText) {
|
|
$control.innerText = newTime;
|
|
}
|
|
}
|
|
|
|
getTime();
|
|
['video:loadedmetadata', 'video:timeupdate', 'video:progress'].forEach(function (event) {
|
|
art.on(event, getTime);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function volume(option) {
|
|
return function (art) {
|
|
return _objectSpread$7({}, option, {
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
player = art.player,
|
|
i18n = art.i18n;
|
|
var isDroging = false;
|
|
var $volume = append($control, icons.volume);
|
|
var $volumeClose = append($control, icons.volumeClose);
|
|
var $volumePanel = append($control, '<div class="art-volume-panel"></div>');
|
|
var $volumeHandle = append($volumePanel, '<div class="art-volume-slider-handle"></div>');
|
|
tooltip($volume, i18n.get('Mute'));
|
|
setStyle($volumeClose, 'display', 'none');
|
|
|
|
function volumeChangeFromEvent(event) {
|
|
var _$volumePanel$getBoun = $volumePanel.getBoundingClientRect(),
|
|
panelLeft = _$volumePanel$getBoun.left,
|
|
panelWidth = _$volumePanel$getBoun.width;
|
|
|
|
var _$volumeHandle$getBou = $volumeHandle.getBoundingClientRect(),
|
|
handleWidth = _$volumeHandle$getBou.width;
|
|
|
|
var percentage = clamp(event.pageX - panelLeft - handleWidth / 2, 0, panelWidth - handleWidth / 2) / (panelWidth - handleWidth);
|
|
return percentage;
|
|
}
|
|
|
|
function setVolumeHandle() {
|
|
var percentage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.7;
|
|
|
|
if (player.muted || percentage === 0) {
|
|
setStyle($volume, 'display', 'none');
|
|
setStyle($volumeClose, 'display', 'flex');
|
|
setStyle($volumeHandle, 'left', '0');
|
|
} else {
|
|
// TODO...
|
|
var panelWidth = getStyle($volumePanel, 'width') || 60;
|
|
var handleWidth = getStyle($volumeHandle, 'width');
|
|
var width = (panelWidth - handleWidth) * percentage;
|
|
setStyle($volume, 'display', 'flex');
|
|
setStyle($volumeClose, 'display', 'none');
|
|
setStyle($volumeHandle, 'left', "".concat(width, "px"));
|
|
}
|
|
}
|
|
|
|
setVolumeHandle(player.volume);
|
|
art.on('video:volumechange', function () {
|
|
setVolumeHandle(player.volume);
|
|
});
|
|
proxy($volume, 'click', function () {
|
|
player.muted = true;
|
|
});
|
|
proxy($volumeClose, 'click', function () {
|
|
player.muted = false;
|
|
});
|
|
proxy($volumePanel, 'click', function (event) {
|
|
player.muted = false;
|
|
player.volume = volumeChangeFromEvent(event);
|
|
});
|
|
proxy($volumeHandle, 'mousedown', function () {
|
|
isDroging = true;
|
|
});
|
|
proxy(document, 'mousemove', function (event) {
|
|
if (isDroging) {
|
|
player.muted = false;
|
|
player.volume = volumeChangeFromEvent(event);
|
|
}
|
|
});
|
|
proxy(document, 'mouseup', function () {
|
|
if (isDroging) {
|
|
isDroging = false;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function setting(option) {
|
|
return function (art) {
|
|
return _objectSpread$8({}, option, {
|
|
tooltip: art.i18n.get('Show setting'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
i18n = art.i18n,
|
|
setting = art.setting;
|
|
append($control, icons.setting);
|
|
proxy($control, 'click', function () {
|
|
setting.toggle = true;
|
|
});
|
|
art.on('setting:toggle', function (value) {
|
|
tooltip($control, i18n.get(value ? 'Hide setting' : 'Show setting'));
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$9(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function thumbnails(option) {
|
|
return function (art) {
|
|
return _objectSpread$9({}, option, {
|
|
mounted: function mounted($control) {
|
|
var thumbnails = art.option.thumbnails,
|
|
$progress = art.template.$progress,
|
|
_art$events = art.events,
|
|
proxy = _art$events.proxy,
|
|
loadImg = _art$events.loadImg;
|
|
var loading = false;
|
|
var isLoad = false;
|
|
|
|
function showThumbnails(event) {
|
|
var _getPosFromEvent = getPosFromEvent(art, event),
|
|
posWidth = _getPosFromEvent.width;
|
|
|
|
var url = thumbnails.url,
|
|
height = thumbnails.height,
|
|
width = thumbnails.width,
|
|
number = thumbnails.number,
|
|
column = thumbnails.column;
|
|
var perWidth = $progress.clientWidth / number;
|
|
var perIndex = Math.floor(posWidth / perWidth);
|
|
var yIndex = Math.ceil(perIndex / column) - 1;
|
|
var xIndex = perIndex % column || column - 1;
|
|
setStyle($control, 'backgroundImage', "url(".concat(url, ")"));
|
|
setStyle($control, 'height', "".concat(height, "px"));
|
|
setStyle($control, 'width', "".concat(width, "px"));
|
|
setStyle($control, 'backgroundPosition', "-".concat(xIndex * width, "px -").concat(yIndex * height, "px"));
|
|
|
|
if (posWidth <= width / 2) {
|
|
setStyle($control, 'left', 0);
|
|
} else if (posWidth > $progress.clientWidth - width / 2) {
|
|
setStyle($control, 'left', "".concat($progress.clientWidth - width, "px"));
|
|
} else {
|
|
setStyle($control, 'left', "".concat(posWidth - width / 2, "px"));
|
|
}
|
|
}
|
|
|
|
proxy($progress, 'mousemove', function (event) {
|
|
if (!loading) {
|
|
loading = true;
|
|
loadImg(thumbnails.url).then(function () {
|
|
isLoad = true;
|
|
});
|
|
}
|
|
|
|
if (isLoad) {
|
|
setStyle($control, 'display', 'block');
|
|
showThumbnails(event);
|
|
}
|
|
});
|
|
proxy($progress, 'mouseout', function () {
|
|
setStyle($control, 'display', 'none');
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$a(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function screenshot(option) {
|
|
return function (art) {
|
|
return _objectSpread$a({}, option, {
|
|
tooltip: art.i18n.get('Screenshot'),
|
|
mounted: function mounted($control) {
|
|
var proxy = art.events.proxy,
|
|
icons = art.icons,
|
|
player = art.player;
|
|
append($control, icons.screenshot);
|
|
proxy($control, 'click', function () {
|
|
player.screenshot();
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$b(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function quality(option) {
|
|
return function (art) {
|
|
return _objectSpread$b({}, option, {
|
|
mounted: function mounted($control) {
|
|
var quality = art.option.quality,
|
|
_art$events = art.events,
|
|
proxy = _art$events.proxy,
|
|
hover = _art$events.hover,
|
|
player = art.player;
|
|
var playIndex = -1;
|
|
var defaultQuality = quality.find(function (item) {
|
|
return item.default;
|
|
}) || quality[0];
|
|
playIndex = quality.indexOf(defaultQuality);
|
|
var $qualityName = append($control, "<div class=\"art-quality-name\">".concat(defaultQuality.name, "</div>"));
|
|
var qualityList = quality.map(function (item, index) {
|
|
return "<div class=\"art-quality-item\" data-index=\"".concat(index, "\">").concat(item.name, "</div>");
|
|
}).join('');
|
|
var $qualitys = append($control, "<div class=\"art-qualitys\">".concat(qualityList, "</div>"));
|
|
hover($control, function () {
|
|
$qualitys.style.left = "-".concat(getStyle($qualitys, 'width') / 2 - $control.clientWidth / 2, "px");
|
|
});
|
|
proxy($qualitys, 'click', function (event) {
|
|
var index = Number(event.target.dataset.index);
|
|
var _quality$index = quality[index],
|
|
url = _quality$index.url,
|
|
name = _quality$index.name;
|
|
|
|
if (url && name && playIndex !== index) {
|
|
player.switchQuality(url, name);
|
|
$qualityName.innerText = name;
|
|
playIndex = index;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
var Control =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Control, _Component);
|
|
|
|
function Control(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Control);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Control).call(this, art));
|
|
_this.name = 'control';
|
|
var option = art.option;
|
|
art.on('ready', function () {
|
|
_this.add(progress({
|
|
name: 'progress',
|
|
disable: option.isLive,
|
|
position: 'top',
|
|
index: 10
|
|
}));
|
|
|
|
_this.add(thumbnails({
|
|
name: 'thumbnails',
|
|
disable: !option.thumbnails.url || option.isLive,
|
|
position: 'top',
|
|
index: 20
|
|
}));
|
|
|
|
_this.add(playAndPause({
|
|
name: 'playAndPause',
|
|
disable: false,
|
|
position: 'left',
|
|
index: 10
|
|
}));
|
|
|
|
_this.add(volume({
|
|
name: 'volume',
|
|
disable: false,
|
|
position: 'left',
|
|
index: 20
|
|
}));
|
|
|
|
_this.add(time({
|
|
name: 'time',
|
|
disable: option.isLive,
|
|
position: 'left',
|
|
index: 30
|
|
}));
|
|
|
|
_this.add(quality({
|
|
name: 'quality',
|
|
disable: option.quality.length === 0,
|
|
position: 'right',
|
|
index: 10
|
|
}));
|
|
|
|
_this.add(screenshot({
|
|
name: 'screenshot',
|
|
disable: !option.screenshot,
|
|
position: 'right',
|
|
index: 20
|
|
}));
|
|
|
|
_this.add(subtitle({
|
|
name: 'subtitle',
|
|
disable: !option.subtitle.url,
|
|
position: 'right',
|
|
index: 30
|
|
}));
|
|
|
|
_this.add(setting({
|
|
name: 'setting',
|
|
disable: !option.setting,
|
|
position: 'right',
|
|
index: 40
|
|
}));
|
|
|
|
_this.add(pip({
|
|
name: 'pip',
|
|
disable: !option.pip,
|
|
position: 'right',
|
|
index: 50
|
|
}));
|
|
|
|
_this.add(fullscreenWeb({
|
|
name: 'fullscreenWeb',
|
|
disable: !option.fullscreenWeb,
|
|
position: 'right',
|
|
index: 60
|
|
}));
|
|
|
|
_this.add(fullscreen({
|
|
name: 'fullscreen',
|
|
disable: !option.fullscreen,
|
|
position: 'right',
|
|
index: 70
|
|
}));
|
|
|
|
option.controls.forEach(function (item) {
|
|
_this.add(item);
|
|
});
|
|
});
|
|
return _this;
|
|
}
|
|
|
|
createClass(Control, [{
|
|
key: "add",
|
|
value: function add(getOption, callback) {
|
|
var _this2 = this;
|
|
|
|
var option = typeof getOption === 'function' ? getOption(this.art) : getOption;
|
|
errorHandle(['top', 'left', 'right'].includes(option.position), "Control option.position must one of 'top', 'left', 'right'");
|
|
var _this$art$template = this.art.template,
|
|
$progress = _this$art$template.$progress,
|
|
$controlsLeft = _this$art$template.$controlsLeft,
|
|
$controlsRight = _this$art$template.$controlsRight;
|
|
|
|
switch (option.position) {
|
|
case 'top':
|
|
this.$parent = $progress;
|
|
break;
|
|
|
|
case 'left':
|
|
this.$parent = $controlsLeft;
|
|
break;
|
|
|
|
case 'right':
|
|
this.$parent = $controlsRight;
|
|
break;
|
|
}
|
|
|
|
get(getPrototypeOf(Control.prototype), "add", this).call(this, option, function ($ref) {
|
|
if (!option.disable && option.position !== 'top' && !($ref.firstElementChild && $ref.firstElementChild.tagName === 'I')) {
|
|
addClass($ref, 'art-control-onlyText');
|
|
}
|
|
|
|
if (callback) {
|
|
callback($ref, _this2, _this2.art);
|
|
}
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return Control;
|
|
}(Component);
|
|
|
|
function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$c(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function playbackRate(option) {
|
|
return function (art) {
|
|
var i18n = art.i18n,
|
|
player = art.player;
|
|
return _objectSpread$c({}, option, {
|
|
html: "".concat(i18n.get('Play speed'), ":\n <span data-rate=\"0.5\">0.5</span>\n <span data-rate=\"0.75\">0.75</span>\n <span data-rate=\"1.0\" class=\"art-current\">").concat(i18n.get('Normal'), "</span>\n <span data-rate=\"1.25\">1.25</span>\n <span data-rate=\"1.5\">1.5</span>\n <span data-rate=\"2.0\">2.0</span>\n "),
|
|
click: function click(contextmenu, event) {
|
|
var rate = event.target.dataset.rate;
|
|
|
|
if (rate) {
|
|
player.playbackRate = Number(rate);
|
|
contextmenu.show = false;
|
|
}
|
|
},
|
|
mounted: function mounted($menu) {
|
|
art.on('playbackRateChange', function (rate) {
|
|
var $current = queryAll('span', $menu).find(function (item) {
|
|
return Number(item.dataset.rate) === rate;
|
|
});
|
|
|
|
if ($current) {
|
|
inverseClass($current, 'art-current');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$d(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function aspectRatio(option) {
|
|
return function (art) {
|
|
var i18n = art.i18n,
|
|
player = art.player;
|
|
return _objectSpread$d({}, option, {
|
|
html: "".concat(i18n.get('Aspect ratio'), ":\n <span data-ratio=\"default\" class=\"art-current\">").concat(i18n.get('Default'), "</span>\n <span data-ratio=\"4:3\">4:3</span>\n <span data-ratio=\"16:9\">16:9</span>\n "),
|
|
click: function click(contextmenu, event) {
|
|
var ratio = event.target.dataset.ratio;
|
|
|
|
if (ratio) {
|
|
player.aspectRatio = ratio;
|
|
contextmenu.show = false;
|
|
}
|
|
},
|
|
mounted: function mounted($menu) {
|
|
art.on('aspectRatioChange', function (ratio) {
|
|
var $current = queryAll('span', $menu).find(function (item) {
|
|
return item.dataset.ratio === ratio;
|
|
});
|
|
|
|
if ($current) {
|
|
inverseClass($current, 'art-current');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$e(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function info(option) {
|
|
return function (art) {
|
|
return _objectSpread$e({}, option, {
|
|
html: art.i18n.get('Video info'),
|
|
click: function click(contextmenu) {
|
|
art.info.show = true;
|
|
contextmenu.show = false;
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$f(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function version(option) {
|
|
return _objectSpread$f({}, option, {
|
|
html: '<a href="https://artplayer.org" target="_blank">ArtPlayer 3.3.3</a>'
|
|
});
|
|
}
|
|
|
|
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$g(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function close(option) {
|
|
return function (art) {
|
|
return _objectSpread$g({}, option, {
|
|
html: art.i18n.get('Close'),
|
|
click: function click(contextmenu) {
|
|
contextmenu.show = false;
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
var Contextmenu =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Contextmenu, _Component);
|
|
|
|
function Contextmenu(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Contextmenu);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Contextmenu).call(this, art));
|
|
_this.name = 'contextmenu';
|
|
var option = art.option,
|
|
_art$template = art.template,
|
|
$player = _art$template.$player,
|
|
$contextmenu = _art$template.$contextmenu,
|
|
proxy = art.events.proxy;
|
|
_this.$parent = $contextmenu;
|
|
art.on('ready', function () {
|
|
_this.add(playbackRate({
|
|
disable: !option.playbackRate,
|
|
name: 'playbackRate',
|
|
index: 10
|
|
}));
|
|
|
|
_this.add(aspectRatio({
|
|
disable: !option.aspectRatio,
|
|
name: 'aspectRatio',
|
|
index: 20
|
|
}));
|
|
|
|
_this.add(info({
|
|
disable: false,
|
|
name: 'info',
|
|
index: 30
|
|
}));
|
|
|
|
_this.add(version({
|
|
disable: false,
|
|
name: 'version',
|
|
index: 40
|
|
}));
|
|
|
|
_this.add(close({
|
|
disable: false,
|
|
name: 'close',
|
|
index: 50
|
|
}));
|
|
|
|
option.contextmenu.forEach(function (item) {
|
|
_this.add(item);
|
|
});
|
|
proxy($player, 'contextmenu', function (event) {
|
|
event.preventDefault();
|
|
_this.show = true;
|
|
var mouseX = event.clientX;
|
|
var mouseY = event.clientY;
|
|
|
|
var _$player$getBoundingC = $player.getBoundingClientRect(),
|
|
cHeight = _$player$getBoundingC.height,
|
|
cWidth = _$player$getBoundingC.width,
|
|
cLeft = _$player$getBoundingC.left,
|
|
cTop = _$player$getBoundingC.top;
|
|
|
|
var _$contextmenu$getBoun = $contextmenu.getBoundingClientRect(),
|
|
mHeight = _$contextmenu$getBoun.height,
|
|
mWidth = _$contextmenu$getBoun.width;
|
|
|
|
var menuLeft = mouseX - cLeft;
|
|
var menuTop = mouseY - cTop;
|
|
|
|
if (mouseX + mWidth > cLeft + cWidth) {
|
|
menuLeft = cWidth - mWidth;
|
|
}
|
|
|
|
if (mouseY + mHeight > cTop + cHeight) {
|
|
menuTop = cHeight - mHeight;
|
|
}
|
|
|
|
setStyles($contextmenu, {
|
|
top: "".concat(menuTop, "px"),
|
|
left: "".concat(menuLeft, "px")
|
|
});
|
|
});
|
|
proxy($player, 'click', function (event) {
|
|
if (!event.composedPath().includes($contextmenu)) {
|
|
_this.show = false;
|
|
}
|
|
});
|
|
art.on('blur', function () {
|
|
_this.show = false;
|
|
});
|
|
});
|
|
return _this;
|
|
}
|
|
|
|
return Contextmenu;
|
|
}(Component);
|
|
|
|
var Info =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Info, _Component);
|
|
|
|
function Info(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Info);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Info).call(this, art));
|
|
_this.name = 'info';
|
|
var _art$template = art.template,
|
|
$infoPanel = _art$template.$infoPanel,
|
|
$infoClose = _art$template.$infoClose,
|
|
$video = _art$template.$video,
|
|
proxy = art.events.proxy;
|
|
proxy($infoClose, 'click', function () {
|
|
_this.show = false;
|
|
});
|
|
var timer = null;
|
|
var types = queryAll('[data-video]', $infoPanel);
|
|
art.on('destroy', function () {
|
|
clearTimeout(timer);
|
|
});
|
|
|
|
function loop() {
|
|
types.forEach(function (item) {
|
|
var value = $video[item.dataset.video];
|
|
item.innerText = typeof value === 'number' ? value.toFixed(2) : value;
|
|
});
|
|
timer = setTimeout(function () {
|
|
loop();
|
|
}, 1000);
|
|
}
|
|
|
|
art.on('info:toggle', function (value) {
|
|
clearTimeout(timer);
|
|
|
|
if (value) {
|
|
loop();
|
|
}
|
|
});
|
|
return _this;
|
|
}
|
|
|
|
return Info;
|
|
}(Component);
|
|
|
|
var Subtitle =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Subtitle, _Component);
|
|
|
|
function Subtitle(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Subtitle);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Subtitle).call(this, art));
|
|
_this.name = 'subtitle';
|
|
var proxy = art.events.proxy,
|
|
subtitle = art.option.subtitle,
|
|
$subtitle = art.template.$subtitle;
|
|
setStyles($subtitle, subtitle.style);
|
|
proxy(_this.textTrack, 'cuechange', _this.update.bind(assertThisInitialized(_this)));
|
|
|
|
if (subtitle.url) {
|
|
_this.init(subtitle.url);
|
|
}
|
|
|
|
return _this;
|
|
}
|
|
|
|
createClass(Subtitle, [{
|
|
key: "update",
|
|
value: function update() {
|
|
var $subtitle = this.art.template.$subtitle;
|
|
$subtitle.innerHTML = '';
|
|
|
|
if (this.activeCue) {
|
|
$subtitle.innerHTML = this.activeCue.text.split(/\r?\n/).map(function (item) {
|
|
return "<p>".concat(item, "</p>");
|
|
}).join('');
|
|
this.art.emit('subtitle:update', this.activeCue.text);
|
|
}
|
|
}
|
|
}, {
|
|
key: "switch",
|
|
value: function _switch(url, name, ext) {
|
|
var _this2 = this;
|
|
|
|
var _this$art = this.art,
|
|
i18n = _this$art.i18n,
|
|
notice = _this$art.notice;
|
|
return this.init(url, ext).then(function (subUrl) {
|
|
if (name) {
|
|
notice.show = "".concat(i18n.get('Switch subtitle'), ": ").concat(name);
|
|
}
|
|
|
|
_this2.art.emit('subtitle:switch', subUrl);
|
|
|
|
return subUrl;
|
|
});
|
|
}
|
|
}, {
|
|
key: "init",
|
|
value: function init(url, ext) {
|
|
var _this3 = this;
|
|
|
|
var _this$art2 = this.art,
|
|
notice = _this$art2.notice,
|
|
_this$art2$template = _this$art2.template,
|
|
$subtitle = _this$art2$template.$subtitle,
|
|
$track = _this$art2$template.$track;
|
|
return fetch(url).then(function (response) {
|
|
return response.text();
|
|
}).then(function (text) {
|
|
_this3.art.emit('subtitle:load', url);
|
|
|
|
switch (ext || getExt(url)) {
|
|
case 'srt':
|
|
return vttToBlob(srtToVtt(text));
|
|
|
|
case 'ass':
|
|
return vttToBlob(assToVtt(text));
|
|
|
|
case 'vtt':
|
|
return vttToBlob(text);
|
|
|
|
default:
|
|
return url;
|
|
}
|
|
}).then(function (subUrl) {
|
|
$subtitle.innerHTML = '';
|
|
if (_this3.url === subUrl) return subUrl;
|
|
URL.revokeObjectURL(_this3.url);
|
|
$track.src = subUrl;
|
|
return subUrl;
|
|
}).catch(function (err) {
|
|
notice.show = err;
|
|
|
|
_this3.art.emit('subtitle:err', err);
|
|
|
|
throw err;
|
|
});
|
|
}
|
|
}, {
|
|
key: "url",
|
|
get: function get() {
|
|
return this.art.template.$track.src;
|
|
}
|
|
}, {
|
|
key: "textTrack",
|
|
get: function get() {
|
|
return this.art.template.$video.textTracks[0];
|
|
}
|
|
}, {
|
|
key: "activeCue",
|
|
get: function get() {
|
|
return this.textTrack.activeCues[0];
|
|
}
|
|
}]);
|
|
|
|
return Subtitle;
|
|
}(Component);
|
|
|
|
function clickInit(art, events) {
|
|
var $player = art.template.$player;
|
|
events.proxy(document, ['click', 'contextmenu'], function (event) {
|
|
if (event.composedPath().indexOf($player) > -1) {
|
|
art.isFocus = true;
|
|
art.emit('focus');
|
|
} else {
|
|
art.isFocus = false;
|
|
art.emit('blur');
|
|
}
|
|
});
|
|
}
|
|
|
|
function hoverInit(art, events) {
|
|
var $player = art.template.$player;
|
|
events.hover($player, function () {
|
|
addClass($player, 'art-hover');
|
|
art.emit('hoverenter');
|
|
}, function () {
|
|
removeClass($player, 'art-hover');
|
|
art.emit('hoverleave');
|
|
});
|
|
}
|
|
|
|
function mousemoveInitInit(art, events) {
|
|
var _art$template = art.template,
|
|
$player = _art$template.$player,
|
|
$video = _art$template.$video,
|
|
player = art.player,
|
|
controls = art.controls;
|
|
var autoHide = debounce(function () {
|
|
addClass($player, 'art-hide-cursor');
|
|
removeClass($player, 'art-hover');
|
|
controls.show = false;
|
|
}, 3000);
|
|
art.on('hoverleave', function () {
|
|
if (player.playing) {
|
|
autoHide();
|
|
}
|
|
});
|
|
events.proxy($player, 'mousemove', function (event) {
|
|
autoHide.clearTimeout();
|
|
removeClass($player, 'art-hide-cursor');
|
|
controls.show = true;
|
|
|
|
if (!player.pip && player.playing && event.target === $video) {
|
|
autoHide();
|
|
}
|
|
|
|
art.emit('mousemove');
|
|
});
|
|
}
|
|
|
|
function resizeInit(art, events) {
|
|
var option = art.option,
|
|
player = art.player,
|
|
$player = art.template.$player;
|
|
var object = document.createElement('object');
|
|
object.setAttribute('aria-hidden', 'true');
|
|
object.setAttribute('tabindex', -1);
|
|
object.type = 'text/html';
|
|
object.data = 'about:blank';
|
|
var playerWidth = player.width;
|
|
var playerHeight = player.height;
|
|
var resizeFn = throttle(function () {
|
|
if (player.width !== playerWidth || player.height !== playerHeight) {
|
|
playerWidth = player.width;
|
|
playerHeight = player.height;
|
|
|
|
if (option.autoSize) {
|
|
if (!player.fullscreen && !player.fullscreenWeb && !player.pip) {
|
|
player.autoSize = true;
|
|
} else {
|
|
player.autoSize = false;
|
|
}
|
|
}
|
|
|
|
player.aspectRatioReset = true;
|
|
art.emit('resize', {
|
|
width: player.width,
|
|
height: player.height
|
|
});
|
|
}
|
|
}, 500);
|
|
events.proxy(object, 'load', function () {
|
|
events.proxy(object.contentDocument.defaultView, 'resize', resizeFn);
|
|
});
|
|
$player.appendChild(object);
|
|
}
|
|
|
|
var Events =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Events(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Events);
|
|
|
|
this.destroyEvents = [];
|
|
this.proxy = this.proxy.bind(this);
|
|
this.hover = this.hover.bind(this);
|
|
this.loadImg = this.loadImg.bind(this);
|
|
|
|
if (art.whitelist.state) {
|
|
art.on('ready', function () {
|
|
clickInit(art, _this);
|
|
hoverInit(art, _this);
|
|
mousemoveInitInit(art, _this);
|
|
resizeInit(art, _this);
|
|
});
|
|
}
|
|
}
|
|
|
|
createClass(Events, [{
|
|
key: "proxy",
|
|
value: function proxy(target, name, callback) {
|
|
var _this2 = this;
|
|
|
|
var option = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
|
|
if (Array.isArray(name)) {
|
|
return name.map(function (item) {
|
|
return _this2.proxy(target, item, callback, option);
|
|
});
|
|
}
|
|
|
|
target.addEventListener(name, callback, option);
|
|
|
|
var destroy = function destroy() {
|
|
return target.removeEventListener(name, callback, option);
|
|
};
|
|
|
|
this.destroyEvents.push(destroy);
|
|
return destroy;
|
|
}
|
|
}, {
|
|
key: "hover",
|
|
value: function hover(target, mouseenter, mouseleave) {
|
|
if (mouseenter) {
|
|
this.proxy(target, 'mouseenter', mouseenter);
|
|
}
|
|
|
|
if (mouseleave) {
|
|
this.proxy(target, 'mouseleave', mouseleave);
|
|
}
|
|
}
|
|
}, {
|
|
key: "loadImg",
|
|
value: function loadImg(img) {
|
|
var _this3 = this;
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
var image;
|
|
|
|
if (img instanceof HTMLImageElement) {
|
|
image = img;
|
|
} else if (typeof img === 'string') {
|
|
image = new Image();
|
|
image.src = img;
|
|
} else {
|
|
return reject(img);
|
|
}
|
|
|
|
if (image.complete) {
|
|
return resolve(image);
|
|
}
|
|
|
|
_this3.proxy(image, 'load', function () {
|
|
return resolve(image);
|
|
});
|
|
|
|
_this3.proxy(image, 'error', function () {
|
|
return reject(image);
|
|
});
|
|
|
|
return img;
|
|
});
|
|
}
|
|
}, {
|
|
key: "destroy",
|
|
value: function destroy() {
|
|
this.destroyEvents.forEach(function (event) {
|
|
return event();
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return Events;
|
|
}();
|
|
|
|
var Hotkey =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Hotkey(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Hotkey);
|
|
|
|
this.keys = {};
|
|
var option = art.option,
|
|
player = art.player,
|
|
proxy = art.events.proxy;
|
|
|
|
if (option.hotkey) {
|
|
art.on('ready', function () {
|
|
_this.add(27, function () {
|
|
if (player.fullscreenWeb) {
|
|
player.fullscreenWeb = false;
|
|
}
|
|
});
|
|
|
|
_this.add(32, function () {
|
|
player.toggle = true;
|
|
});
|
|
|
|
_this.add(37, function () {
|
|
player.seek = player.currentTime - 5;
|
|
});
|
|
|
|
_this.add(38, function () {
|
|
player.volume += 0.1;
|
|
});
|
|
|
|
_this.add(39, function () {
|
|
player.seek = player.currentTime + 5;
|
|
});
|
|
|
|
_this.add(40, function () {
|
|
player.volume -= 0.1;
|
|
});
|
|
|
|
proxy(window, 'keydown', function (event) {
|
|
if (art.isFocus) {
|
|
var tag = document.activeElement.tagName.toUpperCase();
|
|
var editable = document.activeElement.getAttribute('contenteditable');
|
|
|
|
if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {
|
|
var events = _this.keys[event.keyCode];
|
|
|
|
if (events) {
|
|
event.preventDefault();
|
|
events.forEach(function (fn) {
|
|
return fn();
|
|
});
|
|
art.emit('hotkey', event);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
createClass(Hotkey, [{
|
|
key: "add",
|
|
value: function add(key, event) {
|
|
if (this.keys[key]) {
|
|
this.keys[key].push(event);
|
|
} else {
|
|
this.keys[key] = [event];
|
|
}
|
|
}
|
|
}]);
|
|
|
|
return Hotkey;
|
|
}();
|
|
|
|
var Layer =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Layer, _Component);
|
|
|
|
function Layer(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Layer);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Layer).call(this, art));
|
|
_this.name = 'layer';
|
|
_this.$parent = art.template.$layer;
|
|
art.on('ready', function () {
|
|
art.option.layers.forEach(function (item) {
|
|
_this.add(item);
|
|
});
|
|
});
|
|
return _this;
|
|
}
|
|
|
|
return Layer;
|
|
}(Component);
|
|
|
|
var Loading =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Loading, _Component);
|
|
|
|
function Loading(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Loading);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Loading).call(this, art));
|
|
_this.name = 'loading';
|
|
append(art.template.$loading, art.icons.loading);
|
|
return _this;
|
|
}
|
|
|
|
return Loading;
|
|
}(Component);
|
|
|
|
var Notice =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Notice(art) {
|
|
classCallCheck(this, Notice);
|
|
|
|
this.art = art;
|
|
this.time = 2000;
|
|
this.timer = null;
|
|
}
|
|
|
|
createClass(Notice, [{
|
|
key: "show",
|
|
set: function set(msg) {
|
|
var _this$art$template = this.art.template,
|
|
$player = _this$art$template.$player,
|
|
$noticeInner = _this$art$template.$noticeInner;
|
|
$noticeInner.innerText = msg instanceof Error ? msg.message.trim() : msg;
|
|
addClass($player, 'art-notice-show');
|
|
clearTimeout(this.timer);
|
|
this.timer = setTimeout(function () {
|
|
$noticeInner.innerText = '';
|
|
removeClass($player, 'art-notice-show');
|
|
}, this.time);
|
|
}
|
|
}]);
|
|
|
|
return Notice;
|
|
}();
|
|
|
|
var Mask =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Mask, _Component);
|
|
|
|
function Mask(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Mask);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Mask).call(this, art));
|
|
_this.name = 'mask';
|
|
append(art.template.$state, art.icons.state);
|
|
return _this;
|
|
}
|
|
|
|
return Mask;
|
|
}(Component);
|
|
|
|
var loading = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50px\" height=\"50px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" class=\"uil-default\">\n <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"none\" class=\"bk\"/>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(0 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-1s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(30 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.9166666666666666s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(60 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.8333333333333334s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(90 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.75s\" repeatCount=\"indefinite\"/></rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(120 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.6666666666666666s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(150 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.5833333333333334s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(180 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.5s\" repeatCount=\"indefinite\"/></rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(210 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.4166666666666667s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(240 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.3333333333333333s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(270 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.25s\" repeatCount=\"indefinite\"/></rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(300 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.16666666666666666s\" repeatCount=\"indefinite\"/>\n </rect>\n <rect x=\"47\" y=\"40\" width=\"6\" height=\"20\" rx=\"5\" ry=\"5\" fill=\"#ffffff\" transform=\"rotate(330 50 50) translate(0 -30)\">\n <animate attributeName=\"opacity\" from=\"1\" to=\"0\" dur=\"1s\" begin=\"-0.08333333333333333s\" repeatCount=\"indefinite\"/>\n </rect>\n</svg>";
|
|
|
|
var state = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"60\" width=\"60\" style=\"filter: drop-shadow(0px 1px 1px black);\" viewBox=\"0 0 24 24\">\n <path d=\"M20,2H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6C24,3.8,22.2,2,20,2z M15.6,12.8L10.5,16 C9.9,16.5,9,16,9,15.2V8.8C9,8,9.9,7.5,10.5,8l5.1,3.2C16.3,11.5,16.3,12.5,15.6,12.8z\"/>\n</svg>";
|
|
|
|
var play = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 22 22\">\n <path d=\"M17.982 9.275L8.06 3.27A2.013 2.013 0 0 0 5 4.994v12.011a2.017 2.017 0 0 0 3.06 1.725l9.922-6.005a2.017 2.017 0 0 0 0-3.45z\"></path>\n</svg>";
|
|
|
|
var pause = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 22 22\">\n <path d=\"M7 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2zM15 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2z\"></path>\n</svg>";
|
|
|
|
var volume$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 22 22\">\n <path d=\"M10.188 4.65L6 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39V5.04a.498.498 0 0 0-.812-.39zM14.446 3.778a1 1 0 0 0-.862 1.804 6.002 6.002 0 0 1-.007 10.838 1 1 0 0 0 .86 1.806A8.001 8.001 0 0 0 19 11a8.001 8.001 0 0 0-4.554-7.222z\"></path>\n <path d=\"M15 11a3.998 3.998 0 0 0-2-3.465v6.93A3.998 3.998 0 0 0 15 11z\"></path>\n</svg>";
|
|
|
|
var volumeClose = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 22 22\">\n <path d=\"M15 11a3.998 3.998 0 0 0-2-3.465v2.636l1.865 1.865A4.02 4.02 0 0 0 15 11z\"></path>\n <path d=\"M13.583 5.583A5.998 5.998 0 0 1 17 11a6 6 0 0 1-.585 2.587l1.477 1.477a8.001 8.001 0 0 0-3.446-11.286 1 1 0 0 0-.863 1.805zM18.778 18.778l-2.121-2.121-1.414-1.414-1.415-1.415L13 13l-2-2-3.889-3.889-3.889-3.889a.999.999 0 1 0-1.414 1.414L5.172 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39v-3.131l2.587 2.587-.01.005a1 1 0 0 0 .86 1.806c.215-.102.424-.214.627-.333l2.3 2.3a1.001 1.001 0 0 0 1.414-1.416zM11 5.04a.5.5 0 0 0-.813-.39L8.682 5.854 11 8.172V5.04z\"></path>\n</svg>";
|
|
|
|
var subtitle$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 48 48\">\n <path d=\"M0 0h48v48H0z\" fill=\"none\"/>\n <path d=\"M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z\"/>\n</svg>";
|
|
|
|
var screenshot$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 50 50\">\n\t<path d=\"M 19.402344 6 C 17.019531 6 14.96875 7.679688 14.5 10.011719 L 14.097656 12 L 9 12 C 6.238281 12 4 14.238281 4 17 L 4 38 C 4 40.761719 6.238281 43 9 43 L 41 43 C 43.761719 43 46 40.761719 46 38 L 46 17 C 46 14.238281 43.761719 12 41 12 L 35.902344 12 L 35.5 10.011719 C 35.03125 7.679688 32.980469 6 30.597656 6 Z M 25 17 C 30.519531 17 35 21.480469 35 27 C 35 32.519531 30.519531 37 25 37 C 19.480469 37 15 32.519531 15 27 C 15 21.480469 19.480469 17 25 17 Z M 25 19 C 20.589844 19 17 22.589844 17 27 C 17 31.410156 20.589844 35 25 35 C 29.410156 35 33 31.410156 33 27 C 33 22.589844 29.410156 19 25 19 Z \"/>\n</svg>\n";
|
|
|
|
var setting$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"22\" width=\"22\" viewBox=\"0 0 22 22\">\n <circle cx=\"11\" cy=\"11\" r=\"2\"></circle>\n <path d=\"M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z\"></path>\n</svg>";
|
|
|
|
var fullscreen$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"36\" width=\"36\" viewBox=\"0 0 36 36\">\n\t<path d=\"m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z\"></path>\n\t<path d=\"m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z\"></path>\n\t<path d=\"m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z\"></path>\n\t<path d=\"M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z\"></path>\n</svg>";
|
|
|
|
var fullscreenWeb$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" height=\"36\" width=\"36\">\n\t<path d=\"m 28,11 0,14 -20,0 0,-14 z m -18,2 16,0 0,10 -16,0 0,-10 z\" fill-rule=\"evenodd\"></path>\n</svg>";
|
|
|
|
var pip$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" height=\"32\" width=\"32\">\n <path d=\"M25,17 L17,17 L17,23 L25,23 L25,17 L25,17 Z M29,25 L29,10.98 C29,9.88 28.1,9 27,9 L9,9 C7.9,9 7,9.88 7,10.98 L7,25 C7,26.1 7.9,27 9,27 L27,27 C28.1,27 29,26.1 29,25 L29,25 Z M27,25.02 L9,25.02 L9,10.97 L27,10.97 L27,25.02 L27,25.02 Z\"></path>\n</svg>";
|
|
|
|
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
var Icons = function Icons(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Icons);
|
|
|
|
var icons = _objectSpread$h({
|
|
loading: loading,
|
|
state: state,
|
|
play: play,
|
|
pause: pause,
|
|
volume: volume$1,
|
|
volumeClose: volumeClose,
|
|
subtitle: subtitle$1,
|
|
screenshot: screenshot$1,
|
|
setting: setting$1,
|
|
fullscreen: fullscreen$1,
|
|
fullscreenWeb: fullscreenWeb$1,
|
|
pip: pip$1
|
|
}, art.option.icons);
|
|
|
|
Object.keys(icons).forEach(function (key) {
|
|
var icon = document.createElement('i');
|
|
icon.classList.add('art-icon');
|
|
icon.classList.add("art-icon-".concat(key));
|
|
append(icon, icons[key]);
|
|
_this[key] = icon;
|
|
});
|
|
};
|
|
|
|
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$i(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function flip(option) {
|
|
return function (art) {
|
|
var i18n = art.i18n,
|
|
player = art.player;
|
|
return _objectSpread$i({}, option, {
|
|
html: "\n <div class=\"art-setting-header\">".concat(i18n.get('Flip'), "</div>\n <div class=\"art-setting-radio\">\n <div class=\"art-radio-item current\">\n <button type=\"button\" data-value=\"normal\">").concat(i18n.get('Normal'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"horizontal\">").concat(i18n.get('Horizontal'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"vertical\">").concat(i18n.get('Vertical'), "</button>\n </div>\n </div>\n "),
|
|
click: function click(setting, event) {
|
|
var value = event.target.dataset.value;
|
|
|
|
if (value) {
|
|
player.flip = value;
|
|
}
|
|
},
|
|
mounted: function mounted($setting) {
|
|
art.on('flipChange', function (flip) {
|
|
var $current = queryAll('button', $setting).find(function (item) {
|
|
return item.dataset.value === flip;
|
|
});
|
|
|
|
if ($current) {
|
|
inverseClass($current.parentElement, 'current');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$j(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function aspectRatio$1(option) {
|
|
return function (art) {
|
|
var i18n = art.i18n,
|
|
player = art.player;
|
|
return _objectSpread$j({}, option, {
|
|
html: "\n <div class=\"art-setting-header\">".concat(i18n.get('Aspect ratio'), "</div>\n <div class=\"art-setting-radio\">\n <div class=\"art-radio-item current\">\n <button type=\"button\" data-value=\"default\">").concat(i18n.get('Default'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"4:3\">4:3</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"16:9\">16:9</button>\n </div>\n </div>\n "),
|
|
click: function click(setting, event) {
|
|
var value = event.target.dataset.value;
|
|
|
|
if (value) {
|
|
player.aspectRatio = value;
|
|
}
|
|
},
|
|
mounted: function mounted($setting) {
|
|
art.on('aspectRatioChange', function (ratio) {
|
|
var $current = queryAll('button', $setting).find(function (item) {
|
|
return item.dataset.value === ratio;
|
|
});
|
|
|
|
if ($current) {
|
|
inverseClass($current.parentElement, 'current');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$k(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
function playbackRate$1(option) {
|
|
return function (art) {
|
|
var i18n = art.i18n,
|
|
player = art.player,
|
|
proxy = art.events.proxy;
|
|
return _objectSpread$k({}, option, {
|
|
html: "\n <div class=\"art-setting-header\">\n ".concat(i18n.get('Play speed'), ": <span class=\"art-subtitle-value\">1.0</span>x\n </div>\n <div class=\"art-setting-range\">\n <input class=\"art-subtitle-range\" value=\"1\" type=\"range\" min=\"0.5\" max=\"2\" step=\"0.25\">\n </div>\n "),
|
|
mounted: function mounted($setting) {
|
|
var $range = query('.art-setting-range input', $setting);
|
|
var $value = query('.art-subtitle-value', $setting);
|
|
proxy($range, 'change', function () {
|
|
var value = $range.value;
|
|
$value.innerText = value;
|
|
player.playbackRate = Number(value);
|
|
});
|
|
art.on('playbackRateChange', function (rate) {
|
|
if ($range.value !== rate) {
|
|
$range.value = rate;
|
|
$value.innerText = rate;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
|
|
var Setting =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
inherits(Setting, _Component);
|
|
|
|
function Setting(art) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Setting);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Setting).call(this, art));
|
|
_this.name = 'setting';
|
|
var option = art.option,
|
|
_art$template = art.template,
|
|
$setting = _art$template.$setting,
|
|
$settingBody = _art$template.$settingBody,
|
|
proxy = art.events.proxy;
|
|
_this.$parent = $settingBody;
|
|
|
|
if (option.setting) {
|
|
art.on('ready', function () {
|
|
proxy($setting, 'click', function (e) {
|
|
if (e.target === $setting) {
|
|
_this.show = false;
|
|
}
|
|
});
|
|
|
|
_this.add(flip({
|
|
disable: !option.flip,
|
|
name: 'flip'
|
|
}));
|
|
|
|
_this.add(aspectRatio$1({
|
|
disable: !option.aspectRatio,
|
|
name: 'aspectRatio'
|
|
}));
|
|
|
|
_this.add(playbackRate$1({
|
|
disable: !option.playbackRate,
|
|
name: 'playbackRate'
|
|
}));
|
|
});
|
|
art.on('blur', function () {
|
|
_this.show = false;
|
|
});
|
|
}
|
|
|
|
return _this;
|
|
}
|
|
|
|
return Setting;
|
|
}(Component);
|
|
|
|
var Storage =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Storage() {
|
|
classCallCheck(this, Storage);
|
|
|
|
this.name = 'artplayer_settings';
|
|
}
|
|
|
|
createClass(Storage, [{
|
|
key: "get",
|
|
value: function get(key) {
|
|
var storage = JSON.parse(localStorage.getItem(this.name)) || {};
|
|
return key ? storage[key] : {};
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(key, value) {
|
|
var storage = Object.assign({}, this.get(), defineProperty({}, key, value));
|
|
localStorage.setItem(this.name, JSON.stringify(storage));
|
|
}
|
|
}, {
|
|
key: "del",
|
|
value: function del(key) {
|
|
var storage = this.get();
|
|
delete storage[key];
|
|
localStorage.setItem(this.name, JSON.stringify(storage));
|
|
}
|
|
}, {
|
|
key: "clean",
|
|
value: function clean() {
|
|
localStorage.removeItem(this.name);
|
|
}
|
|
}]);
|
|
|
|
return Storage;
|
|
}();
|
|
|
|
function settingMix(art) {
|
|
var i18n = art.i18n,
|
|
subtitle = art.subtitle,
|
|
proxy = art.events.proxy;
|
|
return {
|
|
title: 'Subtitle',
|
|
name: 'subtitleOffset',
|
|
index: 20,
|
|
html: "\n <div class=\"art-setting-header\">\n ".concat(i18n.get('Subtitle offset time'), ": <span class=\"art-subtitle-value\">0</span>s\n </div>\n <div class=\"art-setting-range\">\n <input class=\"art-subtitle-range\" value=\"0\" type=\"range\" min=\"-5\" max=\"5\" step=\"0.5\">\n </div>\n "),
|
|
mounted: function mounted($setting) {
|
|
var $range = query('.art-setting-range input', $setting);
|
|
var $value = query('.art-subtitle-value', $setting);
|
|
proxy($range, 'change', function () {
|
|
var value = $range.value;
|
|
$value.innerText = value;
|
|
art.plugins.subtitleOffset.offset(Number(value));
|
|
});
|
|
art.on('subtitle:switch', function () {
|
|
$range.value = 0;
|
|
$value.innerText = 0;
|
|
});
|
|
art.on('subtitleOffset', function (value) {
|
|
subtitle.update();
|
|
|
|
if ($range.value !== value) {
|
|
$range.value = value;
|
|
$value.innerText = value;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}
|
|
|
|
function subtitleOffset(art) {
|
|
var clamp = art.constructor.utils.clamp;
|
|
var setting = art.setting,
|
|
notice = art.notice,
|
|
template = art.template,
|
|
i18n = art.i18n,
|
|
player = art.player;
|
|
setting.add(settingMix);
|
|
var cuesCache = [];
|
|
art.on('subtitle:switch', function () {
|
|
cuesCache = [];
|
|
});
|
|
return {
|
|
name: 'subtitleOffset',
|
|
offset: function offset(value) {
|
|
if (template.$track && template.$track.track) {
|
|
var cues = Array.from(template.$track.track.cues);
|
|
var time = clamp(value, -5, 5);
|
|
cues.forEach(function (cue, index) {
|
|
if (!cuesCache[index]) {
|
|
cuesCache[index] = {
|
|
startTime: cue.startTime,
|
|
endTime: cue.endTime
|
|
};
|
|
}
|
|
|
|
cue.startTime = clamp(cuesCache[index].startTime + time, 0, player.duration);
|
|
cue.endTime = clamp(cuesCache[index].endTime + time, 0, player.duration);
|
|
});
|
|
notice.show = "".concat(i18n.get('Subtitle offset time'), ": ").concat(value, "s");
|
|
art.emit('subtitleOffset', value);
|
|
} else {
|
|
notice.show = "".concat(i18n.get('No subtitles found'));
|
|
art.emit('subtitleOffset', 0);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
function localVideo(art) {
|
|
var proxy = art.events.proxy,
|
|
template = art.template,
|
|
player = art.player,
|
|
option = art.option,
|
|
setting = art.setting,
|
|
i18n = art.i18n;
|
|
|
|
function loadVideo(file) {
|
|
if (file) {
|
|
var canPlayType = template.$video.canPlayType(file.type);
|
|
|
|
if (canPlayType === 'maybe' || canPlayType === 'probably') {
|
|
var url = URL.createObjectURL(file);
|
|
option.title = file.name;
|
|
player.switchUrl(url, file.name);
|
|
art.emit('localVideo', file);
|
|
} else {
|
|
errorHandle(false, 'Playback of this file format is not supported');
|
|
}
|
|
}
|
|
}
|
|
|
|
proxy(template.$player, 'dragover', function (e) {
|
|
e.preventDefault();
|
|
});
|
|
proxy(template.$player, 'drop', function (e) {
|
|
e.preventDefault();
|
|
var file = e.dataTransfer.files[0];
|
|
loadVideo(file);
|
|
});
|
|
|
|
function attach(target) {
|
|
var $input = append(target, '<input type="file">');
|
|
setStyle(target, 'position', 'relative');
|
|
setStyles($input, {
|
|
position: 'absolute',
|
|
width: '100%',
|
|
height: '100%',
|
|
left: '0',
|
|
top: '0',
|
|
opacity: '0'
|
|
});
|
|
proxy($input, 'change', function () {
|
|
var file = $input.files[0];
|
|
loadVideo(file);
|
|
});
|
|
}
|
|
|
|
art.on('ready', function () {
|
|
setting.add({
|
|
title: 'Local Video',
|
|
name: 'localVideo',
|
|
index: 30,
|
|
html: "\n <div class=\"art-setting-header\">\n ".concat(i18n.get('Local Video'), "\n </div>\n <div class=\"art-setting-upload\">\n <div class=\"art-upload-btn\">").concat(i18n.get('Open'), "</div>\n <div class=\"art-upload-value\"></div>\n </div>\n "),
|
|
mounted: function mounted($setting) {
|
|
var $btn = query('.art-upload-btn', $setting);
|
|
var $value = query('.art-upload-value', $setting);
|
|
art.on('localVideo', function (file) {
|
|
$value.textContent = file.name;
|
|
$value.title = file.name;
|
|
});
|
|
attach($btn);
|
|
}
|
|
});
|
|
});
|
|
return {
|
|
name: 'localVideo',
|
|
attach: attach
|
|
};
|
|
}
|
|
|
|
function localSubtitle(art) {
|
|
var proxy = art.events.proxy,
|
|
subtitle = art.subtitle,
|
|
setting = art.setting,
|
|
i18n = art.i18n;
|
|
|
|
function loadSubtitle(file) {
|
|
if (file) {
|
|
var type = getExt(file.name);
|
|
|
|
if (['ass', 'vtt', 'srt'].includes(type)) {
|
|
var url = URL.createObjectURL(file);
|
|
subtitle.switch(url, file.name, type);
|
|
art.emit('localSubtitle', file);
|
|
} else {
|
|
errorHandle(false, 'Only supports subtitle files in .ass, .vtt and .srt format');
|
|
}
|
|
}
|
|
}
|
|
|
|
function attach(target) {
|
|
var $input = append(target, '<input type="file">');
|
|
setStyle(target, 'position', 'relative');
|
|
setStyles($input, {
|
|
position: 'absolute',
|
|
width: '100%',
|
|
height: '100%',
|
|
left: '0',
|
|
top: '0',
|
|
opacity: '0'
|
|
});
|
|
proxy($input, 'change', function () {
|
|
var file = $input.files[0];
|
|
loadSubtitle(file);
|
|
});
|
|
}
|
|
|
|
art.on('ready', function () {
|
|
setting.add({
|
|
title: 'Local Subtitle',
|
|
name: 'localSubtitle',
|
|
index: 40,
|
|
html: "\n <div class=\"art-setting-header\">\n ".concat(i18n.get('Local Subtitle'), "\n </div>\n <div class=\"art-setting-upload\">\n <div class=\"art-upload-btn\">").concat(i18n.get('Open'), "</div>\n <div class=\"art-upload-value\"></div>\n </div>\n "),
|
|
mounted: function mounted($setting) {
|
|
var $btn = query('.art-upload-btn', $setting);
|
|
var $value = query('.art-upload-value', $setting);
|
|
art.on('localSubtitle', function (file) {
|
|
$value.textContent = file.name;
|
|
$value.title = file.name;
|
|
});
|
|
attach($btn);
|
|
}
|
|
});
|
|
});
|
|
return {
|
|
name: 'localSubtitle',
|
|
attach: attach
|
|
};
|
|
}
|
|
|
|
function miniProgressBar(art) {
|
|
var layers = art.layers,
|
|
player = art.player,
|
|
theme = art.option.theme;
|
|
layers.add({
|
|
name: 'miniProgressBar',
|
|
style: {
|
|
display: 'none',
|
|
position: 'absolute',
|
|
left: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
height: '2px',
|
|
background: theme
|
|
},
|
|
mounted: function mounted($progressBar) {
|
|
art.on('control:toggle', function (value) {
|
|
$progressBar.style.display = value ? 'none' : 'block';
|
|
});
|
|
art.on('destroy', function () {
|
|
$progressBar.style.display = 'none';
|
|
});
|
|
art.on('video:timeupdate', function () {
|
|
$progressBar.style.width = "".concat(player.played * 100, "%");
|
|
});
|
|
}
|
|
});
|
|
return {
|
|
name: 'miniProgressBar'
|
|
};
|
|
}
|
|
|
|
function networkMonitor(art) {
|
|
var sampleTime = 10000;
|
|
var waitTime = 0;
|
|
var playTime = 0;
|
|
var lastTime = 0;
|
|
var timer = null;
|
|
|
|
function resetTime() {
|
|
waitTime = 0;
|
|
playTime = 0;
|
|
lastTime = 0;
|
|
cancelAnimationFrame(timer);
|
|
timer = null;
|
|
}
|
|
|
|
function startTime() {
|
|
if (timer) return;
|
|
|
|
(function loop() {
|
|
if (art.isDestroy) return;
|
|
timer = requestAnimationFrame(function () {
|
|
var nowTime = Date.now();
|
|
|
|
if (lastTime) {
|
|
var diffTime = nowTime - lastTime;
|
|
playTime += diffTime;
|
|
|
|
if (!art.player.playing) {
|
|
waitTime += diffTime;
|
|
}
|
|
}
|
|
|
|
lastTime = nowTime;
|
|
art.emit('networkMonitor', waitTime / playTime);
|
|
|
|
if (playTime >= sampleTime) {
|
|
waitTime = 0;
|
|
playTime = 0;
|
|
}
|
|
|
|
loop();
|
|
});
|
|
})();
|
|
}
|
|
|
|
art.on('play', startTime);
|
|
art.on('pause', resetTime);
|
|
return {
|
|
name: 'networkMonitor',
|
|
reset: resetTime,
|
|
start: startTime,
|
|
sample: function sample(time) {
|
|
sampleTime = time;
|
|
}
|
|
};
|
|
}
|
|
|
|
var Plugins =
|
|
/*#__PURE__*/
|
|
function () {
|
|
function Plugins(art) {
|
|
var _this = this;
|
|
|
|
classCallCheck(this, Plugins);
|
|
|
|
this.art = art;
|
|
this.id = 0;
|
|
var option = art.option;
|
|
|
|
if (option.subtitle.url && option.subtitleOffset) {
|
|
this.add(subtitleOffset);
|
|
}
|
|
|
|
if (!option.isLive && option.miniProgressBar) {
|
|
this.add(miniProgressBar);
|
|
}
|
|
|
|
if (option.localVideo) {
|
|
this.add(localVideo);
|
|
}
|
|
|
|
if (option.localSubtitle) {
|
|
this.add(localSubtitle);
|
|
}
|
|
|
|
if (option.networkMonitor) {
|
|
this.add(networkMonitor);
|
|
}
|
|
|
|
art.option.plugins.forEach(function (plugin) {
|
|
_this.add(plugin);
|
|
});
|
|
}
|
|
|
|
createClass(Plugins, [{
|
|
key: "add",
|
|
value: function add(plugin) {
|
|
this.id += 1;
|
|
var result = plugin.call(this, this.art);
|
|
var pluginName = '';
|
|
|
|
if (result && result.name) {
|
|
pluginName = result.name;
|
|
} else if (plugin.name) {
|
|
pluginName = plugin.name;
|
|
} else {
|
|
pluginName = "plugin".concat(this.id);
|
|
}
|
|
|
|
errorHandle(!has$1(this, pluginName), "Cannot add a plugin that already has the same name: ".concat(pluginName));
|
|
Object.defineProperty(this, pluginName, {
|
|
value: result
|
|
});
|
|
this.art.emit('plugin:add', plugin);
|
|
return this;
|
|
}
|
|
}]);
|
|
|
|
return Plugins;
|
|
}();
|
|
|
|
var Mobile = function Mobile(art) {
|
|
classCallCheck(this, Mobile);
|
|
|
|
var option = art.option,
|
|
proxy = art.events.proxy,
|
|
$video = art.template.$video;
|
|
config.events.forEach(function (eventName) {
|
|
proxy($video, eventName, function (event) {
|
|
art.emit("video:".concat(event.type), event);
|
|
});
|
|
});
|
|
Object.keys(option.moreVideoAttr).forEach(function (key) {
|
|
$video[key] = option.moreVideoAttr[key];
|
|
});
|
|
|
|
if (option.muted) {
|
|
$video.muted = option.muted;
|
|
}
|
|
|
|
if (option.volume) {
|
|
$video.volume = clamp(option.volume, 0, 1);
|
|
}
|
|
|
|
if (option.poster) {
|
|
$video.poster = option.poster;
|
|
}
|
|
|
|
if (option.autoplay) {
|
|
$video.autoplay = option.autoplay;
|
|
}
|
|
|
|
$video.controls = true;
|
|
var typeName = option.type || getExt(option.url);
|
|
var typeCallback = option.customType[typeName];
|
|
|
|
if (typeName && typeCallback) {
|
|
typeCallback($video, option.url, art);
|
|
art.emit('customType', typeName);
|
|
} else {
|
|
$video.src = option.url;
|
|
art.emit('urlChange', $video.src);
|
|
}
|
|
};
|
|
|
|
var id = 0;
|
|
|
|
var Artplayer =
|
|
/*#__PURE__*/
|
|
function (_Emitter) {
|
|
inherits(Artplayer, _Emitter);
|
|
|
|
function Artplayer(option) {
|
|
var _this;
|
|
|
|
classCallCheck(this, Artplayer);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(Artplayer).call(this));
|
|
_this.option = optionValidator(mergeDeep(Artplayer.option, option), scheme);
|
|
_this.isFocus = false;
|
|
_this.isDestroy = false;
|
|
_this.whitelist = new Whitelist(assertThisInitialized(_this));
|
|
_this.template = new Template(assertThisInitialized(_this));
|
|
_this.events = new Events(assertThisInitialized(_this));
|
|
|
|
if (_this.whitelist.state) {
|
|
_this.storage = new Storage(assertThisInitialized(_this));
|
|
_this.icons = new Icons(assertThisInitialized(_this));
|
|
_this.i18n = new I18n(assertThisInitialized(_this));
|
|
_this.notice = new Notice(assertThisInitialized(_this));
|
|
_this.player = new Player(assertThisInitialized(_this));
|
|
_this.layers = new Layer(assertThisInitialized(_this));
|
|
_this.controls = new Control(assertThisInitialized(_this));
|
|
_this.contextmenu = new Contextmenu(assertThisInitialized(_this));
|
|
_this.subtitle = new Subtitle(assertThisInitialized(_this));
|
|
_this.info = new Info(assertThisInitialized(_this));
|
|
_this.loading = new Loading(assertThisInitialized(_this));
|
|
_this.hotkey = new Hotkey(assertThisInitialized(_this));
|
|
_this.mask = new Mask(assertThisInitialized(_this));
|
|
_this.setting = new Setting(assertThisInitialized(_this));
|
|
_this.plugins = new Plugins(assertThisInitialized(_this));
|
|
} else {
|
|
_this.mobile = new Mobile(assertThisInitialized(_this));
|
|
}
|
|
|
|
id += 1;
|
|
_this.id = id;
|
|
Artplayer.instances.push(assertThisInitialized(_this));
|
|
return _this;
|
|
}
|
|
|
|
createClass(Artplayer, [{
|
|
key: "destroy",
|
|
value: function destroy() {
|
|
var removeHtml = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
this.events.destroy();
|
|
this.template.destroy(removeHtml);
|
|
Artplayer.instances.splice(Artplayer.instances.indexOf(this), 1);
|
|
this.isDestroy = true;
|
|
this.emit('destroy');
|
|
}
|
|
}], [{
|
|
key: "version",
|
|
get: function get() {
|
|
return '3.3.3';
|
|
}
|
|
}, {
|
|
key: "env",
|
|
get: function get() {
|
|
return '"development"';
|
|
}
|
|
}, {
|
|
key: "config",
|
|
get: function get() {
|
|
return config;
|
|
}
|
|
}, {
|
|
key: "utils",
|
|
get: function get() {
|
|
return utils;
|
|
}
|
|
}, {
|
|
key: "scheme",
|
|
get: function get() {
|
|
return scheme;
|
|
}
|
|
}, {
|
|
key: "Emitter",
|
|
get: function get() {
|
|
return Emitter;
|
|
}
|
|
}, {
|
|
key: "validator",
|
|
get: function get() {
|
|
return optionValidator;
|
|
}
|
|
}, {
|
|
key: "kindOf",
|
|
get: function get() {
|
|
return optionValidator.kindOf;
|
|
}
|
|
}, {
|
|
key: "option",
|
|
get: function get() {
|
|
return {
|
|
container: '#artplayer',
|
|
url: '',
|
|
poster: '',
|
|
title: '',
|
|
theme: '#f00',
|
|
volume: 0.7,
|
|
isLive: false,
|
|
muted: false,
|
|
autoplay: false,
|
|
autoSize: false,
|
|
loop: false,
|
|
flip: false,
|
|
playbackRate: false,
|
|
aspectRatio: false,
|
|
screenshot: false,
|
|
setting: false,
|
|
hotkey: true,
|
|
pip: false,
|
|
mutex: true,
|
|
backdrop: true,
|
|
fullscreen: false,
|
|
fullscreenWeb: false,
|
|
subtitleOffset: false,
|
|
miniProgressBar: false,
|
|
localVideo: false,
|
|
localSubtitle: false,
|
|
autoPip: false,
|
|
networkMonitor: false,
|
|
layers: [],
|
|
contextmenu: [],
|
|
quality: [],
|
|
controls: [],
|
|
highlight: [],
|
|
plugins: [],
|
|
whitelist: [],
|
|
thumbnails: {
|
|
url: '',
|
|
number: 60,
|
|
width: 160,
|
|
height: 90,
|
|
column: 10
|
|
},
|
|
subtitle: {
|
|
url: '',
|
|
style: {}
|
|
},
|
|
moreVideoAttr: {
|
|
controls: false,
|
|
preload: 'metadata'
|
|
},
|
|
icons: {},
|
|
customType: {},
|
|
lang: navigator.language.toLowerCase()
|
|
};
|
|
}
|
|
}]);
|
|
|
|
return Artplayer;
|
|
}(Emitter);
|
|
|
|
Object.defineProperty(Artplayer, 'instances', {
|
|
value: []
|
|
}); // eslint-disable-next-line no-console
|
|
|
|
console.log('%c ArtPlayer %c 3.3.3 %c https://artplayer.org', 'color: #fff; background: #5f5f5f', 'color: #fff; background: #4bc729', '');
|
|
|
|
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$l(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
var ArtplayerReact =
|
|
/*#__PURE__*/
|
|
function (_React$Component) {
|
|
inherits(ArtplayerReact, _React$Component);
|
|
|
|
function ArtplayerReact(props) {
|
|
var _this;
|
|
|
|
classCallCheck(this, ArtplayerReact);
|
|
|
|
_this = possibleConstructorReturn(this, getPrototypeOf(ArtplayerReact).call(this, props));
|
|
Artplayer.utils.errorHandle(props.option && _typeof_1(props.option) === 'object', "The prop 'option' object cannot be missing");
|
|
_this.instance = null;
|
|
_this.artRef = react.createRef();
|
|
return _this;
|
|
}
|
|
|
|
createClass(ArtplayerReact, [{
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
var _this$props = this.props,
|
|
option = _this$props.option,
|
|
getInstance = _this$props.getInstance;
|
|
this.instance = new Artplayer(_objectSpread$l({}, option, {
|
|
container: this.artRef.current
|
|
}));
|
|
|
|
if (getInstance && typeof getInstance === 'function') {
|
|
getInstance(this.instance);
|
|
}
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
if (this.instance && this.instance.destroy) {
|
|
this.instance.destroy();
|
|
}
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
var _this$props2 = this.props,
|
|
option = _this$props2.option,
|
|
getInstance = _this$props2.getInstance,
|
|
rest = objectWithoutProperties(_this$props2, ["option", "getInstance"]);
|
|
|
|
return react.createElement('div', _objectSpread$l({
|
|
ref: this.artRef
|
|
}, rest));
|
|
}
|
|
}]);
|
|
|
|
return ArtplayerReact;
|
|
}(react.Component);
|
|
|
|
return ArtplayerReact;
|
|
|
|
})));
|
|
//# sourceMappingURL=artplayer-react.js.map
|