安装依赖
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" />