使用说明
Last updated
本文为保利威旗下产品【研讨会】功能说明,从各角色出发,以“操作说明+应用场景”的形式进行说明,帮助用户尽快上手使用,挖掘更多玩法。功能更新后,说明会随之调整,敬请留意。
new Vue({ el: '#player', data() { return { vodPlayerJs: 'https://player.polyv.net/script/player.js', vid:'88083abbf5cdf2143051cbbbbd904194_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(); } } })