Viddler

Daily features, announcements, and much more!

Direct Upload API

Published December 23, 2010 by Colin Devroe in Announcements

Uploading videos via the Viddler API has always been a bit of a roundabout process: first, the video has to be uploaded to your server, then you have to take that video file and upload it again to us, leaving lots of room for something to go wrong. Plus, there really isn’t any reason why a file should have to go you before it comes to us. That’s why I’m super excited to announce our brand new Direct Upload API, which allows you to point an upload form directly at our servers and skip all the steps in-between.

In order to start using it, all you need to do is call the viddler.videos.prepareUpload method (using our V2 API), point your form at the endpoint returned, and include the upload token as a hidden field. Here’s a quick example using PHPViddler:


<?php

include('phpviddler.php');

$user = 'YOUR USERNAME';
$pass = 'YOUR PASSWORD';
$api_key = 'YOUR API KEY';
$callback_url = 'CALLBACK';

$v = new Viddler_V2($api_key);

// Get a sessionid
$auth = $v->viddler_users_auth(array('user' => $user, 'password' => $pass));

$sessionid = $auth['auth']['sessionid'];

// Call prepareUpload to retrieve the token and endpoint we need to use
$prepare_resp = $v->viddler_videos_prepareUpload(array('sessionid' => $sessionid));

$upload_server = $prepare_resp['upload']['endpoint'];
$upload_token  = $prepare_resp['upload']['token'];

?>

<form method="post" action="<?= $upload_server ?>" enctype="multipart/form-data">
  <input type="hidden" name="uploadtoken" value="<?= $upload_token ?>" />
  <input type="hidden" name="callback" value="<?= $callback_url ?>" />
  <label>Title:</label> <input type="text" name="title" /><br />
  <label>Description:</label> <input type="text" name="description" /><br />
  <label>Tags:</label> <input type="text" name="tags" /><br />
  <label>File:</label> <input type="file" name="file" /><br />
  <input type="submit" value="Upload" />
</form>

You’ll see that I’ve also included a “callback” hidden field. This is a URL on your server that we’ll redirect to after the upload is finished. When we redirect, the video_id of the uploaded video will be included in the query string.

Hopefully this makes the experience of uploading videos to Viddler a little bit easier!

7 Comments Share on Twitter

Holiday Rap: Get the Milk Out (Santa Claus is Back)

Published December 20, 2010 by Colin Devroe in Announcements

A week or so ago, Rob emailed me a link to a little holiday rap song made by our friends at Ooyala. It was a cute video. But, at Viddler, when our competitors do something that we don’t, we take the time to do it better. With that in mind, I set out to create a little East Coast/West Coast lyrical rivalry by making our own holiday rap video that embodies the true spirit of hip hop: being a pimp.

So without further ado, I present you with Get the Milk Out (Santa Claus is Back). I even set up a little page for sharing the spirit. So, if you enjoy the video, link a friend to SantasBack.com and help make their holiday season a little more ballin’.

Enjoy.

4 Comments Share on Twitter

Viddler to Twitter using OAuth.

Published December 16, 2010 by Colin Devroe in Announcements

Viddler first began using Twitter to spruce up your profiles and share links to your videos in April 2007. That’s over 3 1/2 years ago! Since then we’ve been forced to store your Twitter username and password to interact with Twitter in your behalf. We didn’t like doing it but we had little choice.

Somewhat recently however Twitter has forced all third-party applications (that’s us) to use a much safer authentication method called OAuth. OAuth, in laymen’s terms, is a way for Twitter to ask each Viddler user if they’d “allow” Viddler to update Twitter for them. You can choose to “allow” or “deny” Viddler to do this rather than giving us your username and password. It is much safer for you and much nicer for us.

How do I update to Twitter OAuth?

To “allow” Viddler to pull in your recent tweets into your profile and to set up any automatic notifications using OAuth instead of your username and password simply go to your profile on Viddler, click Edit Profile, and walk through the brand-new OAuth-powered authentication process. If you need any help let us know.

Comments Off Share on Twitter

An Official Viddler Ruby Gem

Published December 15, 2010 by Colin Devroe in Announcements,Development

On the heels of the release of PHPViddler version 2, I am super excited to announce our brand new Viddler gem, viddler-ruby. All of you Ruby lovers out there can get your hands on it by running gem install viddler-ruby, and you’ll now be able to call V2 API methods really easily:


require 'rubygems'
require 'viddler-ruby'

# Create the client and authenticate it
viddler = Viddler::Client.new('YOUR API KEY')
viddler.authenticate! 'USERNAME', 'PASSWORD'

