<template>
  <div @click="emitClickVideo">
    <component
      :is="LiveVideo"
      :url="props.url"
      v-if="props.url"
      :poster="props.poster"
    />
  </div>
</template>
<script lang="ts" setup>
  import { defineAsyncComponent } from 'vue';

  const props = defineProps<{ url: string; poster?: string }>();
  const emit = defineEmits(['clickVideo']);

  const LiveVideo = defineAsyncComponent(() => import('@/components/live/LiveVideoFlv.vue'));

  // 点击视频时隐藏header和导航按钮
  function emitClickVideo() {
    emit('clickVideo');
  }
</script>
<style scoped></style>
