vue-aliplayer Vue 2.0 阿里云播放器组件 项目简介
该软件为 vue2.0 的阿里云播放器组件安装npm install vue-aliplayer -S
yarn add vue-aliplayer -S使用import VueAliplayer from 'vue-aliplayer'
export default {
components: {
'ali-player': VueAliplayer
}
}示例<ali-player :source="视频url" :vid="视频vid" :playauth="播放鉴权" ref="player"></ali-player>
<button @click="play">播放</button>
<button @click="pause">暂停</button>
<button @click="replay">重播</button>
export default {
methods: {
play: function(){
const player = this.$refs.player.instance
player && player.play()
},
pause: function() {
const player = this.$refs.player.instance
player && player.pause()
},
replay: function() {
const player = this.$refs.player.instance
player && player.replay()
}
}
yarn add vue-aliplayer -S使用import VueAliplayer from 'vue-aliplayer'
export default {
components: {
'ali-player': VueAliplayer
}
}示例<ali-player :source="视频url" :vid="视频vid" :playauth="播放鉴权" ref="player"></ali-player>
<button @click="play">播放</button>
<button @click="pause">暂停</button>
<button @click="replay">重播</button>
export default {
methods: {
play: function(){
const player = this.$refs.player.instance
player && player.play()
},
pause: function() {
const player = this.$refs.player.instance
player && player.pause()
},
replay: function() {
const player = this.$refs.player.instance
player && player.replay()
}
}