The YouTube URL in src
must have and use the embed
endpoint instead of watch
, so for instance let’s say you want to embed this YouTube video: https://www.youtube.com/watch?v=P6N9782MzFQ
(browser's URL).
You should use the embed
endpoint, so the URL now should be something like https://www.youtube.com/embed/P6N9782MzFQ
. Use this value as the URL in the src
attribute inside the iframe tag in your HTML code, for example:
<iframe width="853" height="480" src="https://www.youtube.com/embed/P6N9782MzFQ" frameborder="0" allowfullscreen ng-show="showvideo"></iframe>
So just replace https://www.youtube.com/watch?v=
with https://www.youtube.com/embed/
and of course check for your video's ID. In this sample, my video ID is P6N9782MzFQ
.