コード例 #1
0
function get_se_wizard($div, $width, $height, $entryId)
{
    $params = "''";
    $url = "''";
    $platformUser = "******"" . KalturaHelpers::getSessionUser()->userId . "\"";
    $kalturaSecret = KalturaHelpers::getPlatformKey("secret", "");
    if ($kalturaSecret != null && strlen($kalturaSecret) > 0) {
        try {
            $kClient = new KalturaClient(KalturaHelpers::getServiceConfiguration());
            $kalturaUser = KalturaHelpers::getPlatformKey("user", "");
            $ksId = $kClient->session->start($kalturaSecret, $kalturaUser, KalturaSessionType::USER, null, 86400, "*");
            $kClient->setKs($ksId);
            $url = KalturaHelpers::getSimpleEditorUrl(KalturaHelpers::getPlatformKey("editor", null));
            $params = KalturaHelpers::flashVarsToString(KalturaHelpers::getSimpleEditorFlashVars($ksId, $entryId, "entry", ""));
        } catch (Exception $exp) {
            $flash_embed = $exp->getMessage();
        }
        $flash_embed = '
	      <div id="' . $div . '" style="width:' . $width . 'px;height:' . $height . ';">
    	  <script type="text/javascript">
        var kso = new SWFObject("' . $url . '", "KalturaSW", "' . $width . '", "' . $height . '", "9", "#ffffff");
        kso.addParam("flashVars", "' . $params . '");
        kso.addParam("allowScriptAccess", "always");
        kso.addParam("allowFullScreen", "TRUE");
        kso.addParam("allowNetworking", "all");
        if(kso.installedVer.major >= 9) {
          kso.write("' . $div . '");
        } else {
          document.getElementById("' . $div . '").innerHTML = "Flash player version 9 and above is required. <a href=\\"http://get.adobe.com/flashplayer/\\">Upgrade your flash version</a>";
        }      
	   	  </script>
      ';
        return $flash_embed;
    }
}
コード例 #2
0
 function getKalturaClient($isAdmin = false, $privileges = null)
 {
     // get the configuration to use the kaltura client
     $kalturaConfig = KalturaHelpers::getServiceConfiguration();
     $sessionUser = KalturaHelpers::getSessionUser();
     if (!$privileges) {
         $privileges = 'edit:*';
     }
     // inititialize the kaltura client using the above configurations
     $kalturaClient = new KalturaClient($kalturaConfig);
     // get the current logged in user
     //		$user = KalturaHelpers::getPlatformKey("user", "");
     $user = $sessionUser->userId;
     if ($isAdmin) {
         $adminSecret = KalturaHelpers::getPlatformKey("admin_secret", "");
         $ksId = $kalturaClient->session->start($adminSecret, $user, KalturaSessionType::ADMIN, -1, 86400, $privileges);
     } else {
         $secret = KalturaHelpers::getPlatformKey("secret", "");
         $ksId = $kalturaClient->session->start($secret, $user, KalturaSessionType::USER, -1, 86400, $privileges);
     }
     $kalturaClient->setKs($ksId);
     return $kalturaClient;
 }
コード例 #3
0
ファイル: kaltura_helpers.php プロジェクト: acteg/model_bo
 function hasMobileFlavores()
 {
     try {
         $kaltura_client = KalturaHelpers::getKalturaClient(TRUE);
         $session_user = KalturaHelpers::getSessionUser();
         $filter = new KalturaPermissionFilter();
         // Class KalturaPermissionName don't exist in later versions of client
         // library, so just replace the needed property with its value.
         $filter->nameEqual = 'FEATURE_MOBILE_FLAVORS';
         // create a permission service object
         $permissionService = new KalturaPermissionService($kaltura_client);
         $res = $permissionService->listAction($filter);
         if ($res->totalCount == 1) {
             // expected only one permission or no permissions at all
             if ($res->objects[0]->status == KalturaPermissionStatus::ACTIVE) {
                 return TRUE;
             }
         }
     } catch (Exception $e) {
         watchdog_exception('kaltura', $e);
     }
     return FALSE;
 }
コード例 #4
0
 function getKalturaClient($isAdmin = false, $privileges = null)
 {
     // get the configuration to use the kaltura client
     $kalturaConfig = KalturaHelpers::getServiceConfiguration();
     if (!$privileges) {
         $privileges = 'edit:*';
     }
     // inititialize the kaltura client using the above configurations
     $kalturaClient = new KalturaClient($kalturaConfig);
     // get the current logged in user
     $sessionUser = KalturaHelpers::getSessionUser();
     if ($isAdmin) {
         $adminSecret = variable_get("kaltura_admin_secret", "");
         $result = $kalturaClient->startSession($sessionUser, $adminSecret, true, $privileges);
     } else {
         $secret = variable_get("kaltura_secret", "");
         $result = $kalturaClient->startSession($sessionUser, $secret, false, $privileges);
     }
     if (count(@$result["error"])) {
         watchdog("kaltura", $result["error"][0]["code"] . " - " . $result["error"][0]["desc"]);
         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;
 }
コード例 #5
0
ファイル: kaltura_helpers.php プロジェクト: avlsx/flers_haja
 function hasMobileFlavores()
 {
     $kaltura_client = KalturaHelpers::getKalturaClient(TRUE);
     $session_user = KalturaHelpers::getSessionUser();
     $filter = new KalturaPermissionFilter();
     $filter->nameEqual = KalturaPermissionName::FEATURE_MOBILE_FLAVORS;
     // create a permission service object
     $permissionService = new KalturaPermissionService($kaltura_client);
     $res = $permissionService->listAction($filter);
     if ($res->totalCount == 1) {
         // expected only one permission or no permissions at all
         if ($res->objects[0]->status == KalturaPermissionStatus::ACTIVE) {
             return TRUE;
         }
     }
     return FALSE;
 }
コード例 #6
0
 function getKalturaClient($isAdmin = false, $privileges = null)
 {
     // get the configuration to use the kaltura client
     $kalturaConfig = KalturaHelpers::getServiceConfiguration();
     if (!$privileges) {
         $privileges = 'edit:*';
     }
     // inititialize the kaltura client using the above configurations
     $kalturaClient = new KalturaClient($kalturaConfig);
     // get the current logged in user
     $sessionUser = KalturaHelpers::getSessionUser();
     // get the variables requireed to start a session
     $partnerId = variable_get('kaltura_partner_id', '');
     $secret = variable_get('kaltura_secret', '');
     $adminSecret = variable_get('kaltura_admin_secret', '');
     if ($isAdmin) {
         $result = $kalturaClient->session->start($adminSecret, $sessionUser->id, KalturaSessionType::ADMIN, $partnerId, 86400, $privileges);
     } else {
         $result = $kalturaClient->session->start($secret, $sessionUser->id, KalturaSessionType::USER, $partnerId, 86400, $privileges);
     }
     $len = strlen($result);
     /** proper method for error checking please
     		if ($len!=116)
     		{
     			watchdog("kaltura", $result );
     			return null;
     		}else{
     				*/
     // set the session so we can use other service methods
     $kalturaClient->setKs($result);
     //}
     return $kalturaClient;
 }