views:

79

answers:

1

Posting a video on tumblr.com allows you to just paste the URL of the video on youtube, vimeo, whatever and tumblr automatically does the embedding for you.

I assume that this would be nothing more than a mapping between an URL-regex and the belonging HTML construct for embedding the video. Or it is just parsing the response of the URL and getting the construct from there.

Is there already any utility, preferably in Java, for doing this? If not, how would you do it?

A: 

I don't know any utilities to do this. I doubt that there are no standard way to do this across sites.

I would just go through the most popular video sites and check how embedding is done in each one. It should be rather straight forward to map a URL to video to embedded. You could check how tumblr does it.

Juha Syrjälä