Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active March 23, 2018 15:50
Show Gist options
  • Select an option

  • Save robneu/4b6dcf54b4c6c23640dc to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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

robneu commented May 20, 2016

Copy link
Copy Markdown
Author

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
Copy Markdown

Thanks!

@galloperleon

Copy link
Copy Markdown

This works for me. Thanks!

@davehightower

Copy link
Copy Markdown

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