當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KalturaClient::setKS方法代碼示例

本文整理匯總了PHP中KalturaClient::setKS方法的典型用法代碼示例。如果您正苦於以下問題:PHP KalturaClient::setKS方法的具體用法?PHP KalturaClient::setKS怎麽用?PHP KalturaClient::setKS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KalturaClient的用法示例。


在下文中一共展示了KalturaClient::setKS方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getClient

 function getClient()
 {
     // Get kaltura configuration file
     require_once realpath(dirname(__FILE__)) . '/../config/kConf.php';
     $kConf = new kConf();
     // Load kaltura client
     require_once realpath(dirname(__FILE__)) . '/../../clients/php5/KalturaClient.php';
     try {
         $conf = new KalturaConfiguration($this->partnerId);
         $conf->serviceUrl = 'http://' . $kConf->get('www_host');
         $client = new KalturaClient($conf);
         $client->setKS($this->Ks);
     } catch (Exception $e) {
         $this->error = 'Error setting KS. <a href="' . $_SERVER['SCRIPT_NAME'] . '">Try again</a>';
         die($this->error);
         return false;
     }
     return $client;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:19,代碼來源:secure_form.php

示例2: getClient

 function getClient()
 {
     // Get kaltura configuration file
     require_once realpath(dirname(__FILE__)) . '/../../infra/kConf.php';
     $kConf = new kConf();
     // Load kaltura client
     require_once realpath(dirname(__FILE__)) . '/../../clients/php5/KalturaClient.php';
     try {
         $conf = new KalturaConfiguration(null);
         $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "https://" : "http://";
         $port = null;
         if (is_null(parse_url($kConf->get('www_host'), PHP_URL_PORT))) {
             $port = isset($_SERVER["SERVER_PORT"]) ? $_SERVER["SERVER_PORT"] : 80;
         }
         $conf->serviceUrl = $protocol . $kConf->get('www_host') . ($port ? ':' . $port : "");
         $client = new KalturaClient($conf);
         $client->setKS($this->Ks);
     } catch (Exception $e) {
         $this->error = 'Error setting KS. <a href="' . $_SERVER['SCRIPT_NAME'] . '">Try again</a>';
         die($this->error);
         return false;
     }
     return $client;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:24,代碼來源:secure_form.php

示例3: getClient

 function getClient()
 {
     global $mwEmbedRoot, $wgKalturaUiConfCacheTime, $wgKalturaServiceUrl, $wgScriptCacheDirectory;
     $cacheDir = $wgScriptCacheDirectory;
     $cacheFile = $this->getCacheDir() . '/' . $this->getPartnerId() . ".ks.txt";
     $cacheLife = $wgKalturaUiConfCacheTime;
     $conf = new KalturaConfiguration($this->getPartnerId());
     $conf->serviceUrl = $wgKalturaServiceUrl;
     $client = new KalturaClient($conf);
     // Check modify time on cached php file
     $filemtime = @filemtime($cacheFile);
     // returns FALSE if file does not exist
     if (!$filemtime || filesize($cacheFile) === 0 || time() - $filemtime >= $cacheLife) {
         try {
             $session = $client->session->startWidgetSession($this->playerAttributes['wid']);
             $this->ks = $session->ks;
             file_put_contents($cacheFile, $this->ks);
         } catch (Exception $e) {
             $this->fatalIframeError(KALTURA_GENERIC_SERVER_ERROR . "\n" . $e->getMessage());
         }
     } else {
         $this->ks = file_get_contents($cacheFile);
     }
     // Set the kaltura ks and return the client
     $client->setKS($this->ks);
     return $client;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:27,代碼來源:kalturaIframe.php

示例4: getClient

 public function getClient()
 {
     global $wgKalturaServiceTimeout, $wgLogApiRequests;
     $cacheFile = $this->getCacheDir() . '/' . $this->getWidgetId() . '.' . $this->getCacheSt() . ".ks.txt";
     $conf = new KalturaConfiguration(null);
     $conf->serviceUrl = $this->getServiceConfig('ServiceUrl');
     $conf->serviceBase = $this->getServiceConfig('ServiceBase');
     $conf->clientTag = $this->clientTag;
     $conf->curlTimeout = $wgKalturaServiceTimeout;
     $conf->userAgent = $this->getUserAgent();
     $conf->verifySSL = false;
     $conf->requestHeaders = array($this->getRemoteAddrHeader());
     if ($wgLogApiRequests) {
         require_once 'KalturaLogger.php';
         $conf->setLogger(new KalturaLogger());
     }
     $client = new KalturaClient($conf);
     // Set KS
     if (isset($this->urlParameters['flashvars']['ks'])) {
         $this->ks = $this->urlParameters['flashvars']['ks'];
     } else {
         if (isset($this->urlParameters['ks'])) {
             $this->ks = $this->urlParameters['ks'];
         }
     }
     // check for empty ks
     if (!isset($this->ks) || trim($this->ks) == '') {
         if ($this->canUseCacheFile($cacheFile)) {
             $this->ks = file_get_contents($cacheFile);
         } else {
             try {
                 $session = $client->session->startWidgetSession($this->urlParameters['wid']);
                 $this->ks = $session->ks;
                 $this->partnerId = $session->partnerId;
                 $this->putCacheFile($cacheFile, $this->ks);
             } catch (Exception $e) {
                 throw new Exception(KALTURA_GENERIC_SERVER_ERROR . "\n" . $e->getMessage());
             }
         }
     }
     // Set the kaltura ks and return the client
     $client->setKS($this->ks);
     return $client;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:44,代碼來源:KalturaResultObject.php

示例5: getClient

 function getClient()
 {
     try {
         $conf = new KalturaConfiguration($this->partnerId);
         $client = new KalturaClient($conf);
         $client->setKS($this->ks);
     } catch (Exception $e) {
         $this->error = 'Error setting KS. <a href="' . $_SERVER['SCRIPT_NAME'] . '">Try again</a>';
         die($this->error);
         return false;
     }
     return $client;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:13,代碼來源:ListEntries.php


注:本文中的KalturaClient::setKS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。