<template>
  <iframe
    :src="`https://tp.srgssr.ch/p/srf/embed?urn=urn:srf:video:${videoId}`"
    class="srf-embed"
    allowfullscreen
    frameborder="0"/>
</template>

<script>
  import {getVideoId} from '@/helpers/video';

  export default {
    props: ['url'],

    computed: {
      videoId() {
        return getVideoId(this.url);
      }
    }
  }
</script>

<style scoped lang="scss">
  .srf-embed {
    width: 100%;
    height: 350px;
  }
</style>
