<template>
  <section class="AiMonitor">
    <template v-if="type=='cmcc'">
      <iframe :src="src" allow="autoplay *; microphone *; fullscreen *" allowfullscreen allowtransparency
              allowusermedia frameBorder="no"/>
    </template>
    <hikversion-monitor v-else-if="type=='hik'" :src="src"/>
    <dhVideo v-else-if="type=='dahua'" :src="src"/>
    <slwVideo v-else-if="type=='slw'" :src="src"/>
  </section>
</template>

<script>
import HikversionMonitor from "./hikversionMonitor";
import dhVideo from "./dhVideo";
import slwVideo from "./slwVideo";

export default {
  name: "AiMonitor",
  components: {HikversionMonitor, dhVideo, slwVideo},
  props: {
    /**
     * 视频源
     */
    src: {default: ""},
    /**
     * 组件类型
     * cmcc 中移物联,hik 海康威视
     * @values cmcc,hik
     */
    type: {default: "cmcc"},
  }
}
</script>

<style lang="scss" scoped>
.AiMonitor {
  width: 100%;
  height: 100%;
  min-width: 100px;
  min-height: 60px;

  iframe {
    width: 100%;
    height: 100%;
  }
}
</style>
