在index.html引入js
<script src="https://g.alicdn.com/de/prismplayer/1.9.4/prism-h5-min.js"></script>
然后在build/webpack.base.conf.js
中找到webpackConfig
里面配置
externals: {
"prismplayer": "prismplayer"
}
在你的项目中
export default {
mounted: function() {
let player = new prismplayer({
id: 'J_prismPlayer',
width: '100%',
autoplay: false,
//播放方式一:推荐
prismType: 2,
vid: '',
accId: '',
accSecret: '',
apiKey: '',
// vid : '',
// playauth : '',
showBarTime: 3000000,
cover: 'http://liveroom-img.oss-cn-qingdao.aliyuncs.com/logo.png'
});
}
}