LiveQing 播放器的使用

1:安装 :
安装 npm install @liveqing/liveplayer
安装 npm install [email protected]
2:在build文件的 webpack.dev.conf.js下插入


image.png

//第一步
const CopyWebpackPlugin = require('copy-webpack-plugin');

......
// copy js lib and swf files to dist dir
//第二部
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/'}
]),
......
3:在index.html文件引入

4:在你的vue组件中 引入
//引入
import LivePlayer from '@liveqing/liveplayer'
//注册
components: {
LivePlayer
},
//使用组件

//videoUrl:你的视频文件
5:一定要给LivePlayer组件的父级盒子一个css属性 : position: relative;

你可能感兴趣的:(LiveQing 播放器的使用)