<template>
    <kfVideoItem :props="configValue" ref="video"></kfVideoItem>
</template>

<script setup>
import kfVideoItem from "@/components/ui/widgets/kfVideoItem.vue";
import { computed ,toRefs, ref, watch} from "vue";
import pageModel from '@/components/ui/model/page';

const props = defineProps(['config', 'confData', 'label']);
const {config, confData, label} = toRefs(props);

const configValue = computed(() => {
  let params = {
    deviceId: confData.value.deviceId,
    deviceTypeCode: confData.value.deviceTypeCode,
    data: {
      url: config.value.value,
      server: pageModel.currProject.value?.settings?.streamServer
    }
  };
  return params;
})

const video = ref(null);

watch(video, () => {
  if (video.value) {
    video.value.updateData();
  }
})

</script>

<style lang="scss" scoped>

</style>