vue-aliplayer-v2/lib/vue-aliplayer-v2.umd.min.js
2020-05-16 22:24:06 +08:00

2 lines
18 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")}({"008a":function(e,t,n){var r=n("f6b4");e.exports=function(e){return Object(r(e))}},"064e":function(e,t,n){var r=n("69b3"),i=n("db6b"),o=n("94b3"),c=Object.defineProperty;t.f=n("149f")?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return c(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},"09b9":function(e,t,n){var r=n("224c"),i=n("f6b4");e.exports=function(e){return r(i(e))}},"0dc8":function(e,t,n){var r=n("064e"),i=n("69b3"),o=n("80a9");e.exports=n("149f")?Object.defineProperties:function(e,t){i(e);var n,c=o(t),a=c.length,u=0;while(a>u)r.f(e,n=c[u++],t[n]);return e}},"0e8b":function(e,t,n){var r=n("cb3d")("unscopables"),i=Array.prototype;void 0==i[r]&&n("86d4")(i,r,{}),e.exports=function(e){i[r][e]=!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("cc57");var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.id}})},o=[],c=(n("6d57"),n("2b45"),{name:"VueAliplayerV2",props:{options:{required:!1,type:[Object],default:function(){return null}},source:{required:!1,type:[String],default:null},id:{required:!1,type:[String],default:"player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase())},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),c=document.getElementById(t);if(!c){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=this.cssLink,a.id=t,r[0].appendChild(a)}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.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)}))}}),a=c;function u(e,t,n,r,i,o,c,a){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),c?(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(c)},s._ssrRegister=u):i&&(u=a?function(){i.call(this,(s.functional?this.parent: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(a,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},"149f":function(e,t,n){e.exports=!n("238a")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"190b":function(e,t,n){n("149f")&&"g"!=/./g.flags&&n("064e").f(RegExp.prototype,"flags",{configurable:!0,get:n("f1fe")})},"224c":function(e,t,n){var r=n("75c4");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"238a":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"2b45":function(e,t,n){"use strict";n("190b");var r=n("69b3"),i=n("f1fe"),o=n("149f"),c="toString",a=/./[c],u=function(e){n("bf16")(RegExp.prototype,c,e,!0)};n("238a")((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?u((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):a.name!=c&&u((function(){return a.call(this)}))},"32b9":function(e,t,n){"use strict";var r=n("e005"),i=n("cc33"),o=n("399f"),c={};n("86d4")(c,n("cb3d")("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(c,{next:i(1,n)}),o(e,t+" Iterator")}},"399f":function(e,t,n){var r=n("064e").f,i=n("e042"),o=n("cb3d")("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},"475d":function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},"492d":function(e,t,n){"use strict";var r=n("550e"),i=n("e46b"),o=n("bf16"),c=n("86d4"),a=n("da6d"),u=n("32b9"),s=n("399f"),f=n("58cf"),l=n("cb3d")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",y="keys",h="values",v=function(){return this};e.exports=function(e,t,n,m,b,g,S){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=b==h,j=!1,L=e.prototype,E=L[l]||L[d]||b&&L[b],k=E||P(b),M=b?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]||c(_,l,v))),T&&E&&E.name!==h&&(j=!0,k=function(){return E.call(this)}),r&&!S||!p&&!j&&L[l]||c(L,l,k),a[t]=k,a[O]=v,b)if(x={values:T?k:P(h),keys:g?k:P(y),entries:M},S)for(w in x)w in L||o(L,w,x[w]);else i(i.P+i.F*(p||j),t,x);return x}},"4ce5":function(e,t,n){var r=n("5daa");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)}}},"550e":function(e,t){e.exports=!1},"56f2":function(e,t,n){var r=n("6798")("keys"),i=n("ec45");e.exports=function(e){return r[e]||(r[e]=i(e))}},"58cf":function(e,t,n){var r=n("e042"),i=n("008a"),o=n("56f2")("IE_PROTO"),c=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?c:null}},"5daa":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},6798:function(e,t,n){var r=n("7ddc"),i=n("e7ad"),o="__core-js_shared__",c=i[o]||(i[o]={});(e.exports=function(e,t){return c[e]||(c[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("550e")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"69b3":function(e,t,n){var r=n("fb68");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},"6d57":function(e,t,n){for(var r=n("e44b"),i=n("80a9"),o=n("bf16"),c=n("e7ad"),a=n("86d4"),u=n("da6d"),s=n("cb3d"),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],b=d[m],g=c[m],S=g&&g.prototype;if(S&&(S[f]||a(S,f,p),S[l]||a(S,l,m),u[m]=p,b))for(v in r)S[v]||o(S,v,r[v],!0)}},"75c4":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"7ddc":function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},"80a9":function(e,t,n){var r=n("c2f7"),i=n("ceac");e.exports=Object.keys||function(e){return r(e,i)}},"86d4":function(e,t,n){var r=n("064e"),i=n("cc33");e.exports=n("149f")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},"8df1":function(e,t,n){var r=n("e7ad").document;e.exports=r&&r.documentElement},"94b3":function(e,t,n){var r=n("fb68");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")}},b3a6:function(e,t,n){var r=n("09b9"),i=n("eafa"),o=n("f58a");e.exports=function(e){return function(t,n,c){var a,u=r(t),s=i(u.length),f=o(c,s);if(e&&n!=n){while(s>f)if(a=u[f++],a!=a)return!0}else for(;s>f;f++)if((e||f in u)&&u[f]===n)return e||f||0;return!e&&-1}}},bf16:function(e,t,n){var r=n("e7ad"),i=n("86d4"),o=n("e042"),c=n("ec45")("src"),a=n("d07e"),u="toString",s=(""+a).split(u);n("7ddc").inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,c)||i(n,c,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:a?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[c]||a.call(this)}))},bfe7:function(e,t,n){var r=n("fb68"),i=n("e7ad").document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},c2f7:function(e,t,n){var r=n("e042"),i=n("09b9"),o=n("b3a6")(!1),c=n("56f2")("IE_PROTO");e.exports=function(e,t){var n,a=i(e),u=0,s=[];for(n in a)n!=c&&r(a,n)&&s.push(n);while(t.length>u)r(a,n=t[u++])&&(~o(s,n)||s.push(n));return s}},cb3d:function(e,t,n){var r=n("6798")("wks"),i=n("ec45"),o=n("e7ad").Symbol,c="function"==typeof o,a=e.exports=function(e){return r[e]||(r[e]=c&&o[e]||(c?o:i)("Symbol."+e))};a.store=r},cc33:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},cc57:function(e,t,n){var r=n("064e").f,i=Function.prototype,o=/^\s*function ([^ (]*)/,c="name";c in i||n("149f")&&r(i,c,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},ceac:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},d07e:function(e,t,n){e.exports=n("6798")("native-function-to-string",Function.toString)},da6d:function(e,t){e.exports={}},db6b:function(e,t,n){e.exports=!n("149f")&&!n("238a")((function(){return 7!=Object.defineProperty(n("bfe7")("div"),"a",{get:function(){return 7}}).a}))},e005:function(e,t,n){var r=n("69b3"),i=n("0dc8"),o=n("ceac"),c=n("56f2")("IE_PROTO"),a=function(){},u="prototype",s=function(){var e,t=n("bfe7")("iframe"),r=o.length,i="<",c=">";t.style.display="none",n("8df1").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+c+"document.F=Object"+i+"/script"+c),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?(a[u]=r(e),n=new a,a[u]=null,n[c]=e):n=s(),void 0===t?n:i(n,t)}},e042:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},e44b:function(e,t,n){"use strict";var r=n("0e8b"),i=n("475d"),o=n("da6d"),c=n("09b9");e.exports=n("492d")(Array,"Array",(function(e,t){this._t=c(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")},e46b:function(e,t,n){var r=n("e7ad"),i=n("7ddc"),o=n("86d4"),c=n("bf16"),a=n("4ce5"),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,b=e&s.B,g=h?r:v?r[t]||(r[t]={}):(r[t]||{})[u],S=h?i:i[t]||(i[t]={}),x=S[u]||(S[u]={});for(f in h&&(n=t),n)l=!y&&g&&void 0!==g[f],p=(l?g:n)[f],d=b&&l?a(p,r):m&&"function"==typeof p?a(Function.call,p):p,g&&c(g,f,p,e&s.U),S[f]!=p&&o(S,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},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)},e7ad: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)},eafa:function(e,t,n){var r=n("ee21"),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},ec45:function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},ee21:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},f1fe:function(e,t,n){"use strict";var r=n("69b3");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}},f58a:function(e,t,n){var r=n("ee21"),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},f6b4:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},fb68:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}}})}));
//# sourceMappingURL=vue-aliplayer-v2.umd.min.js.map