diff --git a/lib/vue-aliplayer-v2.common.js b/lib/vue-aliplayer-v2.common.js index e849d8b..eef2e7d 100644 --- a/lib/vue-aliplayer-v2.common.js +++ b/lib/vue-aliplayer-v2.common.js @@ -142,18 +142,35 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7cfd"); -// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=3905f692& +// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=54014060& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=3905f692& +// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=54014060& +// CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.7.2@@babel/runtime/helpers/esm/typeof.js +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") { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); +} // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js var es6_regexp_to_string = __webpack_require__("cc1d"); // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=script&lang=js& + // // // @@ -178,13 +195,13 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); //css版本源 required: false, type: [String], - default: "https://g.alicdn.com/de/prismplayer/2.9.1/skins/default/aliplayer-min.css" + default: "https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" }, scriptSrc: { //js版本源 required: false, type: [String], - default: "https://g.alicdn.com/de/prismplayer/2.9.1/aliplayer-min.js" + default: "https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-min.js" } }, data: function data() { @@ -196,7 +213,9 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); id: null, //播放器的ID width: '100%', - autoplay: true // isLive: true, + autoplay: true, + skinLayout: false, + progressMarkers: false // isLive: true, //支持播放地址播放,此播放优先级最高 // source: 'rtmp://182.145.195.238:1935/hls/1194076936807170050', @@ -362,7 +381,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); var _this4 = this; if (typeof window.Aliplayer != 'undefined') { - var options = this.options; + var options = this.deepCloneObject(this.options); if (options) { for (var key in options) { @@ -666,6 +685,30 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); */ off: function off(ev, handle) { this.player && this.player.off(ev, handle); + }, + + /** + * 深度拷贝 + * @param {*} obj + */ + deepCloneObject: function deepCloneObject(obj) { + var objClone = Array.isArray(obj) ? [] : {}; + + if (obj && _typeof(obj) === 'object') { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + //判断ojb子元素是否为对象,如果是,递归复制 + if (obj[key] && _typeof(obj[key]) === 'object') { + objClone[key] = this.deepCloneObject(obj[key]); + } else { + //如果不是,简单复制 + objClone[key] = obj[key]; + } + } + } + } + + return objClone; } }, beforeDestroy: function beforeDestroy() { diff --git a/lib/vue-aliplayer-v2.umd.js b/lib/vue-aliplayer-v2.umd.js index b7cfe39..d194ccf 100644 --- a/lib/vue-aliplayer-v2.umd.js +++ b/lib/vue-aliplayer-v2.umd.js @@ -151,18 +151,35 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7cfd"); -// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=3905f692& +// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=54014060& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=3905f692& +// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=54014060& +// CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.7.2@@babel/runtime/helpers/esm/typeof.js +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") { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); +} // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js var es6_regexp_to_string = __webpack_require__("cc1d"); // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=script&lang=js& + // // // @@ -187,13 +204,13 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); //css版本源 required: false, type: [String], - default: "https://g.alicdn.com/de/prismplayer/2.9.1/skins/default/aliplayer-min.css" + default: "https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" }, scriptSrc: { //js版本源 required: false, type: [String], - default: "https://g.alicdn.com/de/prismplayer/2.9.1/aliplayer-min.js" + default: "https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-min.js" } }, data: function data() { @@ -205,7 +222,9 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); id: null, //播放器的ID width: '100%', - autoplay: true // isLive: true, + autoplay: true, + skinLayout: false, + progressMarkers: false // isLive: true, //支持播放地址播放,此播放优先级最高 // source: 'rtmp://182.145.195.238:1935/hls/1194076936807170050', @@ -371,7 +390,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); var _this4 = this; if (typeof window.Aliplayer != 'undefined') { - var options = this.options; + var options = this.deepCloneObject(this.options); if (options) { for (var key in options) { @@ -675,6 +694,30 @@ var es6_regexp_to_string = __webpack_require__("cc1d"); */ off: function off(ev, handle) { this.player && this.player.off(ev, handle); + }, + + /** + * 深度拷贝 + * @param {*} obj + */ + deepCloneObject: function deepCloneObject(obj) { + var objClone = Array.isArray(obj) ? [] : {}; + + if (obj && _typeof(obj) === 'object') { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + //判断ojb子元素是否为对象,如果是,递归复制 + if (obj[key] && _typeof(obj[key]) === 'object') { + objClone[key] = this.deepCloneObject(obj[key]); + } else { + //如果不是,简单复制 + objClone[key] = obj[key]; + } + } + } + } + + return objClone; } }, beforeDestroy: function beforeDestroy() { diff --git a/lib/vue-aliplayer-v2.umd.min.js b/lib/vue-aliplayer-v2.umd.min.js index 17b13d7..796bc14 100644 --- a/lib/vue-aliplayer-v2.umd.min.js +++ b/lib/vue-aliplayer-v2.umd.min.js @@ -1,2 +1,2 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-aliplayer-v2"]=t():e["vue-aliplayer-v2"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="112a")}({"0614":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"0cc1":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"112a":function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&(n("e67d"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));n("7cfd");var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.playerId}})},o=[],a=(n("cc1d"),{name:"VueAliplayerV2",props:{options:{required:!1,type:[Object],default:function(){return null}},source:{required:!1,type:[String],default:null},cssLink:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.9.1/skins/default/aliplayer-min.css"},scriptSrc:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.9.1/aliplayer-min.js"}},data:function(){return{player:null,playerId:"player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()),config:{id:null,width:"100%",autoplay:!0},events:["ready","play","pause","canplay","playing","ended","liveStreamStop","onM3u8Retry","hideBar","showBar","waiting","timeupdate","snapshoted","requestFullScreen","cancelFullScreen","error","startSeek","completeSeek"]}},watch:{source:function(){this.init()},options:{handler:function(){this.init()},deep:!0}},mounted:function(){var e=this;this.$nextTick((function(){e.init()}))},updated:function(){var e=this;this.$nextTick((function(){e.init()}))},methods:{init:function(){var e=this,t="app__aliplayer-min-css",n="app__aliplayer-min-js",r=document.getElementsByTagName("head"),i=document.getElementsByTagName("html"),o=document.getElementById(n),a=document.getElementById(t);if(!a){var s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=this.cssLink,s.id=t,r[0].appendChild(s)}o?this.initPlayer():(o=document.createElement("script"),o.type="text/javascript",o.id=n,o.src=this.scriptSrc,i[0].appendChild(o)),o.addEventListener("load",(function(){e.initPlayer()}))},initPlayer:function(){var e=this;if("undefined"!=typeof window.Aliplayer){var t=this.options;if(t)for(var n in t)this.config[n]=t[n];this.source&&(this.config.source=this.source),this.config.id=this.playerId,this.player&&this.player.dispose(),this.player=Aliplayer(this.config);var r=function(t){e.player&&e.player.on(e.events[t],(function(n){e.$emit(e.events[t],n)}))};for(var i in this.events)r(i)}},getPlayer:function(){return this.player},play:function(){this.player&&this.player.play()},pause:function(){this.player&&this.player.pause()},replay:function(){this.player&&this.player.replay()},seek:function(e){this.player&&this.player.seek(e)},getCurrentTime:function(){return this.player&&this.player.getCurrentTime()},getDuration:function(){return this.player&&this.player.getDuration()},getVolume:function(){return this.player&&this.player.getVolume()},setVolume:function(e){this.player&&this.player.setVolume(e)},loadByUrl:function(e,t){this.player&&this.player.loadByUrl(e,t)},replayByVidAndPlayAuth:function(e,t){this.player&&this.player.replayByVidAndPlayAuth(e,t)},replayByVidAndAuthInfo:function(e,t,n,r,i,o){this.player&&this.player.replayByVidAndAuthInfo(e,t,n,r,i,o)},setPlayerSize:function(e,t){this.player&&this.player.setPlayerSize(e,t)},setSpeed:function(e){this.player&&this.player.setSpeed(e)},setSanpshotProperties:function(e,t,n){this.player&&this.player.setSanpshotProperties(e,t,n)},requestFullScreen:function(){this.player&&this.player.fullscreenService&&this.player.fullscreenService.requestFullScreen()},cancelFullScreen:function(){this.player&&this.player.fullscreenService&&this.player.fullscreenService.cancelFullScreen()},getIsFullScreen:function(){return this.player&&this.player.fullscreenService&&this.player.fullscreenService.getIsFullScreen()},getStatus:function(){return this.player&&this.player.getStatus()},setLiveTimeRange:function(e,t){this.player&&this.player.liveShiftSerivce&&this.player.liveShiftSerivce.setLiveTimeRange(e,t)},setRotate:function(e){this.player&&this.player.setRotate(e)},getRotate:function(){return this.player&&this.player.getRotate()},setImage:function(e){this.player&&this.player.setImage(e)},dispose:function(){this.player&&this.player.dispose()},setCover:function(e){this.player&&this.player.setCover(e)},setProgressMarkers:function(e){this.player&&this.player.setProgressMarkers(e)},setPreviewTime:function(e){this.player&&this.player.setPreviewTime(e)},getPreviewTime:function(){return this.player&&this.player.getPreviewTime()},isPreview:function(){this.player&&this.player.isPreview()},off:function(e,t){this.player&&this.player.off(e,t)}},beforeDestroy:function(){this.dispose()}}),s=a;function c(e,t,n,r,i,o,a,s){var c,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(e,t){return c.call(t),l(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:u}}var u=c(s,i,o,!1,null,null,null),l=u.exports;l.install=function(e,t){t&&t.cssLink&&(l.props.cssLink.default=t.cssLink),t&&t.scriptSrc&&(l.props.scriptSrc.default=t.scriptSrc),e.component(l.name,l)},l.Player=l;var f=l;t["default"]=f},"25ae":function(e,t,n){e.exports=!n("f9a5")&&!n("0cc1")((function(){return 7!=Object.defineProperty(n("6618")("div"),"a",{get:function(){return 7}}).a}))},"2ab1":function(e,t,n){var r=n("da0b");e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},"3f8b":function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"4d2c":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},"549d":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},6618:function(e,t,n){var r=n("da0b"),i=n("3f8b").document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},"6cc2":function(e,t){e.exports=!1},"6fe0":function(e,t,n){e.exports=n("f341")("native-function-to-string",Function.toString)},"7cfd":function(e,t,n){var r=n("d3d8").f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n("f9a5")&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},"8cac":function(e,t,n){var r=n("da0b");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},"9f7e":function(e,t,n){n("f9a5")&&"g"!=/./g.flags&&n("d3d8").f(RegExp.prototype,"flags",{configurable:!0,get:n("e7a1")})},a6d5:function(e,t,n){var r=n("3f8b"),i=n("b8ea"),o=n("549d"),a=n("4d2c")("src"),s=n("6fe0"),c="toString",u=(""+s).split(c);n("da27").inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,c,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},b8ea:function(e,t,n){var r=n("d3d8"),i=n("0614");e.exports=n("f9a5")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},cc1d:function(e,t,n){"use strict";n("9f7e");var r=n("8cac"),i=n("e7a1"),o=n("f9a5"),a="toString",s=/./[a],c=function(e){n("a6d5")(RegExp.prototype,a,e,!0)};n("0cc1")((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?c((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):s.name!=a&&c((function(){return s.call(this)}))},d3d8:function(e,t,n){var r=n("8cac"),i=n("25ae"),o=n("2ab1"),a=Object.defineProperty;t.f=n("f9a5")?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},da0b:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},da27:function(e,t){var n=e.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},e67d:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},e7a1:function(e,t,n){"use strict";var r=n("8cac");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},f341:function(e,t,n){var r=n("da27"),i=n("3f8b"),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("6cc2")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},f9a5:function(e,t,n){e.exports=!n("0cc1")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))}})})); +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-aliplayer-v2"]=t():e["vue-aliplayer-v2"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="112a")}({"0614":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"0cc1":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"112a":function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&(n("e67d"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));n("7cfd");var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.playerId}})},o=[];function a(e){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e){return c="function"===typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)},c(e)}n("cc1d");var s={name:"VueAliplayerV2",props:{options:{required:!1,type:[Object],default:function(){return null}},source:{required:!1,type:[String],default:null},cssLink:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css"},scriptSrc:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-min.js"}},data:function(){return{player:null,playerId:"player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()),config:{id:null,width:"100%",autoplay:!0,skinLayout:!1,progressMarkers:!1},events:["ready","play","pause","canplay","playing","ended","liveStreamStop","onM3u8Retry","hideBar","showBar","waiting","timeupdate","snapshoted","requestFullScreen","cancelFullScreen","error","startSeek","completeSeek"]}},watch:{source:function(){this.init()},options:{handler:function(){this.init()},deep:!0}},mounted:function(){var e=this;this.$nextTick((function(){e.init()}))},updated:function(){var e=this;this.$nextTick((function(){e.init()}))},methods:{init:function(){var e=this,t="app__aliplayer-min-css",n="app__aliplayer-min-js",r=document.getElementsByTagName("head"),i=document.getElementsByTagName("html"),o=document.getElementById(n),a=document.getElementById(t);if(!a){var c=document.createElement("link");c.type="text/css",c.rel="stylesheet",c.href=this.cssLink,c.id=t,r[0].appendChild(c)}o?this.initPlayer():(o=document.createElement("script"),o.type="text/javascript",o.id=n,o.src=this.scriptSrc,i[0].appendChild(o)),o.addEventListener("load",(function(){e.initPlayer()}))},initPlayer:function(){var e=this;if("undefined"!=typeof window.Aliplayer){var t=this.deepCloneObject(this.options);if(t)for(var n in t)this.config[n]=t[n];this.source&&(this.config.source=this.source),this.config.id=this.playerId,this.player&&this.player.dispose(),this.player=Aliplayer(this.config);var r=function(t){e.player&&e.player.on(e.events[t],(function(n){e.$emit(e.events[t],n)}))};for(var i in this.events)r(i)}},getPlayer:function(){return this.player},play:function(){this.player&&this.player.play()},pause:function(){this.player&&this.player.pause()},replay:function(){this.player&&this.player.replay()},seek:function(e){this.player&&this.player.seek(e)},getCurrentTime:function(){return this.player&&this.player.getCurrentTime()},getDuration:function(){return this.player&&this.player.getDuration()},getVolume:function(){return this.player&&this.player.getVolume()},setVolume:function(e){this.player&&this.player.setVolume(e)},loadByUrl:function(e,t){this.player&&this.player.loadByUrl(e,t)},replayByVidAndPlayAuth:function(e,t){this.player&&this.player.replayByVidAndPlayAuth(e,t)},replayByVidAndAuthInfo:function(e,t,n,r,i,o){this.player&&this.player.replayByVidAndAuthInfo(e,t,n,r,i,o)},setPlayerSize:function(e,t){this.player&&this.player.setPlayerSize(e,t)},setSpeed:function(e){this.player&&this.player.setSpeed(e)},setSanpshotProperties:function(e,t,n){this.player&&this.player.setSanpshotProperties(e,t,n)},requestFullScreen:function(){this.player&&this.player.fullscreenService&&this.player.fullscreenService.requestFullScreen()},cancelFullScreen:function(){this.player&&this.player.fullscreenService&&this.player.fullscreenService.cancelFullScreen()},getIsFullScreen:function(){return this.player&&this.player.fullscreenService&&this.player.fullscreenService.getIsFullScreen()},getStatus:function(){return this.player&&this.player.getStatus()},setLiveTimeRange:function(e,t){this.player&&this.player.liveShiftSerivce&&this.player.liveShiftSerivce.setLiveTimeRange(e,t)},setRotate:function(e){this.player&&this.player.setRotate(e)},getRotate:function(){return this.player&&this.player.getRotate()},setImage:function(e){this.player&&this.player.setImage(e)},dispose:function(){this.player&&this.player.dispose()},setCover:function(e){this.player&&this.player.setCover(e)},setProgressMarkers:function(e){this.player&&this.player.setProgressMarkers(e)},setPreviewTime:function(e){this.player&&this.player.setPreviewTime(e)},getPreviewTime:function(){return this.player&&this.player.getPreviewTime()},isPreview:function(){this.player&&this.player.isPreview()},off:function(e,t){this.player&&this.player.off(e,t)},deepCloneObject:function(e){var t=Array.isArray(e)?[]:{};if(e&&"object"===c(e))for(var n in e)e.hasOwnProperty(n)&&(e[n]&&"object"===c(e[n])?t[n]=this.deepCloneObject(e[n]):t[n]=e[n]);return t}},beforeDestroy:function(){this.dispose()}},u=s;function l(e,t,n,r,i,o,a,c){var s,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=s):i&&(s=c?function(){i.call(this,this.$root.$options.shadowRoot)}:i),s)if(u.functional){u._injectStyles=s;var l=u.render;u.render=function(e,t){return s.call(t),l(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,s):[s]}return{exports:e,options:u}}var f=l(u,i,o,!1,null,null,null),p=f.exports;p.install=function(e,t){t&&t.cssLink&&(p.props.cssLink.default=t.cssLink),t&&t.scriptSrc&&(p.props.scriptSrc.default=t.scriptSrc),e.component(p.name,p)},p.Player=p;var y=p;t["default"]=y},"25ae":function(e,t,n){e.exports=!n("f9a5")&&!n("0cc1")((function(){return 7!=Object.defineProperty(n("6618")("div"),"a",{get:function(){return 7}}).a}))},"2ab1":function(e,t,n){var r=n("da0b");e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},"3f8b":function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"4d2c":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},"549d":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},6618:function(e,t,n){var r=n("da0b"),i=n("3f8b").document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},"6cc2":function(e,t){e.exports=!1},"6fe0":function(e,t,n){e.exports=n("f341")("native-function-to-string",Function.toString)},"7cfd":function(e,t,n){var r=n("d3d8").f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n("f9a5")&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},"8cac":function(e,t,n){var r=n("da0b");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},"9f7e":function(e,t,n){n("f9a5")&&"g"!=/./g.flags&&n("d3d8").f(RegExp.prototype,"flags",{configurable:!0,get:n("e7a1")})},a6d5:function(e,t,n){var r=n("3f8b"),i=n("b8ea"),o=n("549d"),a=n("4d2c")("src"),c=n("6fe0"),s="toString",u=(""+c).split(s);n("da27").inspectSource=function(e){return c.call(e)},(e.exports=function(e,t,n,c){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(s&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:c?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||c.call(this)}))},b8ea:function(e,t,n){var r=n("d3d8"),i=n("0614");e.exports=n("f9a5")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},cc1d:function(e,t,n){"use strict";n("9f7e");var r=n("8cac"),i=n("e7a1"),o=n("f9a5"),a="toString",c=/./[a],s=function(e){n("a6d5")(RegExp.prototype,a,e,!0)};n("0cc1")((function(){return"/a/b"!=c.call({source:"a",flags:"b"})}))?s((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):c.name!=a&&s((function(){return c.call(this)}))},d3d8:function(e,t,n){var r=n("8cac"),i=n("25ae"),o=n("2ab1"),a=Object.defineProperty;t.f=n("f9a5")?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},da0b:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},da27:function(e,t){var n=e.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},e67d:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},e7a1:function(e,t,n){"use strict";var r=n("8cac");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},f341:function(e,t,n){var r=n("da27"),i=n("3f8b"),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("6cc2")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},f9a5:function(e,t,n){e.exports=!n("0cc1")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))}})})); //# sourceMappingURL=vue-aliplayer-v2.umd.min.js.map \ No newline at end of file