diff --git a/README.md b/README.md index cdea541..6da5755 100644 --- a/README.md +++ b/README.md @@ -375,6 +375,9 @@ See [Configuration Reference](https://cli.vuejs.org/config/). ## 更新日志 +> v1.1.8 修复播放源(增加source属性类型错误),修复获取播放器状态 getStatus()方法报错, 感谢"kongjigu"网友的反馈. + > v1.1.7 增加动态切换播放源(增加source属性)功能 感谢"wikimo"和"jieruian"两位网友的反馈建议. + > v1.1.6 修复部分已知bug和优化局部的引用方式 diff --git a/examples/App.vue b/examples/App.vue index fd38437..e04cb62 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -10,6 +10,7 @@ 重播 播放时刻 {{ show ? '销毁' : '重载' }} + 获取播放器状态
选择播放源(支持动态切换): @@ -55,6 +56,12 @@ export default { getCurrentTime(){ this.$refs.VueAliplayerV2.getCurrentTime(); + }, + + getStatus(){ + const status = this.$refs.VueAliplayerV2.getStatus(); + console.log(`getStatus:`, status); + alert(`getStatus:${status}`); } } } diff --git a/package.json b/package.json index baa6a36..1659f23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-aliplayer-v2", - "version": "1.1.7", + "version": "1.1.8", "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 9517407..2cde949 100644 --- a/packages/AliplayerV2/src/main.vue +++ b/packages/AliplayerV2/src/main.vue @@ -12,7 +12,7 @@ export default { }, source: { //播放源(此属性存在则优先于options.source) 动态切换,目前只支持同种格式(mp4/flv/m3u8)之间切换。暂不支持直播rtmp流切换。 required: false, - type: [Object], + type: [String], default: () => null }, id:{ @@ -385,7 +385,7 @@ export default { */ getStatus(){ // console.log(`获取播放器状态,包含的值`,this.player && this.player.fullscreenService && this.player && this.player.fullscreenService.getStatus()); - return this.player && this.player.fullscreenService && this.player.fullscreenService.getStatus(); + return this.player && this.player.getStatus(); }, /**