Controlling videos from streamcloud, youtube, videoweed etc. via Javascript

Hello community,

I am trying to make my own webplayer with javascript and html 5. The steps should be as followed:
1. Paste your link on the webpage (youtube, streamcloud, whatever..)
2. Site refreshes with and the video pops up
3. you have full controll over the video via the webplayer.

So my question is for step 1:
-first approach would be to tell the user to get the root url of a video via tubeoffline or some browser plugins etc.
but I find that exhausting so I'd like to write my own peace of code which will do it for the user automatically -> it is possible as seen on tubeoffline for example. But how does it work ? I've tried the rapidleech script but it is in php and actually I wanted to do it in javascript only (if it is possible). So maybe someone can push me into the right direction on how this is achieved

-second approach: I have also asked on stackoverflow and someone gave me the hint to use the youtube js api but this works only for youtube? Is there maybe a way to put e.g. a link from streamcloud into an iframe and check for the events like play/pause etc. ? and if yes how?

step 2 and 3 are clear to me.

PS: I do not want to provide any downloadlink for the user at all it is just about controlling the video via javascript

I hope somebody can help me :)

Have a look here.
SoundCloud has a very nice API, it is well documented and they even have code samples in Python, Ruby and Javascript.

Check it out: SoundCloud API

You can upload, comment, like, stream, embed sounds with it.
Regardless, check it out!