CompuTechBiz - IT Services

How to Embed a Youtube Video in a Webpage

YouTube's shortened share link (like https://youtu.be/...) cannot be directly embedded in a webpage <iframe>. This may cause "Error 153" or prevent the video from loading altogether.

The solution is to convert the shortened URL into the correct YouTube embed format. Alternatively, you can use YouTube's privacy-enhanced (no-cookie) domain.

For example, when you copy a video URL using YouTube's Share button, you get something like:

https://youtu.be/JYfiaSKeYhE

Convert it into one of the following formats:

Standard embed URL:

https://www.youtube.com/embed/JYfiaSKeYhE

Privacy-enhanced embed URL (no-cookie):

https://www.youtube-nocookie.com/embed/JYfiaSKeYhE

Both formats are suitable for embedding in an HTML <iframe>. The privacy-enhanced version provides an additional layer of privacy by avoiding YouTube cookies until the viewer interacts with the video.