<template>
  <div class="video-box">
    <video width="100%" height="100%" controls loop autoplay muted :poster="poster">
      <source :src="src" type="video/mp4">
    </video>
  </div>
</template>

<script>
import { FetchShowFileList } from '@/api/library'
export default {
  name: 'Video',
  components: {
  },
  data() {
    return {
      poster: 'https://qiniu.aiyxlib.com/1658104787005.jpg',
      src: ''
    }
  },
  created() {
    this.getShowFile()
  },
  mounted() {
  },
  methods: {
    getShowFile() {
      const params = {
        libcode: 'FTZN'
      }
      FetchShowFileList(params).then(res => {
        if (res.errCode === 0) {
          this.src = res.data[0].filePath
        } else {
          this.$message.error('接口错误')
        }
      })
    }
  }
}
</script>

<style lang="scss">
@import "~@/assets/styles/index.scss";
</style>
