andrewvasilchuk / vue-lazy-youtube-video

Vue.js component for lazyloading YouTube videos.
MIT License
102 stars 22 forks source link

Not working on Nuxt 2 #59

Closed priverop closed 1 year ago

priverop commented 1 year ago

Hi! I just implemented this on a brand new component:

<template>
  <LazyYoutubeVideo :src="slice.primary.url.embed_url" />
</template>

<script>
import LazyYoutubeVideo from 'vue-lazy-youtube-video'
import 'vue-lazy-youtube-video/dist/style.css'

export default {
  name: 'Quote',
  components: {
    LazyYoutubeVideo,
  },
  props: {
    slice: {
      type: Object,
      required: true,
    },
  },
}
</script>

And I've got this many errors:

image
[Vue warn]: Invalid prop: custom validator check failed for prop "src".
Vue-lazy-youtube-video.esm.js:200 [vue-lazy-youtube-video]: Failed to extract video id from h
Refused to display 'https://www.youtube.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
crbug/1173575, non-JS module files deprecated.

Am I doing something wrong?

Thank you!

priverop commented 1 year ago

The url of the video must follow this structure: https://www.youtube.com/embed/4JS70KB9GS0

If the embed is not present, that error occurs.