EasyPlayer播放视频

140 阅读1分钟
npm i @EasyPlayer  @easydarwin/easyplayer


copy三个文件到静态目录下,这里通过copy-webpack-plugin插件来完成这个工作,vue.config.js中配置插件copy-webpack-plugin,这里的to根目录是静态目录(build时就是dist文件夹,./libs/EasyPlayer/就是dist/libs/EasyPlayer/)
          
          module.exports = {

          configureWebpack: {
            plugins: [
              new CopyWebpackPlugin([
                {
                  from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.swf',
                  to: './libs/EasyPlayer/'
                },
                {
                  from: 'node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml',
                  to: './libs/EasyPlayer/'
                },
                {
                  from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js',
                  to: './libs/EasyPlayer/'
                }
              ])
            ]
          },
          

之前使用的 这个播放是url 看文档把 换插件了记录一下

image.png

          https://blog.csdn.net/a843334549/article/details/117323709