mirror of
https://github.com/langyuxiansheng/vue-aliplayer-v2.git
synced 2025-04-05 19:41:39 +08:00
2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
(function(e){function t(t){for(var n,a,s=t[0],o=t[1],u=t[2],c=0,y=[];c<s.length;c++)a=s[c],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&y.push(i[a][0]),i[a]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);p&&p(t);while(y.length)y.shift()();return l.push.apply(l,u||[]),r()}function r(){for(var e,t=0;t<l.length;t++){for(var r=l[t],n=!0,s=1;s<r.length;s++){var o=r[s];0!==i[o]&&(n=!1)}n&&(l.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},i={index:0},l=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},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"]||[],o=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var p=o;l.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("c31f")},"927c":function(e,t,r){},bd35:function(e,t,r){"use strict";var n=r("927c"),i=r.n(n);i.a},c31f:function(e,t,r){"use strict";r.r(t);r("96dd"),r("a60a"),r("e783"),r("8b1f");var n=r("6e6d"),i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"app"}},[e.show?[r("vue-aliplayer-v2",{ref:"VueAliplayerV2",attrs:{id:"player-1194076936807170050",options:e.options}})]:r("p",{staticClass:"remove-text"},[e._v("播放器已销毁!")]),r("div",{staticClass:"player-btns"},[r("span",{on:{click:function(t){return e.play()}}},[e._v("播放")]),r("span",{on:{click:function(t){return e.pause()}}},[e._v("暂停")]),r("span",{on:{click:function(t){return e.replay()}}},[e._v("重播")]),r("span",{on:{click:function(t){return e.getCurrentTime()}}},[e._v("播放时刻")]),r("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,o=(r("bd35"),r("4e82")),u=Object(o["a"])(s,i,l,!1,null,"9b14a31e",null),p=u.exports,c=(r("7cfd"),function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:e.id}})}),y=[],f=(r("4634"),{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",r="aliplayer-min-js",n=document.getElementsByTagName("head"),i=document.getElementsByTagName("html"),l=document.getElementById(r),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,n[0].appendChild(s)}l?this.initPlayer():(l=document.createElement("script"),l.type="text/javascript",l.id=r,l.src=this.scriptSrc,i[0].appendChild(l),l.addEventListener("load",(function(){e.initPlayer()})))},initPlayer:function(){var e=this;if("undefined"!=typeof window.Aliplayer){var t=this.options;if(t)for(var r in t)this.config[r]=t[r];if(this.config.id=this.id,this.player)this.player&&this.player.replay();else{this.player=Aliplayer(this.config);var n=function(t){e.player&&e.player.on(e.events[t],(function(r){e.$emit(e.events[t],r)}))};for(var i in this.events)n(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,r,n,i,l){this.player&&this.player.replayByVidAndAuthInfo(e,t,r,n,i,l)},setPlayerSize:function(e,t){this.player&&this.player.setPlayerSize(e,t)},setSpeed:function(e){this.player&&this.player.setSpeed(e)},setSanpshotProperties:function(e,t,r){this.player&&this.player.setSanpshotProperties(e,t,r)},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)}))}}),h=f,d=Object(o["a"])(h,c,y,!1,null,null,null),v=d.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};n["a"].use(w),n["a"].config.productionTip=!1,new n["a"]({render:function(e){return e(p)}}).$mount("#app")}});
|
|
//# sourceMappingURL=index.b7f22f1a.js.map
|