EasyPlayer.js 在VUE中使用

楔子

不是專業的前端,只是 需要使用,網上各種博客都是 官方那些,可以按照操作後 提示Uncaught ReferenceError: videojs is not defined

解決

官網地址

npm install @easydarwin/easyplayer --save
npm install --save-dev copy-webpack-plugin  

1 copy-webpack-plugin

在這裏插入圖片描述

npm install --save-dev copy-webpack-plugin

webpack.dev.conf.js

## 引入
const CopyWebpackPlugin = require('copy-webpack-plugin')

在 module  plugins 配置 上述
    new CopyWebpackPlugin([

        { from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml'},
            { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf'},
            { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js', to: 'js/'},
          {from :'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.swf'},
          {from :'node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml'},
          {from :'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js'},
            {
              from: path.resolve(__dirname, '../static'),
              to: config.dev.assetsSubDirectory,
              ignore: ['.*']
            },
    ])

2 在index.html中引用

在這裏插入圖片描述

沒有在index.html中引入 就會 提示 Uncaught ReferenceError: videojs is not defined

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章