Copyright © 2011 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
Is it me or the following code is not returning the expected results? I was thinking that this was going to returned a list of entries for the user. In any case, most of the functions I have tried from the code I downloaded below, returned the same MISSING_KS error.
http://corp.kaltura.com/clients/ps2/kaltura-php5-client.zip
kaltura_client.php
Function
etc......
Function Called
Error returned
Changed Function
etc .....
Function Called
Results returned
Results for User Array
Actually, I was just not initializing the KS session correctly.
After I addedd the following right after creating the client everything worked. I still don't understand the results but Ill keep reading the docs for now.
This is what I was not setting...
Well, this is another way of doing it.
If you'd like the client to do it for you, just use the 'start' method instead of 'startSession'.
What this code is doing is basically creating a new session with the Kaltura Server (to authenticate the user) and keep the ks (session) inside the client so that all later requests will use it (instead of you manually passing the ks in for every method).
Did you put your partner details ?
Try the following page (place this page in the same directory as "kaltura_client.php"):
require_once("kaltura_client.php");
$your_partner_id = "the partner id you recieved when registering";
$your_sub_partner_id = "any id you choose as sub partner (to identify applictions or sites)";
$username = "any user name";
$secert = 'the secret key you got when registering';
$conf = new KalturaConfiguration($your_partner_id, $your_sub_partner_id);
$user = new KalturaSessionUser($username);
$cl = new KalturaClient($conf);
//start function is a wrapper for startsession, it creates a new session and keep the ks in the client.
$result = $cl->start($user, $secert);
print_r($result);
?>
After filling in your partner details (see the inline comments) this will print out the KS result and then you can use the rest of the APIs.
In your changes you added a ks variable, but this is already being passed inside the $kalturaSessionUser after initializing, using the start method will create the ks and keep it inside the client.