From b74ff6052c850e059005f6284773426f345b1ff5 Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Fri, 12 Oct 2018 12:33:50 +0800 Subject: [PATCH] add errorHandle --- docs/js/artplayer.js | 10 ++++------ docs/js/artplayer.js.map | 2 +- src/player.js | 7 +------ src/utils/verification.js | 22 +++++++++++++++++----- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/docs/js/artplayer.js b/docs/js/artplayer.js index 12194fb3a..0d19d08ff 100644 --- a/docs/js/artplayer.js +++ b/docs/js/artplayer.js @@ -225,11 +225,12 @@ errorHandle(option.container, '\'container\' option is required.'); errorHandle(option.url, '\'url\' option is required.'); errorHandle(option.container instanceof Element, "'container' option require 'Element' type, but got '".concat(_typeof_1(option.container), "'.")); - errorHandle(typeof option.url === 'string' || Array.isArray(option.url), "'url' option require 'string' or 'array' type, but got '".concat(_typeof_1(option.url), "'.")); - errorHandle(typeof option.poster === 'string', "'url' option require 'string' type, but got '".concat(_typeof_1(option.poster), "'.")); + errorHandle(typeof option.url === 'string', "'url' option require 'string' type, but got '".concat(_typeof_1(option.url), "'.")); + errorHandle(typeof option.poster === 'string', "'poster' option require 'string' type, but got '".concat(_typeof_1(option.poster), "'.")); errorHandle(typeof option.volume === 'number', "'volume' option require 'number' type, but got '".concat(_typeof_1(option.volume), "'.")); errorHandle(typeof option.autoplay === 'boolean', "'autoplay' option require 'boolean' type, but got '".concat(_typeof_1(option.autoplay), "'.")); errorHandle(['none', 'metadata', 'auto'].indexOf(option.preload) > -1, '\'preload\' option require one of \'none、metadata、auto\'.'); + errorHandle(typeof option.lang === 'string', "'lang' option require 'string' type, but got '".concat(_typeof_1(option.lang), "'.")); } function E () { @@ -381,10 +382,7 @@ $video.volume = clamp(option.volume, 0, 1); $video.autoplay = option.autoplay; $video.preload = option.preload; - - if (typeof option.url === 'string') { - $video.src = option.url; - } else if (Array.isArray(option.url)) ; + $video.src = option.url; } }]); diff --git a/docs/js/artplayer.js.map b/docs/js/artplayer.js.map index f82bb6979..9ac7a70d4 100644 --- a/docs/js/artplayer.js.map +++ b/docs/js/artplayer.js.map @@ -1 +1 @@ -{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/ArtPlayerError.js","../../src/utils/index.js","../../src/utils/verification.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n/zh-CN.js","../../src/i18n/zh-TW.js","../../src/i18n/en.js","../../src/i18n/jp.js","../../src/i18n/index.js","../../src/player.js","../../src/controls/index.js","../../src/contextmenu.js","../../src/danmaku.js","../../src/info.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/index.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","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); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeFunction = require(\"./isNativeFunction\");\n\nvar construct = require(\"./construct\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;","export default class ArtPlayerError extends Error {\n constructor(message) {\n super(message);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'ArtPlayerError';\n }\n}\n","import ArtPlayerError from './ArtPlayerError';\n\nexport function errorHandle(condition, msg) {\n if (!condition) {\n throw new ArtPlayerError(msg);\n }\n}\n\nexport function clamp(num, a, b) {\n return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));\n}\n","import { errorHandle } from './index';\n\nexport default function verification(option) {\n errorHandle(option.container, '\\'container\\' option is required.');\n\n errorHandle(option.url, '\\'url\\' option is required.');\n\n errorHandle(\n option.container instanceof Element,\n `'container' option require 'Element' type, but got '${typeof option.container}'.`\n );\n\n errorHandle(\n typeof option.url === 'string' || Array.isArray(option.url),\n `'url' option require 'string' or 'array' type, but got '${typeof option.url}'.`\n );\n\n errorHandle(\n typeof option.poster === 'string',\n `'url' option require 'string' type, but got '${typeof option.poster}'.`\n );\n\n errorHandle(\n typeof option.volume === 'number',\n `'volume' option require 'number' type, but got '${typeof option.volume}'.`\n );\n\n errorHandle(\n typeof option.autoplay === 'boolean',\n `'autoplay' option require 'boolean' type, but got '${typeof option.autoplay}'.`\n );\n\n errorHandle(\n ['none', 'metadata', 'auto'].indexOf(option.preload) > -1,\n '\\'preload\\' option require one of \\'none、metadata、auto\\'.'\n );\n}\n","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\n","export default class Template {\n constructor(art) {\n this.art = art;\n this.init();\n }\n\n init() {\n this.art.refs.$container.innerHTML = `\n
\n \n
\n
\n
\n
\n
\n `;\n this.art.refs.$wrap = this.art.refs.$container.querySelector(\n '.artplayer-wrap'\n );\n this.art.refs.$video = this.art.refs.$container.querySelector(\n '.artplayer-video'\n );\n this.art.refs.$controls = this.art.refs.$container.querySelector(\n '.artplayer-controls'\n );\n this.art.refs.$layers = this.art.refs.$container.querySelector(\n '.artplayer-layers'\n );\n this.art.refs.$loading = this.art.refs.$container.querySelector(\n '.artplayer-loading'\n );\n this.art.refs.$notice = this.art.refs.$container.querySelector(\n '.artplayer-notice'\n );\n }\n}\n","export default {\n \n}","export default {\n \n}","export default {\n \n}","export default {\n \n}","import ZHCN from './zh-CN';\nimport ZHTW from './zh-TW';\nimport EN from './en';\nimport JP from './jp';\n\nconst i18nMap = {\n zh: ZHCN,\n 'zh-cn': ZHCN,\n 'zh-tw': ZHTW,\n en: EN,\n jp: JP\n};\n\nexport default class I18n {\n constructor({ option }) {\n this.language = i18nMap[option.lang.toLowerCase()] || i18nMap.en;\n }\n\n get(key) {\n return this.language[key] || key;\n }\n}\n","import { clamp } from './utils';\n\nexport default class Player {\n constructor(art) {\n this.art = art;\n this.init();\n }\n\n init() {\n const { option } = this.art;\n const { $video } = this.art.refs;\n $video.controls = false;\n $video.poster = option.poster;\n $video.volume = clamp(option.volume, 0, 1);\n $video.autoplay = option.autoplay;\n $video.preload = option.preload;\n\n if (typeof option.url === 'string') {\n $video.src = option.url;\n } else if (Array.isArray(option.url)) {\n //\n }\n }\n}\n","export default class Controls {\n constructor({ option }) {\n //\n }\n}\n","export default class Contextmenu {\n constructor({ option }) {\n //\n }\n}\n","export default class Danmu {\n constructor({ option }) {\n //\n }\n}\n","export default class Info {\n constructor({ option }) {\n //\n }\n}\n","export default class Captions {\n constructor({ option }) {\n //\n }\n}\n","export default class Events {\n constructor({ option }) {\n //\n }\n}\n","export default class Hotkey {\n constructor({ option }) {\n //\n }\n}\n","import './style/index.scss';\nimport verification from './utils/verification';\nimport Emitter from 'tiny-emitter';\nimport Template from './template';\nimport I18n from './i18n';\nimport Player from './player';\nimport Controls from './controls';\nimport Contextmenu from './contextmenu';\nimport Danmaku from './danmaku';\nimport Info from './info';\nimport Subtitle from './subtitle';\nimport Events from './events';\nimport Hotkey from './hotkey';\n\nlet id = 0;\nexport const instances = [];\n\nclass Artplayer extends Emitter {\n constructor(option) {\n super();\n this.option = Object.assign({}, Artplayer.DEFAULTS, option);\n verification(this.option);\n this.init();\n }\n\n static get version() {\n return '__VERSION__';\n }\n\n static get DEFAULTS() {\n return {\n container: document.querySelector('.artplayer'),\n url: '',\n poster: '',\n volume: 0.7,\n autoplay: false,\n preload: 'auto',\n lang: navigator.language.toLowerCase()\n };\n }\n\n static use(plugin) {\n const installedPlugins = this.plugins || (this.plugins = []);\n if (installedPlugins.indexOf(plugin) > -1) {\n return this;\n }\n\n const args = Array.from(arguments).slice(1);\n args.unshift(this);\n if (typeof plugin.install === 'function') {\n plugin.install.apply(plugin, args);\n } else if (typeof plugin === 'function') {\n plugin.apply(null, args);\n }\n installedPlugins.push(plugin);\n return this;\n }\n\n init() {\n this.refs = {\n $container: this.option.container\n };\n\n this.destroyEvents = [];\n\n this.template = new Template(this);\n this.i18n = new I18n(this);\n this.player = new Player(this);\n this.controls = new Controls(this);\n this.contextmenu = new Contextmenu(this);\n this.danmaku = new Danmaku(this);\n this.subtitle = new Subtitle(this);\n this.info = new Info(this);\n this.events = new Events(this);\n this.hotkey = new Hotkey(this);\n\n this.id = id++;\n instances.push(this);\n }\n\n destroy() {\n this.destroyEvents.forEach(event => event.destroy());\n this.refs.container.innerHTML = '';\n instances.splice(instances.indexOf(this), 1);\n }\n}\n\nwindow.Artplayer = Artplayer;\nexport default Artplayer;\n"],"names":["_typeof","ArtPlayerError","message","Error","captureStackTrace","constructor","name","errorHandle","condition","msg","clamp","num","a","b","Math","max","min","verification","option","container","url","Element","Array","isArray","poster","volume","autoplay","indexOf","preload","Template","art","init","refs","$container","innerHTML","$wrap","querySelector","$video","$controls","$layers","$loading","$notice","i18nMap","zh","ZHCN","ZHTW","en","EN","jp","JP","I18n","language","lang","toLowerCase","key","Player","controls","src","Controls","Contextmenu","Danmu","Info","Captions","Events","Hotkey","id","instances","Artplayer","Object","assign","DEFAULTS","destroyEvents","template","i18n","player","contextmenu","danmaku","Danmaku","subtitle","Subtitle","info","events","hotkey","push","forEach","event","destroy","splice","plugin","installedPlugins","plugins","args","from","arguments","slice","unshift","install","apply","document","navigator","Emitter","window"],"mappings":";;;;;;EAAA,SAAS,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE;IAC9C,IAAI,EAAE,QAAQ,YAAY,WAAW,CAAC,EAAE;MACtC,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;KAC1D;GACF;;EAED,kBAAc,GAAG,eAAe;;ECNhC,SAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MACrC,IAAI,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;MAC1B,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAA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AL,GAAe,EAAhC,CAAzB;;EACA,UAAID,gBAAgB,CAAC9D,OAAjB,CAAyB6D,MAAzB,IAAmC,CAAC,CAAxC,EAA2C;EACzC,eAAO,IAAP;EACD;;EAED,UAAMG,IAAI,GAAGrE,KAAK,CAACsE,IAAN,CAAWC,SAAX,EAAsBC,KAAtB,CAA4B,CAA5B,CAAb;EACAH,MAAAA,IAAI,CAACI,OAAL,CAAa,IAAb;;EACA,UAAI,OAAOP,MAAM,CAACQ,OAAd,KAA0B,UAA9B,EAA0C;EACxCR,QAAAA,MAAM,CAACQ,OAAP,CAAeC,KAAf,CAAqBT,MAArB,EAA6BG,IAA7B;EACD,OAFD,MAEO,IAAI,OAAOH,MAAP,KAAkB,UAAtB,EAAkC;EACvCA,QAAAA,MAAM,CAACS,KAAP,CAAa,IAAb,EAAmBN,IAAnB;EACD;;EACDF,MAAAA,gBAAgB,CAACN,IAAjB,CAAsBK,MAAtB;EACA,aAAO,IAAP;EACD;;;0BA/BoB;EACnB,aAAO,OAAP;EACD;;;0BAEqB;EACpB,aAAO;EACLrE,QAAAA,SAAS,EAAE+E,QAAQ,CAAC9D,aAAT,CAAuB,YAAvB,CADN;EAELhB,QAAAA,GAAG,EAAE,EAFA;EAGLI,QAAAA,MAAM,EAAE,EAHH;EAILC,QAAAA,MAAM,EAAE,GAJH;EAKLC,QAAAA,QAAQ,EAAE,KALL;EAMLE,QAAAA,OAAO,EAAE,MANJ;EAOLwB,QAAAA,IAAI,EAAE+C,SAAS,CAAChD,QAAV,CAAmBE,WAAnB;EAPD,OAAP;EASD;;;;IAtBqB+C;;EAsExBC,MAAM,CAAClC,SAAP,GAAmBA,SAAnB;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/ArtPlayerError.js","../../src/utils/index.js","../../src/utils/verification.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n/zh-CN.js","../../src/i18n/zh-TW.js","../../src/i18n/en.js","../../src/i18n/jp.js","../../src/i18n/index.js","../../src/player.js","../../src/controls/index.js","../../src/contextmenu.js","../../src/danmaku.js","../../src/info.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/index.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","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); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeFunction = require(\"./isNativeFunction\");\n\nvar construct = require(\"./construct\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;","export default class ArtPlayerError extends Error {\n constructor(message) {\n super(message);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'ArtPlayerError';\n }\n}\n","import ArtPlayerError from './ArtPlayerError';\n\nexport function errorHandle(condition, msg) {\n if (!condition) {\n throw new ArtPlayerError(msg);\n }\n}\n\nexport function clamp(num, a, b) {\n return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));\n}\n","import { errorHandle } from './index';\n\nexport default function verification(option) {\n errorHandle(\n option.container,\n '\\'container\\' option is required.'\n );\n\n errorHandle(\n option.url,\n '\\'url\\' option is required.'\n );\n\n errorHandle(\n option.container instanceof Element,\n `'container' option require 'Element' type, but got '${typeof option.container}'.`\n );\n\n errorHandle(\n typeof option.url === 'string',\n `'url' option require 'string' type, but got '${typeof option.url}'.`\n );\n\n errorHandle(\n typeof option.poster === 'string',\n `'poster' option require 'string' type, but got '${typeof option.poster}'.`\n );\n\n errorHandle(\n typeof option.volume === 'number',\n `'volume' option require 'number' type, but got '${typeof option.volume}'.`\n );\n\n errorHandle(\n typeof option.autoplay === 'boolean',\n `'autoplay' option require 'boolean' type, but got '${typeof option.autoplay}'.`\n );\n\n errorHandle(\n ['none', 'metadata', 'auto'].indexOf(option.preload) > -1,\n '\\'preload\\' option require one of \\'none、metadata、auto\\'.'\n );\n\n errorHandle(\n typeof option.lang === 'string',\n `'lang' option require 'string' type, but got '${typeof option.lang}'.`\n );\n\n}\n","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\n","export default class Template {\n constructor(art) {\n this.art = art;\n this.init();\n }\n\n init() {\n this.art.refs.$container.innerHTML = `\n
\n \n
\n
\n
\n
\n
\n `;\n this.art.refs.$wrap = this.art.refs.$container.querySelector(\n '.artplayer-wrap'\n );\n this.art.refs.$video = this.art.refs.$container.querySelector(\n '.artplayer-video'\n );\n this.art.refs.$controls = this.art.refs.$container.querySelector(\n '.artplayer-controls'\n );\n this.art.refs.$layers = this.art.refs.$container.querySelector(\n '.artplayer-layers'\n );\n this.art.refs.$loading = this.art.refs.$container.querySelector(\n '.artplayer-loading'\n );\n this.art.refs.$notice = this.art.refs.$container.querySelector(\n '.artplayer-notice'\n );\n }\n}\n","export default {\n \n}","export default {\n \n}","export default {\n \n}","export default {\n \n}","import ZHCN from './zh-CN';\nimport ZHTW from './zh-TW';\nimport EN from './en';\nimport JP from './jp';\n\nconst i18nMap = {\n zh: ZHCN,\n 'zh-cn': ZHCN,\n 'zh-tw': ZHTW,\n en: EN,\n jp: JP\n};\n\nexport default class I18n {\n constructor({ option }) {\n this.language = i18nMap[option.lang.toLowerCase()] || i18nMap.en;\n }\n\n get(key) {\n return this.language[key] || key;\n }\n}\n","import { clamp } from './utils';\n\nexport default class Player {\n constructor(art) {\n this.art = art;\n this.init();\n }\n\n init() {\n const { option } = this.art;\n const { $video } = this.art.refs;\n $video.controls = false;\n $video.poster = option.poster;\n $video.volume = clamp(option.volume, 0, 1);\n $video.autoplay = option.autoplay;\n $video.preload = option.preload;\n $video.src = option.url;\n }\n}\n","export default class Controls {\n constructor({ option }) {\n //\n }\n}\n","export default class Contextmenu {\n constructor({ option }) {\n //\n }\n}\n","export default class Danmu {\n constructor({ option }) {\n //\n }\n}\n","export default class Info {\n constructor({ option }) {\n //\n }\n}\n","export default class Captions {\n constructor({ option }) {\n //\n }\n}\n","export default class Events {\n constructor({ option }) {\n //\n }\n}\n","export default class Hotkey {\n constructor({ option }) {\n //\n }\n}\n","import './style/index.scss';\nimport verification from './utils/verification';\nimport Emitter from 'tiny-emitter';\nimport Template from './template';\nimport I18n from './i18n';\nimport Player from './player';\nimport Controls from './controls';\nimport Contextmenu from './contextmenu';\nimport Danmaku from './danmaku';\nimport Info from './info';\nimport Subtitle from './subtitle';\nimport Events from './events';\nimport Hotkey from './hotkey';\n\nlet id = 0;\nexport const instances = [];\n\nclass Artplayer extends Emitter {\n constructor(option) {\n super();\n this.option = Object.assign({}, Artplayer.DEFAULTS, option);\n verification(this.option);\n this.init();\n }\n\n static get version() {\n return '__VERSION__';\n }\n\n static get DEFAULTS() {\n return {\n container: document.querySelector('.artplayer'),\n url: '',\n poster: '',\n volume: 0.7,\n autoplay: false,\n preload: 'auto',\n lang: navigator.language.toLowerCase()\n };\n }\n\n static use(plugin) {\n const installedPlugins = this.plugins || (this.plugins = []);\n if (installedPlugins.indexOf(plugin) > -1) {\n return this;\n }\n\n const args = Array.from(arguments).slice(1);\n args.unshift(this);\n if (typeof plugin.install === 'function') {\n plugin.install.apply(plugin, args);\n } else if (typeof plugin === 'function') {\n plugin.apply(null, args);\n }\n installedPlugins.push(plugin);\n return this;\n }\n\n init() {\n this.refs = {\n $container: this.option.container\n };\n\n this.destroyEvents = [];\n\n this.template = new Template(this);\n this.i18n = new I18n(this);\n this.player = new Player(this);\n this.controls = new Controls(this);\n this.contextmenu = new Contextmenu(this);\n this.danmaku = new Danmaku(this);\n this.subtitle = new Subtitle(this);\n this.info = new Info(this);\n this.events = new Events(this);\n this.hotkey = new Hotkey(this);\n\n this.id = id++;\n instances.push(this);\n }\n\n destroy() {\n this.destroyEvents.forEach(event => event.destroy());\n this.refs.container.innerHTML = '';\n instances.splice(instances.indexOf(this), 1);\n }\n}\n\nwindow.Artplayer = Artplayer;\nexport default Artplayer;\n"],"names":["_typeof","ArtPlayerError","message","Error","captureStackTrace","constructor","name","errorHandle","condition","msg","clamp","num","a","b","Math","max","min","verification","option","container","url","Element","poster","volume","autoplay","indexOf","preload","lang","Template","art","init","refs","$container","innerHTML","$wrap","querySelector","$video","$controls","$layers","$loading","$notice","i18nMap","zh","ZHCN","ZHTW","en","EN","jp","JP","I18n","language","toLowerCase","key","Player","controls","src","Controls","Contextmenu","Danmu","Info","Captions","Events","Hotkey","id","instances","Artplayer","Object","assign","DEFAULTS","destroyEvents","template","i18n","player","contextmenu","danmaku","Danmaku","subtitle","Subtitle","info","events","hotkey","push","forEach","event","destroy","splice","plugin","installedPlugins","plugins","args","Array","from","arguments","slice","unshift","install","apply","document","navigator","Emitter","window"],"mappings":";;;;;;EAAA,SAAS,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE;IAC9C,IAAI,EAAE,QAAQ,YAAY,WAAW,CAAC,EAAE;MACtC,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;KAC1D;GACF;;EAED,kBAAc,GAAG,eAAe;;ECNhC,SAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MACrC,IAAI,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;MAC1B,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;MACvD,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;MAC/B,IAAI,OAAO,IAAI,UAAU,EAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;MACtD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KAC3D;GACF;;EAED,SAAS,YAAY,C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CAAeC,KAAf,CAAqBV,MAArB,EAA6BG,IAA7B;EACD,OAFD,MAEO,IAAI,OAAOH,MAAP,KAAkB,UAAtB,EAAkC;EACvCA,QAAAA,MAAM,CAACU,KAAP,CAAa,IAAb,EAAmBP,IAAnB;EACD;;EACDF,MAAAA,gBAAgB,CAACN,IAAjB,CAAsBK,MAAtB;EACA,aAAO,IAAP;EACD;;;0BA/BoB;EACnB,aAAO,OAAP;EACD;;;0BAEqB;EACpB,aAAO;EACLnE,QAAAA,SAAS,EAAE8E,QAAQ,CAAC9D,aAAT,CAAuB,YAAvB,CADN;EAELf,QAAAA,GAAG,EAAE,EAFA;EAGLE,QAAAA,MAAM,EAAE,EAHH;EAILC,QAAAA,MAAM,EAAE,GAJH;EAKLC,QAAAA,QAAQ,EAAE,KALL;EAMLE,QAAAA,OAAO,EAAE,MANJ;EAOLC,QAAAA,IAAI,EAAEuE,SAAS,CAAChD,QAAV,CAAmBC,WAAnB;EAPD,OAAP;EASD;;;;IAtBqBgD;;EAsExBC,MAAM,CAACnC,SAAP,GAAmBA,SAAnB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/player.js b/src/player.js index 9f3f68c22..948cf4213 100644 --- a/src/player.js +++ b/src/player.js @@ -14,11 +14,6 @@ export default class Player { $video.volume = clamp(option.volume, 0, 1); $video.autoplay = option.autoplay; $video.preload = option.preload; - - if (typeof option.url === 'string') { - $video.src = option.url; - } else if (Array.isArray(option.url)) { - // - } + $video.src = option.url; } } diff --git a/src/utils/verification.js b/src/utils/verification.js index 781072f4a..77c498360 100644 --- a/src/utils/verification.js +++ b/src/utils/verification.js @@ -1,9 +1,15 @@ import { errorHandle } from './index'; export default function verification(option) { - errorHandle(option.container, '\'container\' option is required.'); + errorHandle( + option.container, + '\'container\' option is required.' + ); - errorHandle(option.url, '\'url\' option is required.'); + errorHandle( + option.url, + '\'url\' option is required.' + ); errorHandle( option.container instanceof Element, @@ -11,13 +17,13 @@ export default function verification(option) { ); errorHandle( - typeof option.url === 'string' || Array.isArray(option.url), - `'url' option require 'string' or 'array' type, but got '${typeof option.url}'.` + typeof option.url === 'string', + `'url' option require 'string' type, but got '${typeof option.url}'.` ); errorHandle( typeof option.poster === 'string', - `'url' option require 'string' type, but got '${typeof option.poster}'.` + `'poster' option require 'string' type, but got '${typeof option.poster}'.` ); errorHandle( @@ -34,4 +40,10 @@ export default function verification(option) { ['none', 'metadata', 'auto'].indexOf(option.preload) > -1, '\'preload\' option require one of \'none、metadata、auto\'.' ); + + errorHandle( + typeof option.lang === 'string', + `'lang' option require 'string' type, but got '${typeof option.lang}'.` + ); + }