vue-aliplayer-v2/dist/js/index.9584040f.js
zhouliujun a0da3f5577 优化
2019-12-13 09:45:12 +08:00

2 lines
6.9 KiB
JavaScript

(function(e){function t(t){for(var r,a,s=t[0],u=t[1],o=t[2],p=0,f=[];p<s.length;p++)a=s[p],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&f.push(i[a][0]),i[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);c&&c(t);while(f.length)f.shift()();return l.push.apply(l,o||[]),n()}function n(){for(var e,t=0;t<l.length;t++){for(var n=l[t],r=!0,s=1;s<n.length;s++){var u=n[s];0!==i[u]&&(r=!1)}r&&(l.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},i={index:0},l=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/vue-aliplayer-v2/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],u=s.push.bind(s);s.push=t,s=s.slice();for(var o=0;o<s.length;o++)t(s[o]);var c=u;l.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("c31f")},"927c":function(e,t,n){},bd35:function(e,t,n){"use strict";var r=n("927c"),i=n.n(r);i.a},c31f:function(e,t,n){"use strict";n.r(t);n("96dd"),n("a60a"),n("e783"),n("8b1f");var r=n("6e6d"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[e.show?[n("vue-aliplayer-v2",{ref:"VueAliplayerV2",attrs:{id:"player-1194076936807170050",options:e.options}})]:n("p",{staticClass:"remove-text"},[e._v("播放器已销毁!")]),n("div",{staticClass:"player-btns"},[n("span",{on:{click:function(t){return e.play()}}},[e._v("播放")]),n("span",{on:{click:function(t){return e.pause()}}},[e._v("暂停")]),n("span",{on:{click:function(t){return e.replay()}}},[e._v("重播")]),n("span",{on:{click:function(t){return e.getCurrentTime()}}},[e._v("播放时刻")]),n("span",{on:{click:function(t){e.show=!e.show}}},[e._v(e._s(e.show?"销毁":"重载"))])])],2)},l=[],a={data:function(){return{options:{source:"//player.alicdn.com/video/aliyunmedia.mp4"},show:!0}},methods:{play:function(){this.$refs.VueAliplayerV2.play()},pause:function(){this.$refs.VueAliplayerV2.pause()},replay:function(){this.$refs.VueAliplayerV2.replay()},getCurrentTime:function(){this.$refs.VueAliplayerV2.getCurrentTime()}}},s=a,u=(n("bd35"),n("4e82")),o=Object(u["a"])(s,i,l,!1,null,"9b14a31e",null),c=o.exports,p=(n("7cfd"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.id}})}),f=[],y={name:"VueAliplayerV2",props:{options:{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"]}},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"),l=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)}l||(l=document.createElement("script"),l.type="text/javascript",l.id=n,l.src=this.scriptSrc,i[0].appendChild(l)),l&&a?this.initPlayer():l.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.config.id=this.id,this.player)this.player.replay();else{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,l){this.player.replayByVidAndAuthInfo(e,t,n,r,i,l)},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)}}},d=y,h=Object(u["a"])(d,p,f,!1,null,null,null),v=h.exports;v.install=function(e){e.component(v.name,v)};var m=v,g=[m],S=function e(t){if(e.installed)return!1;e.installed=!0,g.map((function(e){return t.component(e.name,e)}))};"undefined"!==typeof window&&window.Vue&&S(window.Vue);var w={install:S,VueAliplayerV2:m};r["a"].use(w),r["a"].config.productionTip=!1,new r["a"]({render:function(e){return e(c)}}).$mount("#app")}});
//# sourceMappingURL=index.9584040f.js.map