Youtube video not showing

i have tried to add a video to my page but is just not showing. I have even try to add the “embed” to the link but still not working.

Hi !

You got a gap in your code.

First, you don’t have to use HTML tag <video></video> to display your video using <embed></embed>.

Here is your code (this does not work):

<video><iframe width="1351" height="480" src="https://www.youtube.com/embed/v8kFT4I31es" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></video>

Good practice (this works) use <div></div> instead :

<div><iframe width="1351" height="480" src="https://www.youtube.com/embed/v8kFT4I31es" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>

Hope this helps !

Happy coding journey :wink:

The problem with div is that the user story asks for video =“video” instead of div. I started off using div and could not solve the user story with that. When I used the video code, it solved the user story, but the video stopped working on the page.

Thoughts?

please open your own topic, this thread is over three years old, thank you