直播播放器效果设置(视频)

new Vue({ el: '#player', data() { return { vodPlayerJs: 'https://player.polyv.net/script/player.js', vid: '88083abbf51700c8b115b0be6ef62dd3_8', }; }, mounted(){ this.loadPlayerScript(this.loadPlayer); }, methods: { loadPlayerScript(callback) { if (!window.polyvPlayer) { const myScript = document.createElement('script'); myScript.setAttribute('src', this.vodPlayerJs); myScript.onload = callback; document.body.appendChild(myScript); } else { callback(); } }, loadPlayer() { const polyvPlayer = window.polyvPlayer; this.player = polyvPlayer({ wrap: '#player', vid: this.vid , autoplay:false }); } }, destroyed() { if (this.player) { this.player.destroy(); } } })

视频说明

1.在直播后台里找到并点击【频道列表】,然后点击需要修改的频道号。 2.点击左侧菜单的【播放器设置】,可以设置播放器的颜色以及是否自动播放。

 

Last updated