My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

PHPViddlerUploadify extends PHPViddler, the open source PHP wrapper for Viddler's API, to make it as simple as possible to add progress bars to your project when uploading to Viddler.


What you get

  1. Customizable browse button
  2. Customizable Progress indicator
  3. List of completed uploads

What it uses

PHPViddlerUploadify uses jQuery and the jQuery Uploadify extension to extend the capabilities of PHPViddler.

What you will need

PHPViddlerUploadify includes a copy of jQuery 1.3.2 and Uploadify 1.6.2. You will need to have a copy of PHPViddler to use PHPViddlerUploadify.


Instructions for use

  1. Download PHPViddler and install based on its documentation.
  2. Download PHPViddlerUploadify and unpack the zip.
  3. Put the following files/folders into your PHPViddler directory:
    • phpviddleruploadify.php
    • /js/
  4. Initiate the PHPViddlerUploadify class: $viddler = new PhpviddlerUploadify(); - Since PHPViddlerUploadify extends PHPViddler all methods available in PHPViddler are available through $viddler at this point.
  5. When creating an upload form, include <?php echo $viddler->Uploadify(); ?> where the "file" input element would normally reside. Uploadify() accepts the following arguments in order.
    • inputName - (default 'video') the name you'd like to use for the file input element.
    • multiUpload - (default false) Whether or not to allow multiple files to be uploaded at once. Version 0.1 of PHPViddlerUploadify does not support batch uploading but this will be used in future versions.
    • fileExt - (default .mov .wmv .avi .mp4 .m4v .divx .mpg .mpeg) - The file extensions you'd wish PHPviddlerUploadify to allow to be uploaded. Please check Uploadify's documentation for syntax.
    • autoUpload - (default true) - When the user selects the file this variable determines whether or not the file is immediately uploaded. This should be set to true. If you choose false, please see Uploadify's documentation on how to implement properly.
    • uploadFolder - (default 'uploads') - The directory on your server to upload the video files to relative to the form page file. (no preceding slashes needed)

Uploading from your server to Viddler

Now that the video file is on your local server, you must submit that file to the Viddler API. Here is how you can do that.

  1. Authenticate a username and password to retrieve the session ID using PHPViddler's user_authenticate method.
  2. Submit the proper arguments to PHPViddlerUploadify's UploadToViddler() method. (You can choose to write your own uploader, but this saves a little bit of code. Please see the example included in the pack to see how this is done in upload.php). The UploadToViddler() method accepts the following arguments in order:
    • sessionid - The sessionid given by the Viddler API after a user has been authenticated.
    • title - The title for the video.
    • description - The description for the video
    • tags - A comma delimited list of the tags associated with the video.
    • public (default 1) - Whether or not to immediately make the video public. Please seen Viddler's API documentation for further information on setting video permissions.
    • filelocation - The full server path and file name of the video file to be uploaded. e.g. '/Users/cdevroe/Sites/viddler/phpviddleruploadify/uploads/Movie.mov'

Note: Included in the pack is an example upload form (example.php) and a file that will upload the video from your server to Viddler (upload.php). These can be used as reference and are fairly well commented. It is highly recommended you look at these files.

Powered by Google Project Hosting