<!--
 * @Author: your name
 * @Date: 2022-01-26 22:44:02
 * @LastEditTime: 2022-01-27 10:12:46
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /test/hello-world/src/views/components/videoView.vue
-->
<template>
  <div class="box-wrapper">
    <div class="title">{{ deviceData.videoName }}</div>
    <div class="close" @click="close">
      <img src="@/assets/mapImages/closeBtn.png" alt="" />
    </div>
    <div class="box videoBox">
      <div id="video"></div>
    </div>
    <span slot="footer" class="dialog-footer">
      <!-- <el-button type="primary" @click="dialogVisible = false"
        >确 定
      </el-button>
      <el-button @click="dialogVisible = false">取 消</el-button> -->
    </span>
  </div>
</template>
<script>
import WasmPlayer from "@easydarwin/easywasmplayer"; //导入WasmPlayer.js

export default {
  data() {
    return {
      // dialogVisible: true,
      // AfterClose: true,
    };
  },
  watch: {},
  mounted() {
    setTimeout(() => {
      this.player = new WasmPlayer(null, "video", this.callBack, {
        Height: true,
      });
      this.player.play(this.deviceData.usr, 1);
    }, 1);
  },
  methods: {
    show() {
      this.dialogVisible = true;
    },
    handleClose() {
      console.log("关闭");
      this.player.destroy(this.deviceData.usr);
      // document.body.removeChild(this.$refs.videoBox.$el);
    },
    callBack() {},
    close() {
      this.handleClose();
      this.mapClass.infowindowClose();
    },
  },
};
</script>

<style lang="scss">
.box-wrapper {
  background-color: rgba(9, 18, 32, 0.6);
  position: relative;
  .title {
    padding-top: 10px;
    padding-left: 10px;
    font-size: 14px;
    line-height: 14px;
    color: #ffffff;
  }
  .close {
    position: absolute;
    right: 10px;
    top: 5px;
    cursor: pointer;
  }
  .box {
    padding: 5px 12px 10px 10px;
    width: 350px;
    height: 200px;
    #video {
      height: 100%;
    }
  }
}
</style>

