vue-aliplayer-v2/dist/js/index.90a85eec.js
2019-11-14 13:36:19 +08:00

2 lines
8.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e){function t(t){for(var r,l,c=t[0],a=t[1],s=t[2],p=0,f=[];p<c.length;p++)l=c[p],Object.prototype.hasOwnProperty.call(i,l)&&i[l]&&f.push(i[l][0]),i[l]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);u&&u(t);while(f.length)f.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,c=1;c<n.length;c++){var a=n[c];0!==i[a]&&(r=!1)}r&&(o.splice(t--,1),e=l(l.s=n[0]))}return e}var r={},i={index:0},o=[];function l(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,l),n.l=!0,n.exports}l.m=e,l.c=r,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)l.d(n,r,function(t){return e[t]}.bind(null,r));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/vue-sign-canvas/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],a=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var u=a;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("c31f")},2535:function(e,t,n){"use strict";var r=n("3440"),i=n.n(r);i.a},3440:function(e,t,n){},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"}},[n("vue-aliplayer-v2",{ref:"VueAliplayerV2",attrs:{id:"player-1194076936807170050",options:{source:"rtmp://182.145.195.238:1935/hls/1194076936807170053"}}}),n("vue-aliplayer-v2",{ref:"VueAliplayerV2",attrs:{id:"player-1194076936807170051",options:{source:"rtmp://182.145.195.238:1935/hls/1194076936807170051"}}}),n("button",{on:{click:function(t){return e.play()}}},[e._v("播放")]),n("button",{on:{click:function(t){return e.pause()}}},[e._v("暂停")]),n("button",{on:{click:function(t){return e.replay()}}},[e._v("重播")]),n("button",{on:{click:function(t){return e.getCurrentTime()}}},[e._v("播放时刻")])],1)},o=[],l={data:function(){return{value:null,player:null}},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()}}},c=l,a=(n("2535"),n("4e82")),s=Object(a["a"])(c,i,o,!1,null,"d3e19be8",null),u=s.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))}},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=!0,n="aliplayer-min-css",r="aliplayer-min-js",i=document.getElementsByTagName("head"),o=document.getElementsByTagName("html"),l=document.getElementById(r);if(!document.getElementById(n)){var c=document.createElement("link");c.href=this.config.cssLink,c.setAttribute("id",n),i[0].appendChild(c)}l||(l=document.createElement("script"),l.id=r,l.type="text/javascript",l.src=this.config.scriptSrc,o[0].appendChild(l)),l.addEventListener("load",(function(){e.initPlayer(),t=!1})),t||this.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,(function(e){console.log("播放器创建好了。",e)}));var r=function(t){e.player.on(e.events[t],(function(n){console.log("object ".concat(e.events[t]),n),e.$emit(e.events[t],n)}))};for(var i in this.events)r(i)}},getPlayer:function(){return this.player},play:function(){console.log("播放视频。"),this.player.play()},pause:function(){console.log("暂停视频"),this.player.pause()},replay:function(){console.log("重播视频"),this.player.replay()},seek:function(e){console.log("跳转到某个时刻进行播放time为".concat(e,"秒。")),this.player.seek(e)},getCurrentTime:function(){return console.log("获取当前的播放时刻,返回的单位为".concat(this.player.getCurrentTime(),"秒。")),this.player.getCurrentTime()},getDuration:function(){return console.log("获取视频总时长,返回的单位为".concat(this.player.getDuration(),"秒。")),this.player.getDuration()},getVolume:function(){return console.log("获取当前的音量".concat(this.player.getVolume(),"。")),this.player.getVolume()},setVolume:function(e){console.log("设置音量vol为".concat(e,"。")),this.player.setVolume(e)},loadByUrl:function(e,t){console.log("直接播放视频url".concat(e,"time为").concat(t,"。")),this.player.loadByUrl(e,t)},replayByVidAndPlayAuth:function(e,t){console.log("replayByVidAndPlayAuth vid".concat(e,"playauth为").concat(t,"。")),this.player.replayByVidAndPlayAuth(e,t)},replayByVidAndAuthInfo:function(e,t,n,r,i,o){console.log("replayByVidAndAuthInfo 参数顺序为vid、accId、accSecret、stsToken、authInfo、domainRegion",e,t,n,r,i,o),this.player.replayByVidAndAuthInfo(e,t,n,r,i,o)},setPlayerSize:function(e,t){console.log("设置播放器大小 宽度:".concat(e,",高度:").concat(t)),this.player.setPlayerSize(e,t)},setSpeed:function(e){console.log("手动设置播放的倍速:".concat(e)),this.player.setSpeed(e)},setSanpshotProperties:function(e,t,n){console.log("设置截图参数:",e,t,n),this.player.setSanpshotProperties(e,t,n)},requestFullScreen:function(){console.log("播放器全屏仅H5支持"),this.player.fullscreenService&&this.player.fullscreenService.requestFullScreen()},cancelFullScreen:function(){console.log("播放器全屏仅H5支持"),this.player.fullscreenService&&this.player.fullscreenService.cancelFullScreen()},getIsFullScreen:function(){return console.log("获取播放器全屏状态仅H5支持。",this.player.fullscreenService&&this.player.fullscreenService.getIsFullScreen()),this.player.fullscreenService&&this.player.fullscreenService.getIsFullScreen()},getStatus:function(){return console.log("获取播放器状态,包含的值",this.player.fullscreenService&&this.player.fullscreenService.getStatus()),this.player.fullscreenService&&this.player.fullscreenService.getStatus()},setLiveTimeRange:function(e,t){console.log("设置直播的开始时间:".concat(e,",结束时间:").concat(t,",开启直播时移功能时使用。")),this.player.liveShiftSerivce&&this.player.liveShiftSerivce.setLiveTimeRange(e,t)},setRotate:function(e){console.log("参数为旋转角度:".concat(e,"。")),this.player.setRotate(e)},getRotate:function(){return console.log("获取旋转角度:".concat(this.player.getRotate())),this.player.getRotate()},setImage:function(e){console.log("设置镜像:".concat(e,"。")),this.player.setImage(e)},dispose:function(){console.log("播放器销毁。"),this.player.dispose()},setCover:function(e){console.log("设置封面:".concat(e)),this.player.setCover(e)},setProgressMarkers:function(e){console.log("markers打点数据集合:".concat(e)),this.player.setProgressMarkers(e)},setPreviewTime:function(e){console.log("设置试看时间,单位为:".concat(e,"秒")),this.player.setPreviewTime(e)},getPreviewTime:function(){return console.log("获取试看时间:".concat(this.player.getPreviewTime())),this.player.getPreviewTime()},isPreview:function(){console.log("是否试看"),this.player.isPreview()}}},d=y,h=Object(a["a"])(d,p,f,!1,null,null,null),g=h.exports;g.install=function(e){e.component(g.name,g)};var v=g,m=[v],S=function e(t){if(e.installed)return!1;e.installed=!0,m.map((function(e){return t.component(e.name,e)}))};"undefined"!==typeof window&&window.Vue&&S(window.Vue);var w={install:S,VueAliplayerV2:v};r["a"].use(w),r["a"].config.productionTip=!1,new r["a"]({render:function(e){return e(u)}}).$mount("#app")}});
//# sourceMappingURL=index.90a85eec.js.map