我想有个需求就是必须登陆能才能看视频,所以要再它点播放时判断它有登陆时再继续。
但是看了vue-video-player的文档不是很明白
vue-video-player
<video-player :options="videoOptions" @my-player-state-changed-event-custom-name="playerStateChanged" ref="myPlayer"></video-player>
videoOptions: {
source: {
type: "video/webm",
src: 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm',
},
autoplay: false,
language: 'zh-CN',
play: 'my-player-state-changed-event-custom-name'
}
computed: {
player() {
return this.$refs.myPlayer.player
}
},
methods:{
playerStateChanged(playerCurrentState) {
console.log(playerCurrentState);
}
},
我这样并不生效,求正确写法
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…