Heads up! This blog post hasn't been updated in over 2 years. CodePen is an ever changing place, so if this post references features, you're probably better off checking the docs. Get in touch with support if you have further questions.

Have you ever tried to embed a YouTube video on CodePen? It might have ended up looking like this:

Sad trombone.

That’s because, by default, YouTube embeds still uses Flash. Even if you have Flash installed on your computer, the sandboxing of the iframe preview we display blocks it. Security and stuff.

All is not lost!

You simply need to opt-in to YouTube’s HTML5 video player.


It will look like this:

What it looks like once you’ve opted in.

You don’t need to do anything else on the CodePen side. Simply refresh and you’ll see the YouTube video like you would expect:

What is the opposite of sad trombone? Happy violin?

Other Video Hosts