http://{publicvideos_api_node}/v/{version}/{resource}
curl http://api.publicvideos.org/v/0/clip/2184
- Clip
- Scene captured on video.
- Set
- Collection of clips.
- Author
- Person who shots clips.
- Version
- Digital file representing a clip.
- Transcoder
- Agent that given a clip generates a version.
- Transcoding Step
- A command executed by a transcoder.
Discussion
Queries to the API return filenames such as 2009-05_00346_plants-against-sun-leaves-green.mts
How do I play this file in the browser?
Yes, the documentation is a little bit confusing, that filename is not a url for a file, it is just the original file(before transcoding) filename. To get the browser-playable files you will have to use the /versions/… entrypoints. :)
For example: http://api.publicvideos.org/versions/transcoder/2/ gives you some random 640×360 Theora OGV files, while http://api.publicvideos.org/versions/transcoder/20/ gives you some random 640×360 VP8 WebM files, http://api.publicvideos.org/versions/transcoder/10/ some black and white 192×108 jpeg files, and so on…
To get a list of all transcoders available use http://api.publicvideos.org/transcoders/latest
If you have any suggestions or need any extra help please let me know :)
This call to the Public Videos API http://api.publicvideos.org/v/0/clips?callback=foo using jQuery's getJSON method does not return JSONP wrapped in foo(json goes here).
I want to access the API using client side JS only.
Is it possible to use the API strictly from the client side to get JSONP, bypassing cross domain issues?
That's actually a great feature request!!
Can you please file a bug at https://bugs.launchpad.net/publicvideos/%2Bfilebug
Or even better, create the patch that implement that and send me a pull request at http://github.com/fczuardi/api.publicvideos
Anyways, this should be a simple nice thing to add, I will give it a shot when I have time and let you know :)
Thanks!
Here is how the json output is written to the response today:
http://github.com/fczuardi/api.publicvideos/blob/3b48c24b7aba06326113cd18f30da721ffe82814/api/methods.py#L58
See that we are using a simple Python json.dumps, the fix to support a callback=foo would involve tweaking the url patterns at http://github.com/fczuardi/api.publicvideos/blob/1f3645bb0bfca53b8f0358478fe821d62a53fc2d/api/urls.py to accept this extra parameter and then update the correspondent methods to add the wrapper if the parameter is passed.
It's even easier than that, no changes in the urls.py required, just use tornado's self.request.arguments dict to get the value of the option inside the methods…
Hi Jerome, it should be fixed now, please test it and let me know :)