Johan Ronström
google
yahoo
bing
BLOGG
Aug
23

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:

embedcodes.txt
embedcodes.php

if you run the PHP script you can see the outputted embed codes in the source.

Ideas - Johan @ 20:53 | 2 kommentarer »

Aug
4

KOPIMILL

Ideas - Johan @ 23:32 | Inga kommentarer »

Jul
31
Jul
2
May
27
Mar
23
Nov
8
Sep
6
Jun
19
Jun
18