当前位置: 首页 > Web前端 > vue.js

vue中的easyplayer使用

时间:2023-04-01 12:46:02 vue.js

1.npminstalleasyplayer,copy-webpack-pluginnpminstall@easydarwin/easyplayer--savenpminstallcopy-webpack-plugin@4.0.1--save-dev也可以直接在package.json文件中加上版本号,然后执行yarninstall或npminstall:"dependencies":{"@easydarwin/easyplayer":"^5.0.3",},"devDependencies":{"copy-webpack-plugin":"^4.0.1",}2.在vue.config.js文件中ConfigureconstCopyWebpackPlugin=require('copy-webpack-plugin')...newCopyWebpackPlugin([{from:'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.wasm'},{from:'node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml'},{from:'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js',到:'js/'},])3.在public/index.html中引入js静态资源注意:该文件的位置要和上面配置的to...一致。上面的配置是:'js/',所以最下面的地址是./js或者4.在vue中使用...importEasyPlayerfrom'@easydarwin/easyplayer'...组件:{EasyPlayer}