<template>
  <Xgplayer :config="config" @player="Player = $event"/>
</template>

<script>
  // 导入组件
  import Xgplayer from 'xgplayer-vue';
    export default {
        name: "xgplayer",
      components : {
        Xgplayer
      },

      data() {
        return {
          titles: [
            {
              title: '插入视频'
            },
            {
              title: '进一步配置'
            },
            {
              title: '相关资料'
            }
          ],
          config: {
            id: 'vs',
            url: 'http://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4',
            // autoplay: true,
            playsinline: true,
            width: 300,
            height: 200,
          },
          Player: null
        }

      },
      mounted(){
        // this.Player.play()
        // this.Player.on('play', ()=>{console.log('play')})

      },
    }
</script>

<style scoped>

</style>
