diff --git a/lib/vue-aliplayer-v2.common.js b/lib/vue-aliplayer-v2.common.js index bbb463c..cac1dda 100644 --- a/lib/vue-aliplayer-v2.common.js +++ b/lib/vue-aliplayer-v2.common.js @@ -127,12 +127,12 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7cfd"); -// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=0fd39c20& +// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=66e79580& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.id}})} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=0fd39c20& +// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=66e79580& // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=script&lang=js& // @@ -283,6 +283,8 @@ var staticRenderFns = [] if (!document.getElementById(linkID)) { var link = document.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; link.href = this.config.cssLink; link.setAttribute('id', linkID); head[0].appendChild(link); @@ -290,8 +292,8 @@ var staticRenderFns = [] if (!scriptTag) { scriptTag = document.createElement('script'); - scriptTag.id = scriptID; scriptTag.type = "text/javascript"; + scriptTag.id = scriptID; scriptTag.src = this.config.scriptSrc; html[0].appendChild(scriptTag); } @@ -330,8 +332,7 @@ var staticRenderFns = [] var _loop = function _loop(ev) { _this4.player.on(_this4.events[ev], function (e) { - console.log("object ".concat(_this4.events[ev]), e); - + // console.log(`object ${this.events[ev]}`,e); _this4.$emit(_this4.events[ev], e); }); }; @@ -355,7 +356,7 @@ var staticRenderFns = [] * 播放视频。 */ play: function play() { - console.log("\u64AD\u653E\u89C6\u9891\u3002"); + // console.log(`播放视频。`); this.player.play(); }, @@ -363,7 +364,7 @@ var staticRenderFns = [] * 暂停视频 */ pause: function pause() { - console.log("\u6682\u505C\u89C6\u9891"); + // console.log(`暂停视频`); this.player.pause(); }, @@ -371,7 +372,7 @@ var staticRenderFns = [] * 重播视频 */ replay: function replay() { - console.log("\u91CD\u64AD\u89C6\u9891"); + // console.log(`重播视频`); this.player.replay(); }, @@ -381,7 +382,7 @@ var staticRenderFns = [] * @return player */ seek: function seek(time) { - console.log("\u8DF3\u8F6C\u5230\u67D0\u4E2A\u65F6\u523B\u8FDB\u884C\u64AD\u653E\uFF0Ctime\u4E3A".concat(time, "\u79D2\u3002")); + // console.log(`跳转到某个时刻进行播放,time为${time}秒。`); this.player.seek(time); }, @@ -390,7 +391,7 @@ var staticRenderFns = [] * @return player */ getCurrentTime: function getCurrentTime() { - console.log("\u83B7\u53D6\u5F53\u524D\u7684\u64AD\u653E\u65F6\u523B\uFF0C\u8FD4\u56DE\u7684\u5355\u4F4D\u4E3A".concat(this.player.getCurrentTime(), "\u79D2\u3002")); + // console.log(`获取当前的播放时刻,返回的单位为${this.player.getCurrentTime()}秒。`); return this.player.getCurrentTime(); }, @@ -399,7 +400,7 @@ var staticRenderFns = [] * @return player */ getDuration: function getDuration() { - console.log("\u83B7\u53D6\u89C6\u9891\u603B\u65F6\u957F\uFF0C\u8FD4\u56DE\u7684\u5355\u4F4D\u4E3A".concat(this.player.getDuration(), "\u79D2\u3002")); + // console.log(`获取视频总时长,返回的单位为${this.player.getDuration()}秒。`); return this.player.getDuration(); }, @@ -408,7 +409,7 @@ var staticRenderFns = [] * @return player */ getVolume: function getVolume() { - console.log("\u83B7\u53D6\u5F53\u524D\u7684\u97F3\u91CF".concat(this.player.getVolume(), "\u3002")); + // console.log(`获取当前的音量${this.player.getVolume()}。`); return this.player.getVolume(); }, @@ -417,7 +418,7 @@ var staticRenderFns = [] * @return player */ setVolume: function setVolume(v) { - console.log("\u8BBE\u7F6E\u97F3\u91CF\uFF0Cvol\u4E3A".concat(v, "\u3002")); + // console.log(`设置音量,vol为${v}。`); this.player.setVolume(v); }, @@ -427,7 +428,7 @@ var staticRenderFns = [] * @return player */ loadByUrl: function loadByUrl(url, time) { - console.log("\u76F4\u63A5\u64AD\u653E\u89C6\u9891url".concat(url, "\uFF0Ctime\u4E3A").concat(time, "\u3002")); + // console.log(`直接播放视频url${url},time为${time}。`); this.player.loadByUrl(url, time); }, @@ -437,7 +438,7 @@ var staticRenderFns = [] * @param 播放凭证 */ replayByVidAndPlayAuth: function replayByVidAndPlayAuth(vid, playauth) { - console.log("replayByVidAndPlayAuth vid".concat(vid, "\uFF0Cplayauth\u4E3A").concat(playauth, "\u3002")); + // console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`); this.player.replayByVidAndPlayAuth(vid, playauth); }, @@ -448,7 +449,7 @@ var staticRenderFns = [] * @description 仅MPS用户时使用 仅MPS用户时使用 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion */ replayByVidAndAuthInfo: function replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion) { - console.log("replayByVidAndAuthInfo \u53C2\u6570\u987A\u5E8F\u4E3A\uFF1Avid\u3001accId\u3001accSecret\u3001stsToken\u3001authInfo\u3001domainRegion", vid, accId, accSecret, stsToken, authInfo, domainRegion); + // console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion); this.player.replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion); }, @@ -459,7 +460,7 @@ var staticRenderFns = [] * @description chrome浏览器下flash播放器分别不能小于397x297。 */ setPlayerSize: function setPlayerSize(w, h) { - console.log("\u8BBE\u7F6E\u64AD\u653E\u5668\u5927\u5C0F \u5BBD\u5EA6:".concat(w, ",\u9AD8\u5EA6:").concat(h)); + // console.log(`设置播放器大小 宽度:${w},高度:${h}`); this.player.setPlayerSize(w, h); }, @@ -471,7 +472,7 @@ var staticRenderFns = [] * @description {name:“speedButton”,align:“tr”,x:10,y:23} */ setSpeed: function setSpeed(speed) { - console.log("\u624B\u52A8\u8BBE\u7F6E\u64AD\u653E\u7684\u500D\u901F:".concat(speed)); + // console.log(`手动设置播放的倍速:${speed}`); this.player.setSpeed(speed); }, @@ -482,7 +483,7 @@ var staticRenderFns = [] * @param rate 截图质量 */ setSanpshotProperties: function setSanpshotProperties(width, height, rate) { - console.log("\u8BBE\u7F6E\u622A\u56FE\u53C2\u6570:", width, height, rate); + // console.log(`设置截图参数:`,width, height, rate); this.player.setSanpshotProperties(width, height, rate); }, @@ -490,7 +491,7 @@ var staticRenderFns = [] * 播放器全屏,仅H5支持。 */ requestFullScreen: function requestFullScreen() { - console.log("\u64AD\u653E\u5668\u5168\u5C4F\uFF0C\u4EC5H5\u652F\u6301"); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.requestFullScreen(); }, @@ -498,7 +499,7 @@ var staticRenderFns = [] * 播放器退出全屏,iOS调用无效,仅H5支持。 */ cancelFullScreen: function cancelFullScreen() { - console.log("\u64AD\u653E\u5668\u5168\u5C4F\uFF0C\u4EC5H5\u652F\u6301"); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.cancelFullScreen(); }, @@ -506,7 +507,7 @@ var staticRenderFns = [] * 获取播放器全屏状态,仅H5支持。 */ getIsFullScreen: function getIsFullScreen() { - console.log("\u83B7\u53D6\u64AD\u653E\u5668\u5168\u5C4F\u72B6\u6001\uFF0C\u4EC5H5\u652F\u6301\u3002", this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); + // console.log(`获取播放器全屏状态,仅H5支持。`,this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); return this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen(); }, @@ -515,7 +516,7 @@ var staticRenderFns = [] * @returns init ready loading play pause playing waiting error ended */ getStatus: function getStatus() { - console.log("\u83B7\u53D6\u64AD\u653E\u5668\u72B6\u6001\uFF0C\u5305\u542B\u7684\u503C", this.player.fullscreenService && this.player.fullscreenService.getStatus()); + // console.log(`获取播放器状态,包含的值`,this.player.fullscreenService && this.player.fullscreenService.getStatus()); return this.player.fullscreenService && this.player.fullscreenService.getStatus(); }, @@ -526,7 +527,7 @@ var staticRenderFns = [] * @description 例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’) */ setLiveTimeRange: function setLiveTimeRange(beginTime, endTime) { - console.log("\u8BBE\u7F6E\u76F4\u64AD\u7684\u5F00\u59CB\u65F6\u95F4:".concat(beginTime, ",\u7ED3\u675F\u65F6\u95F4:").concat(endTime, "\uFF0C\u5F00\u542F\u76F4\u64AD\u65F6\u79FB\u529F\u80FD\u65F6\u4F7F\u7528\u3002")); + // console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`); this.player.liveShiftSerivce && this.player.liveShiftSerivce.setLiveTimeRange(beginTime, endTime); }, @@ -536,7 +537,7 @@ var staticRenderFns = [] * @description 例如: setRotate(90)。详情参见旋转和镜像。 */ setRotate: function setRotate(rotate) { - console.log("\u53C2\u6570\u4E3A\u65CB\u8F6C\u89D2\u5EA6:".concat(rotate, "\u3002")); + // console.log(`参数为旋转角度:${rotate}。`); this.player.setRotate(rotate); }, @@ -545,7 +546,7 @@ var staticRenderFns = [] * @return rotate 旋转角度 */ getRotate: function getRotate() { - console.log("\u83B7\u53D6\u65CB\u8F6C\u89D2\u5EA6:".concat(this.player.getRotate())); + // console.log(`获取旋转角度:${this.player.getRotate()}`); return this.player.getRotate(); }, @@ -555,7 +556,7 @@ var staticRenderFns = [] * @description 例如: setImage(‘horizon’)。详情参见旋转和镜像。 */ setImage: function setImage(image) { - console.log("\u8BBE\u7F6E\u955C\u50CF:".concat(image, "\u3002")); + // console.log(`设置镜像:${image}。`); this.player.setImage(image); }, @@ -563,7 +564,7 @@ var staticRenderFns = [] * 播放器销毁 */ dispose: function dispose() { - console.log("\u64AD\u653E\u5668\u9500\u6BC1\u3002"); + // console.log(`播放器销毁。`); this.player.dispose(); }, @@ -572,7 +573,7 @@ var staticRenderFns = [] * @param cover 封面地址 */ setCover: function setCover(cover) { - console.log("\u8BBE\u7F6E\u5C01\u9762:".concat(cover)); + // console.log(`设置封面:${cover}`); this.player.setCover(cover); }, @@ -581,7 +582,7 @@ var staticRenderFns = [] * @param markers 设置打点数据 */ setProgressMarkers: function setProgressMarkers(markers) { - console.log("markers\u6253\u70B9\u6570\u636E\u96C6\u5408:".concat(markers)); + // console.log(`markers打点数据集合:${markers}`); this.player.setProgressMarkers(markers); }, @@ -590,7 +591,7 @@ var staticRenderFns = [] * @param time 试看时间 */ setPreviewTime: function setPreviewTime(time) { - console.log("\u8BBE\u7F6E\u8BD5\u770B\u65F6\u95F4\uFF0C\u5355\u4F4D\u4E3A:".concat(time, "\u79D2")); + // console.log(`设置试看时间,单位为:${time}秒`); this.player.setPreviewTime(time); }, @@ -599,7 +600,7 @@ var staticRenderFns = [] * @return rotate 旋转角度 */ getPreviewTime: function getPreviewTime() { - console.log("\u83B7\u53D6\u8BD5\u770B\u65F6\u95F4:".concat(this.player.getPreviewTime())); + // console.log(`获取试看时间:${this.player.getPreviewTime()}`); return this.player.getPreviewTime(); }, @@ -607,8 +608,16 @@ var staticRenderFns = [] * 是否试看 */ isPreview: function isPreview() { - console.log("\u662F\u5426\u8BD5\u770B"); + // console.log(`是否试看`); this.player.isPreview(); + }, + + /** + * @param ev 事件名 + * @param handle 回调方法 + */ + off: function off(ev, handle) { + this.player.off(ev, handle); } } }); diff --git a/lib/vue-aliplayer-v2.umd.js b/lib/vue-aliplayer-v2.umd.js index 74b015a..cf22750 100644 --- a/lib/vue-aliplayer-v2.umd.js +++ b/lib/vue-aliplayer-v2.umd.js @@ -136,12 +136,12 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7cfd"); -// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=0fd39c20& +// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=66e79580& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.id}})} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=0fd39c20& +// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=66e79580& // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=script&lang=js& // @@ -292,6 +292,8 @@ var staticRenderFns = [] if (!document.getElementById(linkID)) { var link = document.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; link.href = this.config.cssLink; link.setAttribute('id', linkID); head[0].appendChild(link); @@ -299,8 +301,8 @@ var staticRenderFns = [] if (!scriptTag) { scriptTag = document.createElement('script'); - scriptTag.id = scriptID; scriptTag.type = "text/javascript"; + scriptTag.id = scriptID; scriptTag.src = this.config.scriptSrc; html[0].appendChild(scriptTag); } @@ -339,8 +341,7 @@ var staticRenderFns = [] var _loop = function _loop(ev) { _this4.player.on(_this4.events[ev], function (e) { - console.log("object ".concat(_this4.events[ev]), e); - + // console.log(`object ${this.events[ev]}`,e); _this4.$emit(_this4.events[ev], e); }); }; @@ -364,7 +365,7 @@ var staticRenderFns = [] * 播放视频。 */ play: function play() { - console.log("\u64AD\u653E\u89C6\u9891\u3002"); + // console.log(`播放视频。`); this.player.play(); }, @@ -372,7 +373,7 @@ var staticRenderFns = [] * 暂停视频 */ pause: function pause() { - console.log("\u6682\u505C\u89C6\u9891"); + // console.log(`暂停视频`); this.player.pause(); }, @@ -380,7 +381,7 @@ var staticRenderFns = [] * 重播视频 */ replay: function replay() { - console.log("\u91CD\u64AD\u89C6\u9891"); + // console.log(`重播视频`); this.player.replay(); }, @@ -390,7 +391,7 @@ var staticRenderFns = [] * @return player */ seek: function seek(time) { - console.log("\u8DF3\u8F6C\u5230\u67D0\u4E2A\u65F6\u523B\u8FDB\u884C\u64AD\u653E\uFF0Ctime\u4E3A".concat(time, "\u79D2\u3002")); + // console.log(`跳转到某个时刻进行播放,time为${time}秒。`); this.player.seek(time); }, @@ -399,7 +400,7 @@ var staticRenderFns = [] * @return player */ getCurrentTime: function getCurrentTime() { - console.log("\u83B7\u53D6\u5F53\u524D\u7684\u64AD\u653E\u65F6\u523B\uFF0C\u8FD4\u56DE\u7684\u5355\u4F4D\u4E3A".concat(this.player.getCurrentTime(), "\u79D2\u3002")); + // console.log(`获取当前的播放时刻,返回的单位为${this.player.getCurrentTime()}秒。`); return this.player.getCurrentTime(); }, @@ -408,7 +409,7 @@ var staticRenderFns = [] * @return player */ getDuration: function getDuration() { - console.log("\u83B7\u53D6\u89C6\u9891\u603B\u65F6\u957F\uFF0C\u8FD4\u56DE\u7684\u5355\u4F4D\u4E3A".concat(this.player.getDuration(), "\u79D2\u3002")); + // console.log(`获取视频总时长,返回的单位为${this.player.getDuration()}秒。`); return this.player.getDuration(); }, @@ -417,7 +418,7 @@ var staticRenderFns = [] * @return player */ getVolume: function getVolume() { - console.log("\u83B7\u53D6\u5F53\u524D\u7684\u97F3\u91CF".concat(this.player.getVolume(), "\u3002")); + // console.log(`获取当前的音量${this.player.getVolume()}。`); return this.player.getVolume(); }, @@ -426,7 +427,7 @@ var staticRenderFns = [] * @return player */ setVolume: function setVolume(v) { - console.log("\u8BBE\u7F6E\u97F3\u91CF\uFF0Cvol\u4E3A".concat(v, "\u3002")); + // console.log(`设置音量,vol为${v}。`); this.player.setVolume(v); }, @@ -436,7 +437,7 @@ var staticRenderFns = [] * @return player */ loadByUrl: function loadByUrl(url, time) { - console.log("\u76F4\u63A5\u64AD\u653E\u89C6\u9891url".concat(url, "\uFF0Ctime\u4E3A").concat(time, "\u3002")); + // console.log(`直接播放视频url${url},time为${time}。`); this.player.loadByUrl(url, time); }, @@ -446,7 +447,7 @@ var staticRenderFns = [] * @param 播放凭证 */ replayByVidAndPlayAuth: function replayByVidAndPlayAuth(vid, playauth) { - console.log("replayByVidAndPlayAuth vid".concat(vid, "\uFF0Cplayauth\u4E3A").concat(playauth, "\u3002")); + // console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`); this.player.replayByVidAndPlayAuth(vid, playauth); }, @@ -457,7 +458,7 @@ var staticRenderFns = [] * @description 仅MPS用户时使用 仅MPS用户时使用 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion */ replayByVidAndAuthInfo: function replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion) { - console.log("replayByVidAndAuthInfo \u53C2\u6570\u987A\u5E8F\u4E3A\uFF1Avid\u3001accId\u3001accSecret\u3001stsToken\u3001authInfo\u3001domainRegion", vid, accId, accSecret, stsToken, authInfo, domainRegion); + // console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion); this.player.replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion); }, @@ -468,7 +469,7 @@ var staticRenderFns = [] * @description chrome浏览器下flash播放器分别不能小于397x297。 */ setPlayerSize: function setPlayerSize(w, h) { - console.log("\u8BBE\u7F6E\u64AD\u653E\u5668\u5927\u5C0F \u5BBD\u5EA6:".concat(w, ",\u9AD8\u5EA6:").concat(h)); + // console.log(`设置播放器大小 宽度:${w},高度:${h}`); this.player.setPlayerSize(w, h); }, @@ -480,7 +481,7 @@ var staticRenderFns = [] * @description {name:“speedButton”,align:“tr”,x:10,y:23} */ setSpeed: function setSpeed(speed) { - console.log("\u624B\u52A8\u8BBE\u7F6E\u64AD\u653E\u7684\u500D\u901F:".concat(speed)); + // console.log(`手动设置播放的倍速:${speed}`); this.player.setSpeed(speed); }, @@ -491,7 +492,7 @@ var staticRenderFns = [] * @param rate 截图质量 */ setSanpshotProperties: function setSanpshotProperties(width, height, rate) { - console.log("\u8BBE\u7F6E\u622A\u56FE\u53C2\u6570:", width, height, rate); + // console.log(`设置截图参数:`,width, height, rate); this.player.setSanpshotProperties(width, height, rate); }, @@ -499,7 +500,7 @@ var staticRenderFns = [] * 播放器全屏,仅H5支持。 */ requestFullScreen: function requestFullScreen() { - console.log("\u64AD\u653E\u5668\u5168\u5C4F\uFF0C\u4EC5H5\u652F\u6301"); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.requestFullScreen(); }, @@ -507,7 +508,7 @@ var staticRenderFns = [] * 播放器退出全屏,iOS调用无效,仅H5支持。 */ cancelFullScreen: function cancelFullScreen() { - console.log("\u64AD\u653E\u5668\u5168\u5C4F\uFF0C\u4EC5H5\u652F\u6301"); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.cancelFullScreen(); }, @@ -515,7 +516,7 @@ var staticRenderFns = [] * 获取播放器全屏状态,仅H5支持。 */ getIsFullScreen: function getIsFullScreen() { - console.log("\u83B7\u53D6\u64AD\u653E\u5668\u5168\u5C4F\u72B6\u6001\uFF0C\u4EC5H5\u652F\u6301\u3002", this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); + // console.log(`获取播放器全屏状态,仅H5支持。`,this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); return this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen(); }, @@ -524,7 +525,7 @@ var staticRenderFns = [] * @returns init ready loading play pause playing waiting error ended */ getStatus: function getStatus() { - console.log("\u83B7\u53D6\u64AD\u653E\u5668\u72B6\u6001\uFF0C\u5305\u542B\u7684\u503C", this.player.fullscreenService && this.player.fullscreenService.getStatus()); + // console.log(`获取播放器状态,包含的值`,this.player.fullscreenService && this.player.fullscreenService.getStatus()); return this.player.fullscreenService && this.player.fullscreenService.getStatus(); }, @@ -535,7 +536,7 @@ var staticRenderFns = [] * @description 例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’) */ setLiveTimeRange: function setLiveTimeRange(beginTime, endTime) { - console.log("\u8BBE\u7F6E\u76F4\u64AD\u7684\u5F00\u59CB\u65F6\u95F4:".concat(beginTime, ",\u7ED3\u675F\u65F6\u95F4:").concat(endTime, "\uFF0C\u5F00\u542F\u76F4\u64AD\u65F6\u79FB\u529F\u80FD\u65F6\u4F7F\u7528\u3002")); + // console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`); this.player.liveShiftSerivce && this.player.liveShiftSerivce.setLiveTimeRange(beginTime, endTime); }, @@ -545,7 +546,7 @@ var staticRenderFns = [] * @description 例如: setRotate(90)。详情参见旋转和镜像。 */ setRotate: function setRotate(rotate) { - console.log("\u53C2\u6570\u4E3A\u65CB\u8F6C\u89D2\u5EA6:".concat(rotate, "\u3002")); + // console.log(`参数为旋转角度:${rotate}。`); this.player.setRotate(rotate); }, @@ -554,7 +555,7 @@ var staticRenderFns = [] * @return rotate 旋转角度 */ getRotate: function getRotate() { - console.log("\u83B7\u53D6\u65CB\u8F6C\u89D2\u5EA6:".concat(this.player.getRotate())); + // console.log(`获取旋转角度:${this.player.getRotate()}`); return this.player.getRotate(); }, @@ -564,7 +565,7 @@ var staticRenderFns = [] * @description 例如: setImage(‘horizon’)。详情参见旋转和镜像。 */ setImage: function setImage(image) { - console.log("\u8BBE\u7F6E\u955C\u50CF:".concat(image, "\u3002")); + // console.log(`设置镜像:${image}。`); this.player.setImage(image); }, @@ -572,7 +573,7 @@ var staticRenderFns = [] * 播放器销毁 */ dispose: function dispose() { - console.log("\u64AD\u653E\u5668\u9500\u6BC1\u3002"); + // console.log(`播放器销毁。`); this.player.dispose(); }, @@ -581,7 +582,7 @@ var staticRenderFns = [] * @param cover 封面地址 */ setCover: function setCover(cover) { - console.log("\u8BBE\u7F6E\u5C01\u9762:".concat(cover)); + // console.log(`设置封面:${cover}`); this.player.setCover(cover); }, @@ -590,7 +591,7 @@ var staticRenderFns = [] * @param markers 设置打点数据 */ setProgressMarkers: function setProgressMarkers(markers) { - console.log("markers\u6253\u70B9\u6570\u636E\u96C6\u5408:".concat(markers)); + // console.log(`markers打点数据集合:${markers}`); this.player.setProgressMarkers(markers); }, @@ -599,7 +600,7 @@ var staticRenderFns = [] * @param time 试看时间 */ setPreviewTime: function setPreviewTime(time) { - console.log("\u8BBE\u7F6E\u8BD5\u770B\u65F6\u95F4\uFF0C\u5355\u4F4D\u4E3A:".concat(time, "\u79D2")); + // console.log(`设置试看时间,单位为:${time}秒`); this.player.setPreviewTime(time); }, @@ -608,7 +609,7 @@ var staticRenderFns = [] * @return rotate 旋转角度 */ getPreviewTime: function getPreviewTime() { - console.log("\u83B7\u53D6\u8BD5\u770B\u65F6\u95F4:".concat(this.player.getPreviewTime())); + // console.log(`获取试看时间:${this.player.getPreviewTime()}`); return this.player.getPreviewTime(); }, @@ -616,8 +617,16 @@ var staticRenderFns = [] * 是否试看 */ isPreview: function isPreview() { - console.log("\u662F\u5426\u8BD5\u770B"); + // console.log(`是否试看`); this.player.isPreview(); + }, + + /** + * @param ev 事件名 + * @param handle 回调方法 + */ + off: function off(ev, handle) { + this.player.off(ev, handle); } } }); diff --git a/lib/vue-aliplayer-v2.umd.min.js b/lib/vue-aliplayer-v2.umd.min.js index bc22642..6319289 100644 --- a/lib/vue-aliplayer-v2.umd.min.js +++ b/lib/vue-aliplayer-v2.umd.min.js @@ -1,2 +1,2 @@ -(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 o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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 o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.id}})},i=[],c={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",o=document.getElementsByTagName("head"),i=document.getElementsByTagName("html"),c=document.getElementById(r);if(!document.getElementById(n)){var l=document.createElement("link");l.href=this.config.cssLink,l.setAttribute("id",n),o[0].appendChild(l)}c||(c=document.createElement("script"),c.id=r,c.type="text/javascript",c.src=this.config.scriptSrc,i[0].appendChild(c)),c.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 o in this.events)r(o)}},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,o,i){console.log("replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion",e,t,n,r,o,i),this.player.replayByVidAndAuthInfo(e,t,n,r,o,i)},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()}}},l=c;function a(e,t,n,r,o,i,c,l){var a,s="function"===typeof e?e.options:e;if(t&&(s.render=t,s.staticRenderFns=n,s._compiled=!0),r&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),c?(a=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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(c)},s._ssrRegister=a):o&&(a=l?function(){o.call(this,this.$root.$options.shadowRoot)}:o),a)if(s.functional){s._injectStyles=a;var u=s.render;s.render=function(e,t){return a.call(t),u(e,t)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,a):[a]}return{exports:e,options:s}}var s=a(l,o,i,!1,null,null,null),u=s.exports;u.install=function(e){e.component(u.name,u)};var f=u,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,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;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"),o=n("3f8b").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"7cfd":function(e,t,n){var r=n("d3d8").f,o=Function.prototype,i=/^\s*function ([^ (]*)/,c="name";c in o||n("f9a5")&&r(o,c,{configurable:!0,get:function(){try{return(""+this).match(i)[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"),o=n("25ae"),i=n("2ab1"),c=Object.defineProperty;t.f=n("f9a5")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return c(e,t,n)}catch(l){}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}))}})})); +(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=!0,n="aliplayer-min-css",r="aliplayer-min-js",i=document.getElementsByTagName("head"),o=document.getElementsByTagName("html"),a=document.getElementById(r);if(!document.getElementById(n)){var u=document.createElement("link");u.type="text/css",u.rel="stylesheet",u.href=this.config.cssLink,u.setAttribute("id",n),i[0].appendChild(u)}a||(a=document.createElement("script"),a.type="text/javascript",a.id=r,a.src=this.config.scriptSrc,o[0].appendChild(a)),a.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){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 \ No newline at end of file diff --git a/package.json b/package.json index 4102465..d99dee0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-aliplayer-v2", - "version": "1.0.7", + "version": "1.0.9", "author": "yxs", "description": "感谢每一位开源的开发者. 这是一个基于Alipayer 开发并封装成vue组件的播放器.", "main":"lib/vue-aliplayer-v2.umd.min.js", diff --git a/packages/AliplayerV2/src/main.vue b/packages/AliplayerV2/src/main.vue index 26de433..bde467a 100644 --- a/packages/AliplayerV2/src/main.vue +++ b/packages/AliplayerV2/src/main.vue @@ -179,7 +179,7 @@ export default { }); for(const ev in this.events){ this.player.on(this.events[ev],(e)=>{ - console.log(`object ${this.events[ev]}`,e); + // console.log(`object ${this.events[ev]}`,e); this.$emit(this.events[ev],e); }); } @@ -199,7 +199,7 @@ export default { * 播放视频。 */ play(){ - console.log(`播放视频。`); + // console.log(`播放视频。`); this.player.play(); }, @@ -207,7 +207,7 @@ export default { * 暂停视频 */ pause(){ - console.log(`暂停视频`); + // console.log(`暂停视频`); this.player.pause(); }, @@ -215,7 +215,7 @@ export default { * 重播视频 */ replay(){ - console.log(`重播视频`); + // console.log(`重播视频`); this.player.replay(); }, @@ -225,7 +225,7 @@ export default { * @return player */ seek(time){ - console.log(`跳转到某个时刻进行播放,time为${time}秒。`); + // console.log(`跳转到某个时刻进行播放,time为${time}秒。`); this.player.seek(time); }, @@ -234,7 +234,7 @@ export default { * @return player */ getCurrentTime(){ - console.log(`获取当前的播放时刻,返回的单位为${this.player.getCurrentTime()}秒。`); + // console.log(`获取当前的播放时刻,返回的单位为${this.player.getCurrentTime()}秒。`); return this.player.getCurrentTime(); }, @@ -243,7 +243,7 @@ export default { * @return player */ getDuration(){ - console.log(`获取视频总时长,返回的单位为${this.player.getDuration()}秒。`); + // console.log(`获取视频总时长,返回的单位为${this.player.getDuration()}秒。`); return this.player.getDuration(); }, @@ -252,7 +252,7 @@ export default { * @return player */ getVolume(){ - console.log(`获取当前的音量${this.player.getVolume()}。`); + // console.log(`获取当前的音量${this.player.getVolume()}。`); return this.player.getVolume(); }, @@ -261,7 +261,7 @@ export default { * @return player */ setVolume(v){ - console.log(`设置音量,vol为${v}。`); + // console.log(`设置音量,vol为${v}。`); this.player.setVolume(v); }, @@ -271,7 +271,7 @@ export default { * @return player */ loadByUrl(url, time){ - console.log(`直接播放视频url${url},time为${time}。`); + // console.log(`直接播放视频url${url},time为${time}。`); this.player.loadByUrl(url, time); }, @@ -281,7 +281,7 @@ export default { * @param 播放凭证 */ replayByVidAndPlayAuth(vid, playauth){ - console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`); + // console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`); this.player.replayByVidAndPlayAuth(vid, playauth); }, @@ -292,7 +292,7 @@ export default { * @description 仅MPS用户时使用 仅MPS用户时使用 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion */ replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion){ - console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion); + // console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion); this.player.replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion); }, @@ -303,7 +303,7 @@ export default { * @description chrome浏览器下flash播放器分别不能小于397x297。 */ setPlayerSize(w, h){ - console.log(`设置播放器大小 宽度:${w},高度:${h}`); + // console.log(`设置播放器大小 宽度:${w},高度:${h}`); this.player.setPlayerSize(w, h); }, @@ -315,7 +315,7 @@ export default { * @description {name:“speedButton”,align:“tr”,x:10,y:23} */ setSpeed(speed){ - console.log(`手动设置播放的倍速:${speed}`); + // console.log(`手动设置播放的倍速:${speed}`); this.player.setSpeed(speed); }, @@ -326,7 +326,7 @@ export default { * @param rate 截图质量 */ setSanpshotProperties(width, height, rate){ - console.log(`设置截图参数:`,width, height, rate); + // console.log(`设置截图参数:`,width, height, rate); this.player.setSanpshotProperties(width, height, rate); }, @@ -334,7 +334,7 @@ export default { * 播放器全屏,仅H5支持。 */ requestFullScreen(){ - console.log(`播放器全屏,仅H5支持`); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.requestFullScreen(); }, @@ -342,7 +342,7 @@ export default { * 播放器退出全屏,iOS调用无效,仅H5支持。 */ cancelFullScreen(){ - console.log(`播放器全屏,仅H5支持`); + // console.log(`播放器全屏,仅H5支持`); this.player.fullscreenService && this.player.fullscreenService.cancelFullScreen(); }, @@ -350,7 +350,7 @@ export default { * 获取播放器全屏状态,仅H5支持。 */ getIsFullScreen(){ - console.log(`获取播放器全屏状态,仅H5支持。`,this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); + // console.log(`获取播放器全屏状态,仅H5支持。`,this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen()); return this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen(); }, @@ -359,7 +359,7 @@ export default { * @returns init ready loading play pause playing waiting error ended */ getStatus(){ - console.log(`获取播放器状态,包含的值`,this.player.fullscreenService && this.player.fullscreenService.getStatus()); + // console.log(`获取播放器状态,包含的值`,this.player.fullscreenService && this.player.fullscreenService.getStatus()); return this.player.fullscreenService && this.player.fullscreenService.getStatus(); }, @@ -370,7 +370,7 @@ export default { * @description 例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’) */ setLiveTimeRange(beginTime, endTime){ - console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`); + // console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`); this.player.liveShiftSerivce && this.player.liveShiftSerivce.setLiveTimeRange(beginTime, endTime); }, @@ -380,7 +380,7 @@ export default { * @description 例如: setRotate(90)。详情参见旋转和镜像。 */ setRotate(rotate){ - console.log(`参数为旋转角度:${rotate}。`); + // console.log(`参数为旋转角度:${rotate}。`); this.player.setRotate(rotate); }, @@ -389,7 +389,7 @@ export default { * @return rotate 旋转角度 */ getRotate(){ - console.log(`获取旋转角度:${this.player.getRotate()}`); + // console.log(`获取旋转角度:${this.player.getRotate()}`); return this.player.getRotate(); }, @@ -399,7 +399,7 @@ export default { * @description 例如: setImage(‘horizon’)。详情参见旋转和镜像。 */ setImage(image){ - console.log(`设置镜像:${image}。`); + // console.log(`设置镜像:${image}。`); this.player.setImage(image); }, @@ -407,7 +407,7 @@ export default { * 播放器销毁 */ dispose(){ - console.log(`播放器销毁。`); + // console.log(`播放器销毁。`); this.player.dispose(); }, @@ -416,7 +416,7 @@ export default { * @param cover 封面地址 */ setCover(cover){ - console.log(`设置封面:${cover}`); + // console.log(`设置封面:${cover}`); this.player.setCover(cover); }, @@ -425,7 +425,7 @@ export default { * @param markers 设置打点数据 */ setProgressMarkers(markers){ - console.log(`markers打点数据集合:${markers}`); + // console.log(`markers打点数据集合:${markers}`); this.player.setProgressMarkers(markers); }, @@ -434,7 +434,7 @@ export default { * @param time 试看时间 */ setPreviewTime(time){ - console.log(`设置试看时间,单位为:${time}秒`); + // console.log(`设置试看时间,单位为:${time}秒`); this.player.setPreviewTime(time); }, @@ -443,7 +443,7 @@ export default { * @return rotate 旋转角度 */ getPreviewTime(){ - console.log(`获取试看时间:${this.player.getPreviewTime()}`); + // console.log(`获取试看时间:${this.player.getPreviewTime()}`); return this.player.getPreviewTime(); }, @@ -451,7 +451,7 @@ export default { * 是否试看 */ isPreview(){ - console.log(`是否试看`); + // console.log(`是否试看`); this.player.isPreview(); }, diff --git a/vue-aliplayer-v2.zip b/vue-aliplayer-v2.zip new file mode 100644 index 0000000..8996c88 Binary files /dev/null and b/vue-aliplayer-v2.zip differ