<!--
 * @Author: 曹捷
 * @Date: 2022-04-29 11:17:51
 * @LastEditors: 曹捷
 * @LastEditTime: 2022-05-17 18:52:39
 * @Description:  视频 预览
-->
<template>
  <a-modal class="obit-modal-default" :maskClosable="false" title="视频播放" v-model:visible="showModal" @cancel="closeDialog" cancelText="取消" okText="确认" width="920px" :footer="null">
    <video controls class="playvideo" autoplay>
      <source :src="videoUrl" />
      Your browser does not support the video tag.
    </video>
  </a-modal>
</template>
<script>
import { computed, inject, reactive, toRefs, onMounted } from "vue";
export default {
  props: {
    open: {
      type: Boolean,
    },
    videoUrl: {
      type: String,
    },
  },
  setup (props, context) {
    let _data = reactive({
      showModal: props.open
    });
    let _methods = {
      closeDialog () {
        context.emit("update:open", false);
      },
    };
    return {
      ...toRefs(_data),
      ..._methods,
    };
  },
};
</script>
<style lang="less" scoped>
.playvideo {
  width: 100%;
  height: 400px;
}
</style>