Back to Top

Record and Play the video using Viddler Series #2

Record and Play video using Viddler API

Here I come with the second and last article of viddler series. If you are not aware about the previous article,you can take a look at that article and come back here after completing that article.

Let’s see flashback of the previous article first.


Yesterday in previous article, we have seen the basic idea about Viddler and Viddler API.Also, We have covered how to record videos using viddler api.

In this article:

In this article, we will take step forward to viddler API.Here step by step,I will show how to play the recorded video using Viddler API.

Let’s look into the example to play Viddler API in PHP.

When I have recorded video and save that video,fetch the video_id. You can get that code into previous article. So, Here using that video_id, we will get and play that video in our site.

Step 1:

First of all, create one file into that demo folder.For example. I am creating get_specific_video.php file here.

Step 2:

Include phpviddler.php file, create viddler object using API key and authenticate user same as we had done in previous article:

include '../phpviddler.php';

//Example to auth as you and get your videos
include '../phpviddler.php';

//Create viddler object 
$v = new Viddler_V2('', TRUE); //key

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

Step 3:

Next, get the your session id and validate session. Then call viddler_videos_getDetails function with the video id returned when you save the video.

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

//If no session id, print errors
if (! empty($session_id)) {
	$videos = $v->viddler_videos_getDetails(
									'video_id' 		=> '', // Returned Video_ID
									'add_embed_code'=> 1,
									'sessionid' 	=> $auth['auth']['sessionid']
echo $videos['video']['embed_code'];

Here, You will ge the embed_code in response of viddler_videos_getDetails function. if video not found, you will get error code.


So now we have covered both how to record and how to play recorded video using viddler API. I hope you have enjoyed series articles about viddler API. It would be great if you share your thoughts below in comment.

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

How to use EXISTS and NOT EXISTS in MySQL?

Posted on 4 years ago


Newly Approved Joomla Module

Posted on 5 years ago


How to use Git init command

Posted on 2 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