|
@@ -68,6 +68,7 @@ export default {
|
|
|
}); // player-container-id 为播放器容器 ID,必须与 html 中一致
|
|
|
if (this.player) {
|
|
|
this.player.src(this.src); // url 播放地址
|
|
|
+ this.player.poster(this.poster || "");
|
|
|
// this.player.elements.container ? (this.player.elements.container.style.height = this.height || "2rem") : null;
|
|
|
|
|
|
this.player.on("play", () => {
|
|
@@ -94,9 +95,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
- this.player.destroy();
|
|
|
- this.player.pause();
|
|
|
- this.player.src("");
|
|
|
+ if (this.player) {
|
|
|
+ this.player.destroy();
|
|
|
+ this.player.pause();
|
|
|
+ this.player.src("");
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|