Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Youtube code is not working in HTML

Tags:

I am trying to use embed youtube code in HTML but when I press play button it say "This video is unavailable". I am using the following HTML code for it:

<iframe width="560" height="315" src="https://www.youtube.com/embed/JfJYHfrOGgQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Can anyone help me out with this? I have tried other embed youtube videos too, still says same thing. I am using Chrome.

enter image description here

like image 596
Pearl Oyun Avatar asked Jul 19 '18 13:07

Pearl Oyun


People also ask

Why is YouTube embed not working?

''Other things you can try: Reload the video at a later point in time or immediately. Update the Adobe Flash Player. Upgrade your browser. Delete cache and cookies.

Why my YouTube video is not playing in HTML?

Web Browser Issues: many YouTube videos won't play issues happen due to web browser issues. Reloading the YouTube video page may solve this issue. If not, you will need to update your web browser or clear the cache. Using another web browser is also a good choice.

Why is my embedded video unavailable?

Lastly, always keep in mind that videos that have this message: “Video unavailable, watch on youtube” means that the embedding of the video or in the Video Privacy settings, is restricted. It might also be related to a copyright claim on the video. Best Regards.


1 Answers

I had the same issue recently and it had nothing to do with video owners embedding settings. Apparently YouTube forbids embedding some videos in a localhost environment without a public domain, but your video can be embedded with no issue whatsoever through a public domain/subdomain: Replace the src value in the JSFiddle from @PStarczewski's answer with your video link and it will work properly.

like image 126
Ahmed Maher Avatar answered Oct 12 '22 09:10

Ahmed Maher