安装依赖
npm install @easydarwin/easyplayer --save
npm install copy-webpack-plugin@5.1.2 --save-dev
找到public/index.html
在node_modeols里面找到@easydarwin下的dist/compent/EasyPlayer-lib.min.js和EasyPlayer.wasm两个文件复制到pubilc目录下
引入
<script src="./EasyPlayer-lib.min.js"></script>
再要播放的地方
1、引入
import EasyPlayer from "@easydarwin/easyplayer"
2、注册
在components中
components:{EasyPlayer}
3、使用组件
在模板中
<EasyPlayer :id="Math.floor(Math.random()*1+1)" :videoUrl=item :live="true" />
4、样式自己调整
5、双击可全屏
结果
![在这里插入图片描述](https://img-blog.csdnimg.cn/de6573b7eaac4b8f90a13d68deed93ac.png)