mirror of
https://github.com/langyuxiansheng/vue-aliplayer-v2.git
synced 2025-04-06 03:57:55 +08:00
2 lines
8.0 KiB
JavaScript
2 lines
8.0 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")}({"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={name:"VueAliplayerV2",props:{options:{required:!1,type:[Object],default:function(){return null}},id:{required:!1,type:[String],default:"player-".concat(Date.parse(new Date))}},data:function(){return{player:null,config:{id:null,width:"100%",autoplay:!0,cssLink:"https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css",scriptSrc:"https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"},events:["ready","play","pause","canplay","playing","ended","liveStreamStop","onM3u8Retry","hideBar","showBar","waiting","timeupdate","snapshoted","requestFullScreen","cancelFullScreen","error","startSeek","completeSeek"]}},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 u=document.createElement("link");u.type="text/css",u.rel="stylesheet",u.href=this.config.cssLink,u.setAttribute("id",t),r[0].appendChild(u)}o||(o=document.createElement("script"),o.type="text/javascript",o.id=n,o.src=this.config.scriptSrc,i[0].appendChild(o)),o&&a?this.initPlayer():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.config.id=this.id,this.player=new Aliplayer(this.config);var r=function(t){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.play()},pause:function(){this.player.pause()},replay:function(){this.player.replay()},seek:function(e){this.player.seek(e)},getCurrentTime:function(){return this.player.getCurrentTime()},getDuration:function(){return this.player.getDuration()},getVolume:function(){return this.player.getVolume()},setVolume:function(e){this.player.setVolume(e)},loadByUrl:function(e,t){this.player.loadByUrl(e,t)},replayByVidAndPlayAuth:function(e,t){this.player.replayByVidAndPlayAuth(e,t)},replayByVidAndAuthInfo:function(e,t,n,r,i,o){this.player.replayByVidAndAuthInfo(e,t,n,r,i,o)},setPlayerSize:function(e,t){this.player.setPlayerSize(e,t)},setSpeed:function(e){this.player.setSpeed(e)},setSanpshotProperties:function(e,t,n){this.player.setSanpshotProperties(e,t,n)},requestFullScreen:function(){this.player.fullscreenService&&this.player.fullscreenService.requestFullScreen()},cancelFullScreen:function(){this.player.fullscreenService&&this.player.fullscreenService.cancelFullScreen()},getIsFullScreen:function(){return this.player.fullscreenService&&this.player.fullscreenService.getIsFullScreen()},getStatus:function(){return this.player.fullscreenService&&this.player.fullscreenService.getStatus()},setLiveTimeRange:function(e,t){this.player.liveShiftSerivce&&this.player.liveShiftSerivce.setLiveTimeRange(e,t)},setRotate:function(e){this.player.setRotate(e)},getRotate:function(){return this.player.getRotate()},setImage:function(e){this.player.setImage(e)},dispose:function(){this.player.dispose()},setCover:function(e){this.player.setCover(e)},setProgressMarkers:function(e){this.player.setProgressMarkers(e)},setPreviewTime:function(e){this.player.setPreviewTime(e)},getPreviewTime:function(){return this.player.getPreviewTime()},isPreview:function(){this.player.isPreview()},off:function(e,t){this.player.off(e,t)}}},u=a;function c(e,t,n,r,i,o,a,u){var c,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?(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)},s._ssrRegister=c):i&&(c=u?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(s.functional){s._injectStyles=c;var l=s.render;s.render=function(e,t){return c.call(t),l(e,t)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:s}}var s=c(u,i,o,!1,null,null,null),l=s.exports;l.install=function(e){e.component(l.name,l)};var f=l,p=[f],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,VueAliplayerV2:f};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)},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):{}}},"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}},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(u){}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}},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)},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
|