0

I want to implement a Youtube video, but the video didn't show, even if i think i wrote the code correctly.

I am confused because i copy pasted a code from another html code, and just when i change the URL video to another one, it didn't show the new video anymore...

<iframe width="854" height="480" src="https://www.youtube.com    /watch?v=6kg2yV_3B1Q" frameborder="0" gesture="media" allow="encrypted-media"     allowfullscreen></iframe>

code to the codepen : https://codepen.io/Peyo5202/pen/RwbGaGm?editors=1000

No error message, just a blank space instead of the video.

Luis Febro
  • 1,733
  • 1
  • 16
  • 21
Peyo
  • 25
  • 4

3 Answers3

0

this is a trivial thing check this W3School, best of luck, try this

    <iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe> 
Ranker
  • 43
  • 7
  • "Link only" answers are discouraged on Stack Overflow. Consider adding a comment instead, or providing a more detailed explanation for some code. – Brad Aug 19 '19 at 14:21
  • 1
    i've got a notification that it's a new member, so i provide the link for the description, BTW thanks :D – Ranker Aug 19 '19 at 14:27
0

try with this link instead of your link for a test, it will work :

<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY"
</iframe>

So I think your link has a problem

ISSOU
  • 27
  • 7
0

You should embed iframe tag from youtube: - Hit the share button - Choose embed HTML The iframe tag should looks like this:

<iframe width="560" height="315" src="https://www.youtube.com/embed/6kg2yV_3B1Q" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Hưng
  • 11
  • 4