This document explains the general use and purpose of Viddler’s flash video recorder. If you have any questions, please ask in the discussion group

Basic Usage

Recording using Viddler’s flash video recorder with a web cam is simple and easy. Before you begin, you must be familiar with The Viddler API, have a Viddler username, and an API key.

Here is the simple workflow to initiate a recording session using Viddler’s API and the embeddable flash video recorder.

  1. Authenticate the user account you want to save the recorded video to using the viddler.users.auth method with the get_record_token argument set to “1″.
  2. Use the record_token returned by this method to embed the flash video recorder on the page.
  3. The recorder will launch so that you can record a video.
  4. After recording is finished the embedded flash video recorder will call a JavaScript function (see below).

Here is the embed code for embedding the flash video recorder on to the page. Notice the recordToken flashvar that needs to be edited for every single video recording session.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="449" height="545"
id="viddler_recorder" align="middle"> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> <param name="movie" value="http://cdn-static.viddler.com/flash/recorder.swf" /> <param name="quality" value="high" /> <param name="scale" value="noScale"> <param name="bgcolor" value="#000000" /> <param name="flashvars" value="fake=1&recordToken=[YourRecordTokenHere]" /> <embed src="http://cdn-static.viddler.com/flash/recorder.swf" quality="high" scale="noScale" bgcolor="#000000"
allowScriptAccess="always" allowNetworking="all" width="449" height="545" name="viddler_recorder"
flashvars="fake=1&recordToken=[YourRecordTokenHere]" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>

Using any of the API Wrappers available in our Project Directory will make generating this flash video recorder’s embed code a snap.

Additional Flash Vars

There are several additional flashvars that you can include in your embed code to enable more features.

  • permalink(url) Url that will be sent to the backend when recording is done (I think one of the Partners requested that).
  • maxlength(integer) sets a custom max length of a recorded footage.
  • audioOnly(”Y”, “1″, “T”) values will switch recorder in “audio-only” mode. No video data will be sent.
  • recQuality(”H”, “M”, “L”) values will set quality to High, Medium and Low, respectively, and will cause the initial quality selector not to be shown.
  • enableCallbacks(”Y”,”1″,”T”) – will enable additional JavaScript callbacks during operation.

Javascript Callbacks

There are many javaScript call backs that can be used. Some need to be turned on with enableCallbacks flashvar, some are called by default.

recordStarted() – When the user clicks record.

function recordStarted() { }

The JavaScript function that is called after the recording is completed and saved is recordDone():

recordDone() – When the recording is finished and saved to the server.

function recordDone(username,user_video_number,video_id) {
// handle record data
}

username is the Viddler username, user_video_number is the number in the URL (eg. http://viddler.com/explore/cdevroe/videos/NUMBER/), video_id is the video ID.

Additional call backs

Other JavaScript callbacks that are available (when enableCallbacks is turned on) are:

recordStop – When the user stops the recording.

function recordStop() { }

recordDeleted – When the user decides to delete the recorded footage and re-record.

function recordDeleted() { }

recordSave – When the user clicks “Save”. This action is before the video is actually saved to the server. That is when recordDone() is called.

function recordSave() { }

Important: You may use each record_token only one time. Once the flash video recorder launches the token is immediately invalidated. If a record_token is invalid, an error will display.