<template>
  <div class="rendered-video" :style="component.style">
    <iframe
      :src="component.props.src || 'https://www.youtube.com/embed/dQw4w9WgXcQ'"
      frameborder="0"
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
      allowfullscreen
      :width="component.style.width"
      :height="component.style.height"
      style="width: 100%; height: 100%;"
    ></iframe>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';

const props = defineProps({
  component: Object,
});
</script>

<style scoped>
.rendered-video {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>