Video embed codes
I’m building a site where users can embed video into their profiles. Letting people use custom HTML is way too risky, so I’ve made a script that detects the video service and builds the embed code from the video URL.
I have added the video sites most popular here right now, I’m probably going to add more on request. I’ve minimized the embed codes as much as I can, removed all unnecessary (for me) parameters.
The video sites as of now are:
YouTube
MySpace
Google
Vimeo
Yahoo
Flickr
And audio:
Soundcloud
(separating audio and video might not be necessary for other sites)
Here are the PHP functions, getVideoEmbedHtml() and getAudioEmbedHtml() with some testdata at the top:
if you run the PHP script you can see the outputted embed codes in the source.
Ideas - Johan @ 20:53 | 2 kommentarer »

