Documentation

How to upload a video

How to upload a video

March 7th, 2011 by Colin Devroe

So you want to upload a video to Viddler, huh? You crazy person! We don’t like to keep crazy people waiting, so here is the best way to upload video to Viddler. We think.

First, you’ll need to authenticate the Viddler account you want to upload to and retrieve the sessionID using viddler.users.auth. Second, you’ll need to ask Viddler’s API for an endpoint and an token to upload the file to using viddler.videos.prepareUpload. Third, upload the video directly to that endpoint making sure to provide a callback URL.

The way the upload procedure works from here is this; the file gets uploaded to the endpoint you specified, all of the data that you sent (like title, tags, description) are also saved with the video, once the file upload is completed the video enters into the video encode queue on Viddler, and then the API will redirect back to the provided callback URL. Its all really quite wonderful, we know.

Examples in code

Now that you know the workflow (You didn’t even read the workflow, did you? All you care about is copying and pasting the code, we knew it! Crazy person!) here is some code examples for you to work from. Hopefully this helps you grok it.

Please note: All parameters being sent to the upload node must come before the file parameter. In other words, be sure to post uploadtoken and endpoint prior to the file, not after.

Uploading using PHP

Uploading using Ruby

You’ll notice, one of the niceties of the Ruby gem is that you don’t have to include the sessionid manually. It knows when it needs a sessionid and will use it.

We hope this short article helps you add uploading to your Viddler-powered app.

Search

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.