vue-aliplayer-v2/lib/vue-aliplayer-v2.umd.min.js
2020-03-18 15:52:42 +08:00

2 lines
17 KiB
JavaScript

(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.id}})},o=[],a=(n("4634"),{name:"VueAliplayerV2",props:{options:{required:!1,type:[Object],default:function(){return null}},source:{required:!1,type:[Object],default:function(){return null}},id:{required:!1,type:[String],default:"player-".concat(Date.parse(new Date))},cssLink:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"},scriptSrc:{required:!1,type:[String],default:"https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"}},data:function(){return{player:null,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(e){this.loadByUrl(e)}},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="aliplayer-min-css",n="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.options;if(t)for(var n in t)this.config[n]=t[n];if(this.source&&(this.config.source=this.source),this.config.id=this.id,this.player)this.player&&this.player.replay();else{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.fullscreenService&&this.player.fullscreenService.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(){var e=document.querySelector("head"),t=document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');e&&t.forEach((function(t){e.removeChild(t)}))}}),c=a;function u(e,t,n,r,i,o,a,c){var u,s="function"===typeof e?e.options:e;if(t&&(s.render=t,s.staticRenderFns=n,s._compiled=!0),r&&(s.functional=!0),o&&(s._scopeId="data-v-"+o),a?(u=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)},s._ssrRegister=u):i&&(u=c?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(s.functional){s._injectStyles=u;var f=s.render;s.render=function(e,t){return u.call(t),f(e,t)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,u):[u]}return{exports:e,options:s}}var s=u(c,i,o,!1,null,null,null),f=s.exports;f.install=function(e){e.component(f.name,f)};var l=f,p=[l],d=function e(t){if(e.installed)return!1;e.installed=!0,p.map((function(e){return t.component(e.name,e)}))};"undefined"!==typeof window&&window.Vue&&d(window.Vue);var y={install:d,Player:l};t["default"]=y},1277:function(e,t,n){var r=n("f341")("wks"),i=n("4d2c"),o=n("3f8b").Symbol,a="function"==typeof o,c=e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))};c.store=r},"17cb":function(e,t,n){var r=n("3f8b").document;e.exports=r&&r.documentElement},"1f9e":function(e,t,n){var r=n("6117"),i=n("8941"),o=n("c3a9");e.exports=function(e){return function(t,n,a){var c,u=r(t),s=i(u.length),f=o(a,s);if(e&&n!=n){while(s>f)if(c=u[f++],c!=c)return!0}else for(;s>f;f++)if((e||f in u)&&u[f]===n)return e||f||0;return!e&&-1}}},2498:function(e,t,n){var r=n("3f8b"),i=n("da27"),o=n("b8ea"),a=n("a6d5"),c=n("e85e"),u="prototype",s=function(e,t,n){var f,l,p,d,y=e&s.F,h=e&s.G,v=e&s.S,m=e&s.P,g=e&s.B,S=h?r:v?r[t]||(r[t]={}):(r[t]||{})[u],b=h?i:i[t]||(i[t]={}),x=b[u]||(b[u]={});for(f in h&&(n=t),n)l=!y&&S&&void 0!==S[f],p=(l?S:n)[f],d=g&&l?c(p,r):m&&"function"==typeof p?c(Function.call,p):p,S&&a(S,f,p,e&s.U),b[f]!=p&&o(b,f,d),m&&x[f]!=p&&(x[f]=p)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},"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")}},3038:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"3d87":function(e,t,n){var r=n("d3d8").f,i=n("549d"),o=n("1277")("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},"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)},4634:function(e,t,n){for(var r=n("96dd"),i=n("7d56"),o=n("a6d5"),a=n("3f8b"),c=n("b8ea"),u=n("e3b3"),s=n("1277"),f=s("iterator"),l=s("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=i(d),h=0;h<y.length;h++){var v,m=y[h],g=d[m],S=a[m],b=S&&S.prototype;if(b&&(b[f]||c(b,f,p),b[l]||c(b,l,m),u[m]=p,g))for(v in r)b[v]||o(b,v,r[v],!0)}},"4aef":function(e,t,n){"use strict";var r=n("6cc2"),i=n("2498"),o=n("a6d5"),a=n("b8ea"),c=n("e3b3"),u=n("c264"),s=n("3d87"),f=n("d15b"),l=n("1277")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",y="keys",h="values",v=function(){return this};e.exports=function(e,t,n,m,g,S,b){u(n,t,m);var x,w,_,P=function(e){if(!p&&e in L)return L[e];switch(e){case y:return function(){return new n(this,e)};case h:return function(){return new n(this,e)}}return function(){return new n(this,e)}},O=t+" Iterator",T=g==h,j=!1,L=e.prototype,E=L[l]||L[d]||g&&L[g],k=E||P(g),M=g?T?P("entries"):k:void 0,C="Array"==t&&L.entries||E;if(C&&(_=f(C.call(new e)),_!==Object.prototype&&_.next&&(s(_,O,!0),r||"function"==typeof _[l]||a(_,l,v))),T&&E&&E.name!==h&&(j=!0,k=function(){return E.call(this)}),r&&!b||!p&&!j&&L[l]||a(L,l,k),c[t]=k,c[O]=v,g)if(x={values:T?k:P(h),keys:S?k:P(y),entries:M},b)for(w in x)w in L||o(L,w,x[w]);else i(i.P+i.F*(p||j),t,x);return x}},"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)}},6077:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},6117:function(e,t,n){var r=n("9952"),i=n("3038");e.exports=function(e){return r(i(e))}},"65c3":function(e,t,n){var r=n("8cac"),i=n("8d69"),o=n("d93f"),a=n("9947")("IE_PROTO"),c=function(){},u="prototype",s=function(){var e,t=n("6618")("iframe"),r=o.length,i="<",a=">";t.style.display="none",n("17cb").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+a+"document.F=Object"+i+"/script"+a),e.close(),s=e.F;while(r--)delete s[u][o[r]];return s()};e.exports=Object.create||function(e,t){var n;return null!==e?(c[u]=r(e),n=new c,c[u]=null,n[a]=e):n=s(),void 0===t?n:i(n,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)},"7afe":function(e,t,n){var r=n("549d"),i=n("6117"),o=n("1f9e")(!1),a=n("9947")("IE_PROTO");e.exports=function(e,t){var n,c=i(e),u=0,s=[];for(n in c)n!=a&&r(c,n)&&s.push(n);while(t.length>u)r(c,n=t[u++])&&(~o(s,n)||s.push(n));return s}},"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""}}})},"7d56":function(e,t,n){var r=n("7afe"),i=n("d93f");e.exports=Object.keys||function(e){return r(e,i)}},8451:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},8941:function(e,t,n){var r=n("a6ad"),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},"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}},"8d69":function(e,t,n){var r=n("d3d8"),i=n("8cac"),o=n("7d56");e.exports=n("f9a5")?Object.defineProperties:function(e,t){i(e);var n,a=o(t),c=a.length,u=0;while(c>u)r.f(e,n=a[u++],t[n]);return e}},"96dd":function(e,t,n){"use strict";var r=n("ab19"),i=n("c8e9"),o=n("e3b3"),a=n("6117");e.exports=n("4aef")(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},9947:function(e,t,n){var r=n("f341")("keys"),i=n("4d2c");e.exports=function(e){return r[e]||(r[e]=i(e))}},9952:function(e,t,n){var r=n("6077");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},a6ad:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},a6d5:function(e,t,n){var r=n("3f8b"),i=n("b8ea"),o=n("549d"),a=n("4d2c")("src"),c=n("6fe0"),u="toString",s=(""+c).split(u);n("da27").inspectSource=function(e){return c.call(e)},(e.exports=function(e,t,n,c){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:s.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,u,(function(){return"function"==typeof this&&this[a]||c.call(this)}))},a9cf:function(e,t,n){var r=n("3038");e.exports=function(e){return Object(r(e))}},ab19:function(e,t,n){var r=n("1277")("unscopables"),i=Array.prototype;void 0==i[r]&&n("b8ea")(i,r,{}),e.exports=function(e){i[r][e]=!0}},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}},c264:function(e,t,n){"use strict";var r=n("65c3"),i=n("0614"),o=n("3d87"),a={};n("b8ea")(a,n("1277")("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},c3a9:function(e,t,n){var r=n("a6ad"),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},c8e9:function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},d15b:function(e,t,n){var r=n("549d"),i=n("a9cf"),o=n("9947")("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},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}},d93f:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},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)},e3b3:function(e,t){e.exports={}},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)},e85e:function(e,t,n){var r=n("8451");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},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