How to: Record with Web cam
December 8th, 2008 by Colin DevroeThe vast majority of notebooks have a webcam built-in. Why not take advantage of this built-in video camera by using Viddler’s webcam recorder? Here is how you do it.
The simple workflow to initiate a recording session using Viddler’s API and the embeddable flash video recorder:
- Authenticate the user account you want to save the recorded video to using the
viddler.users.authmethod with theget_record_tokenargument set to “1″. - Use the
record_tokenreturned by this method to embed the Flash video recorder on the page. 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. - The recorder will launch so that you can record a video.
- After recording is finished the embedded Flash video recorder will call a JavaScript function (see below) which you can use to notify your app when the recording is finished.
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://static.cdn-ec.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://static.cdn-ec.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" 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 Flashvars and JavaScript Callbacks
Please refer to our documentation page on the Viddler Webcam Recorder