<script lang="ts" setup>
import AppVideoPlayer from '@/components/base/AppVideoPlayer.vue'
const emit = defineEmits<Emits>()

const props = defineProps({
  isShowVideoPlayDialog: {
    type: Boolean,
    required: true
  },
  videoOptions: {
    type: String,
    required: true
  }
})
interface Emits {
  (e: 'update:isShowVideoPlayDialog', isShowVideoPlayDialog: boolean): void
}

// 取消
const handleCancel = () => {
  emit('update:isShowVideoPlayDialog', false)
}

const videoOptions = computed(() => {
  return {
    sources: [
      {
        src: props.videoOptions
      }
    ]
  }
})
</script>
<template>
  <el-dialog :model-value="isShowVideoPlayDialog" draggable :before-close="handleCancel" width="35%">
    <AppVideoPlayer :options="videoOptions" :isAdd="true"></AppVideoPlayer>
  </el-dialog>
</template>
