0

I tried to insert "All my loving" by the Beatles into my HTML page, using this code:

<iframe width="1280" height="753" src="https://www.youtube.com/embed/TSpiwK5fig0?list=PLDZvge8C5LoxAg8DGVYIkRcH9TaBbTUfa" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>    

however, I got this error when I tried to run the code:

! video unavailable 

Now I tried this on a lofi video and it worked fine. So what am I doing wrong? Thanks for any help!

Minal Chauhan
  • 6,025
  • 8
  • 21
  • 41
  • You try embed unavailable video - https://www.youtube.com/embed/TSpiwK5fig0 – Nikita TSB Jun 30 '21 at 23:39
  • 2
    When a YouTuber uploads a video, they have the option to disable embedding. Musical artists will frequently do this to prevent people from ripping their songs onto other sites easily. It looks like that video can't be embedded, by the uploader's choice – Silvio Mayolo Jun 30 '21 at 23:46

1 Answers1

0

According to this answer, you are facing the problem, most probably because you are running the YouTube embed locally.
So, try using the code online or you can also use Codepen or JSFiddle to test the code (I tested and it was running without problem).

<iframe width="1280" height="753" src="https://www.youtube.com/embed/TSpiwK5fig0?list=PLDZvge8C5LoxAg8DGVYIkRcH9TaBbTUfa" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
m24197
  • 1,038
  • 1
  • 4
  • 12