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

sad-youtube-player
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.

join-html5-trial

It will look like this:

opted-in
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:

happy-violin
What is the opposite of sad trombone? Happy violin?

Other Video Hosts