本文整理汇总了PHP中KalturaClient::startsession方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaClient::startsession方法的具体用法?PHP KalturaClient::startsession怎么用?PHP KalturaClient::startsession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaClient
的用法示例。
在下文中一共展示了KalturaClient::startsession方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClient
/**
* get the kaltura client
* @param bol $isAdmin default = false
* @param $privileges
* @return unknown_type
*/
function getClient($isAdmin = false, $privileges = null)
{
// get the configuration to use the kaltura client
$kalturaConfig = KalturaHelpers::getServiceConfiguration($this->params);
// inititialize the kaltura client using the above configurations
$kalturaClient = new KalturaClient($kalturaConfig);
// get the current logged in user
$sessionUser = KalturaHelpers::kalturaGetSessionUser();
if ($isAdmin) {
$adminSecret = $this->params->get("kaltura_webservice_admin_secret");
$result = $kalturaClient->startsession($sessionUser, $adminSecret, true, $privileges);
} else {
$secret = $this->params->get("kaltura_webservice_secret");
$result = $kalturaClient->startsession($sessionUser, $secret, false, $privileges);
}
if (count(@$result["error"])) {
return null;
} else {
// now lets get the session key
$session = $result["result"]["ks"];
// set the session so we can use other service methods
$kalturaClient->setKs($session);
}
return $kalturaClient;
}