# Simple API for calling GET, POST, and uploading a file:
viddler.get 'viddler.playlists.getByUser', :user => 'kyleslat'
viddler.post 'viddler.playlists.create', :name => 'My super awesome playlist'
viddler.upload File.open('mymovie.avi'), :title => 'Ruby Upload', :description => "I love Ruby!", :tags => "ruby, viddler"

For more information, including how to integrate this into your Ruby on Rails application, check out the GitHub project. I’ve got a lot of plans to make this wrapper even better, so definitely keep checking in for updates!

2 Comments Share on Twitter

Resumable Uploader For All: Never Lose an Upload

Published December 9, 2010 by Colin Devroe in Announcements

Your content is important to us. Really important. Your video files are probably more important to us than food and water. When Earth’s fresh water supply becomes a commodity and the great aqua wars begin, we’ll be trading bottles of Dasani for MP4′s. We love video files.

Flakey internet connections are one of the most common reasons video uploads never reach Viddler’s servers. WiFi connections drop out and cable modems get temperamental and beg to be unplugged and replugged in—there are a ton of ways your upload can get interrupted. We recognized this as a problem and set out to find a way to fix it. WiFi dropouts and other end-user connectivity issues aren’t just going to go away anytime soon, and believe me, when the aqua wars truly begin, everybody will have a flakey internet connection.

So we decided this was a problem that we’d have to find a way to solve on our end. Today we’re launching the solution to that problem: Viddler’s Resumable Uploader. Our resumable uploader is built on Java, and will automatically restart your upload where it left off if your internet connection gets interrupted. You’ll never have to restart a video upload on Viddler, no matter how many times your internet connection drops out during the upload process.

Reliability and user experience are extremely important to us, and we want to make sure that this experience is accessible to anyone who uses Viddler, That’s why we’re proud to launch this new feature across the board. Business customers, Viddler Partners, and free personal accounts all have access to our new resumable uploader. So go ahead, start uploading a video, spill coffee on your laptop, unplug your ethernet cable, stick your laptop in a bag of rice to dry it, and replug your computer back in and watch the upload pick up where it left off. It’s fun!

Comments Off Share on Twitter

A brand new, much more simple, PHPViddler

Published December 8, 2010 by Colin Devroe in Announcements,Development

We have wrappers for our API in many different programming languages. One of the more popular wrappers has always been PHPViddler which is available as an open source project on Github. Today we’re releasing PHPViddler 2 which is all new, much more simple, and uses our brand new API version 2 (which we launched not too long ago).

We wanted PHPViddler 2 to be very, very simple in its use and allow developers to build upon it for their own custom solutions. One way that we handled this was by making each method name in the PHPViddler 2 class be exactly the same as the API method that you want to use. This may seem like a no-brainer but in PHPViddler 1.0 (which is still available, and still supported by the way) we didn’t do things this way.

Here is an example. In PHPViddler 1.0 to authenticate a Viddler user you’d call user_authenticate in the PHPViddler 1.0 class and send it two or a third optional argument such as $user, $pass, and $getToken. Here, I’ll show you.


include('php/phpviddler/phpviddler.php');
$v = new Phpviddler();
$v->apiKey = 'YOUR API KEY HERE';
$v->viddlerREST = 'http://api.viddler.com/rest/v1/';
// Authenticate a user
$user = $v->user_authenticate('username','password');
// $user['auth']['sessionid'] would be set here.

This may seem easy enough however a developer would be required to remember the method names of the PHPViddler 1.0 class rather than simply knowing the method as dictated by the API itself. Now with PHPViddler 2 the class methods follow the naming conventions of the API Version 2. Here, this is the same example using PHPViddler 2.


include('/path/to/phpviddler.php');
$v = new Viddler_V2('Your API key here');
// Authenticate a user
$user = $v->viddler_users_auth(array('user'=>'username','password'=>'password'));
// $user['auth']['sessionid'] would be set here.

Now the class method name actually determines the API method you would like to use. The arguments that the class method accepts is identical to the API method arguments that are required or optional.

It is also worth nothing that PHPViddler 1.0 required an entire XML parsing library or for the developer to build their own. Since our new API has a PHP response type as an option, PHPViddler 2 simply uses this by default. Cutting the codebase for the wrapper down considerably and speeding up both the response time of the API and the speed of your applications.

There are many advantages to using PHPViddler 2 in your next app and even updating your current applications to take advantage of the new API. If you need any help doing any of this please get in contact with us in our Developers Group.

Comments Off Share on Twitter