Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active March 23, 2018 15:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save robneu/4b6dcf54b4c6c23640dc to your computer and use it in GitHub Desktop.
Save robneu/4b6dcf54b4c6c23640dc to your computer and use it in GitHub Desktop.
Embed a YouTube video using featherlight.js
<a href="https://www.youtube.com/embed/CEYRBTZWu8U" data-featherlight="iframe" data-featherlight-iframe-width="960" data-featherlight-iframe-height="540">
<img class="alignnone" src="http://img.youtube.com/vi/CEYRBTZWu8U/maxresdefault.jpg" alt="" width="1280" height="720" />
</a>
@anahitghazaryan
Copy link

I have used this but it didnot display the video within the popup. I got an error in console Refused to display 'https://www.youtube.com/watch?v=hgfhhgf' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

@robneu
Copy link
Author

robneu commented May 20, 2016

I'm pretty sure to embed content from YouTube you need to use the https://www.youtube.com/embed/ version of the video URL.

@herlon214
Copy link

Thanks!

@galloperleon
Copy link

This works for me. Thanks!

@davehightower
Copy link

Mine flashes a white blank image quickly then loads the video in the lightbox. But it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment