<template>
  <!--  视频播放弹窗 -->
  <el-dialog
    :title="title"
    :visible.sync="show"
    @close="closeVideoDialog"
    class="course-video-dialog"
    center>
    <video controls :src="source" class="course-video-box"></video>
    <p v-if="footerText">{{footerText}}</p>
  </el-dialog>
</template>

<script>
export default {
  name: "videoDialog",
  props: {
    source: {
      type: String,
      require: true
    },
    footerText: {
      type: String,
    },
    visible: {
      type: Boolean,
      require: true
    }
  },
  data() {
    return {
      title: '',
      show: false,
    }
  },
  watch: {
    visible: {
      handler(newVal) {
        this.show = newVal;
      },
      immediate: true
    }
  },
  methods: {
    closeVideoDialog() {
      this.$emit('update:visible',this.show)
    }
  }
}
</script>

<style scoped>

</style>
