需求背景:
在项目中,希望引入阿里播放器插件。

实现:

index.html:

    <script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.8.1/aliplayer-min.js"></script>

main.js:

const Aliplayer = window.Aliplayer
Vue.prototype.Aliplayer = Aliplayer

使用:

var player = new this.Aliplayer({
    id: 'J_prismPlayer',
    width: '100%',
    autoplay: true,
    source: ''
  }, function (player) {
    console.log('播放器创建好了。')
  })
Logo

前往低代码交流专区

更多推荐