Back to Top

Record and Play the video using Viddler Series #1

Record and Play the video using Viddler

I am glad to inform you that again I am starting the article series for Record and Play the video using Viddler API.

Today in this first series of article, i will explain basics about viddler and how to record the video using Viddler API.Viddler provides the api to record and play video.

What Viddler API do?

Viddler give us to record the things and then save video on them server and that video we can fetch to show in our site as Play that video.

Viddle API is not free. Its paid version and here explained below things are trial version and I have made trial demo.

You can download php class and examples of PHP viddler from here [ ]. You can download ,record and play through webpage.

To Record Video

Step 1:

create one php file into folder examples which is in the demo you have download. Here I am going to create file record_video.php.

Step 2:

Include phpviddler.php file into file and create object of it.

include '../phpviddler.php';
$v = new Viddler_V2('', TRUE);  // is API key

Step 3:

Next, Add authentication details of it.

$auth = $v->viddler_users_auth(
              'user'=> '',
              'password'=> '',
              'get_record_token'=> 1 

Step 4:

Now, create session and display errors or authentication response using following code:

// Get your session id
$session_id = (isset($auth['auth']['sessionid'])) ? $auth['auth']['sessionid'] : '';

// If no session id, print errors
if (!empty($session_id))
	$info = $v->viddler_users_getProfile(array(
		'sessionid'=> $session_id

	// If any errors print them out
	// This should NOT be done in a production application
	// An exception should be used instead
	// For example purposes only

	if (isset($info['error']))

// In a live example you SHOULD NOT show errors, rather write an exception

Step 5:

Flash code for recording a video:

 " quality="high" scale="noScale" bgcolor="#000000"
allowScriptAccess="always" allowNetworking="all" width="449" height="545" name="viddler_recorder"
flashvars="fake=1&enableCallbacks=1;&recordToken=" align="middle" type="application/x-shockwave-flash"  pluginspage="" /> 

Step 6:

Calling javascript function which will alert video_id of recorded video

function recordDone(username,user_video_number,video_id) {
    var record_id =video_id;
    alert(video_id); // To handle recorded data

After Adding above codes into record_video.php file,click on start recording. After recording finish, Press on the save button so it will get option to store that video on them server.

After saving that video, I have alert the video_id which is necessary so on the basis of it we can get uploaded video to play on our server.

Technical Notes

1. For saving recorded video I have to set get_record_token=> 1 in Request URL so it will return record token which passed.

2. For Fetching Video_ID we need to pass enableCallbacks=> 1 in flashvars attribute.

Trial version of Viddler account gives only 3 video access. So, You can upload 3 videos only after that its give you permission denied and security token error.For the solution of this, you need to remove uploaded video from

How to remove uploaded video?

1. Go to the Here, You get the uploaded video list.

2. Now, You just need to click on edit and then in left panel you will get the Delete option. Here you can delete those uploaded videos and again you can start to record the videos.


so to conclude, It’s very easy to record your videos using Viddler, isn’t? I have completed the first article here. we checked how to record video using viddler API.In Next article , I will show you how to play recorded video in PHP.

Recommended Read:

To convert PHP array into Javascript array
To grab content from nested tags in PHP

If you have any query or question,tell us in the comment section :). Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

Learn Responsive Web Design Online

Posted on 6 years ago


Two years blogiversary

Posted on 5 years ago


Welcome to Creative Dev

Posted on 7 years ago


Hello world

Updated 1 month ago

Nick Carter

In depth Understanding of Laravel Core

Updated 3 months ago


ECMAScript 6 New Features – 2

Updated 1 year ago


The Reader’s Poll – June 2015

Posted on 4 years ago


The Reader’s Poll – August 2014

Posted on 5 years ago


The Reader’s Poll – June 2014

Posted on 5 years ago


The Readers’ Poll – May 2014

Posted on 5 years ago


The Readers’ Poll – August 2013

Posted on 6 years ago