0

I'm trying to embed youtube videos on my vue and it won't let me because of that policy.

I've installed an NPM package but it's a little broken and I don't know if it will keep working in the future.

Is there anyone who knows how I can work around this or properly solve it?

I installed a random plugin that's poorly maintained. I was expecting allowing some kind of policy like CORS or something like that but I couldn't find anything about this issue

2
  • Please provide code how you are trying to embed the video. You should use the /embed/ URL that youtube provides, as it sets correct headers. Commented Sep 7 at 8:53
  • Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    Commented Sep 7 at 12:44

1 Answer 1

0

I wasn't using the youtube embed properly, I looked better into it and by using youtube's iframe properly I got it to work. It was a little complex because I'm trying to dinamically embed videos with the URL being in the database.

<iframe :src="`https://www.youtube-nocookie.com/embed/${useStore.ejercicio.url}?si=dg1BfOc3c6-dEfZZ&amp;controls=1;loop=1;color=white`" title="Demostración ejercicio" frameborder="0" allow="encrypted-media;loop" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Not the answer you're looking for? Browse other questions tagged or ask your own question.