Uncaught (in promise) DOMException: play() failed because the user didn’t interact with the document
未捕获(承诺中)DOMException: play()失败,因为用户没有首先与文档交互。
需要讲play()定义在一个按钮身上
<template>
<div class="hello">
<div id="wrapper" style="width:500px;height:600px;"></div>
<button @click="bofang">播放</button>
</div>
</template>
bofang() {
this.pla.play();
}
这样就不报错了!!
摘自 https://cplvfx.blog.csdn.net/article/details/108453567