A friend asked me yesterday if he would be able to embed videos in his Posts. I’d already decided that I’d make it possible, so today I set about implementing it.
Turns out that embedding a youtube video is pretty easy, and just a little Regex, or URL parsing (thanks to Stack Overflow) was necessary.
Some people, when confronted with a problem, think
“I know, I’ll use regular expressions.” Now they have two problems.
I tried to make Sound Cloud songs embed automatically as well, but the way they process URLs is currently preventing that. Maybe I’ll send ’em an email – their service is pretty good so I assume that they are on the ball.
So now you can just Post a Youtube.com URL (like “http://www.youtube.com/watch?v=QH2-TGUlwu4”) and the video will be posted for you. ᵔᵜᵔ
Pretty neat, eh?
We think it’s Nyantastic!