当前位置: 首页>>代码示例>>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;未经允许,请勿转载。