vue-aliplayerVue 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() } }
评论