Exemplo n.º 1
0
 /**
  *
  * @return Kaltura_Client_Client
  */
 public static function getClient()
 {
     if (self::$client) {
         return self::$client;
     }
     if (!class_exists('Kaltura_Client_Client')) {
         throw new Infra_Exception('Kaltura client not found, maybe it wasn\'t generated', Infra_Exception::ERROR_CODE_MISSING_CLIENT_LIB);
     }
     $ks = self::getKs();
     $config = new Kaltura_Client_Configuration();
     $config->serviceUrl = self::getServiceUrl();
     $config->curlTimeout = self::getCurlTimeout();
     $config->setLogger(new Infra_ClientLoggingProxy());
     $settings = Zend_Registry::get('config')->settings;
     if (isset($settings->clientConfig)) {
         foreach ($settings->clientConfig as $attr => $value) {
             $config->{$attr} = $value;
         }
     }
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam('bootstrap');
     if ($bootstrap) {
         $enviroment = $bootstrap->getApplication()->getEnvironment();
         if ($enviroment === 'development') {
             $config->startZendDebuggerSession = true;
         }
     }
     $client = new Kaltura_Client_Client($config);
     $client->setClientTag('Kaltura-' . $settings->applicationName);
     $client->setKs($ks);
     self::$client = $client;
     return $client;
 }
Exemplo n.º 2
0
 public function testMultiRequest()
 {
     $this->_client->startMultiRequest();
     $mixEntry = new Kaltura_Client_Type_MixEntry();
     $mixEntry->name = ".Net Mix";
     $mixEntry->editorType = Kaltura_Client_Enum_EditorType::SIMPLE;
     # Request 1
     $mixEntry = $this->_client->mixing->add($mixEntry);
     # Request 2
     $uploadFilePath = dirname(__FILE__) . '/../resources/' . self::UPLOAD_VIDEO_FILENAME;
     $uploadTokenId = $this->_client->media->upload($uploadFilePath);
     $mediaEntry = new Kaltura_Client_Type_MediaEntry();
     $mediaEntry->name = "Media Entry For Mix";
     $mediaEntry->mediaType = Kaltura_Client_Enum_MediaType::VIDEO;
     # Request 3
     $mediaEntry = $this->_client->media->addFromUploadedFile($mediaEntry, $uploadTokenId);
     # Request 4
     $this->_client->mixing->appendMediaEntry($mixEntry->id, $mediaEntry->id);
     $response = $this->_client->doMultiRequest();
     foreach ($response as $subResponse) {
         if ($subResponse instanceof Kaltura_Client_Exception) {
             throw new Exception("Error occurred: " . $subResponse->getMessage());
         }
     }
     # when accessing the response object we will use an index and not the response number (response number - 1)
     $this->assertTrue($response[0] instanceof Kaltura_Client_Type_MixEntry);
     $mixEntry = $response[0];
     if (is_null($mixEntry->id)) {
         throw new Exception("Failed to add entry within multi request");
     }
 }
 /**
  * 
  * @return Kaltura_Client_Client
  */
 public static function getClient()
 {
     if (self::$client) {
         return self::$client;
     }
     if (!class_exists('Kaltura_Client_Client')) {
         throw new Exception('Kaltura client not found, maybe it wasn\'t generated');
     }
     $partnerId = self::getPartnerId();
     $ks = self::getKs();
     $config = new Kaltura_Client_Configuration($partnerId);
     $config->serviceUrl = self::getServiceUrl();
     $config->curlTimeout = self::getCurlTimeout();
     $config->setLogger(new Infra_ClientLoggingProxy());
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam('bootstrap');
     if ($bootstrap) {
         $enviroment = $bootstrap->getApplication()->getEnvironment();
         if ($enviroment === 'development') {
             $config->startZendDebuggerSession = true;
         }
     }
     $client = new Kaltura_Client_Client($config);
     $client->setKs($ks);
     self::$client = $client;
     return $client;
 }
Exemplo n.º 4
0
 public static function getClient($partnerId, $serviceUrl, $sessionUserId, $adminSecret, $privacyContext = null)
 {
     $config = new \Kaltura_Client_Configuration($partnerId);
     $config->serviceUrl = $serviceUrl;
     $client = new \Kaltura_Client_Client($config);
     $expirySeconds = 86400;
     if (empty($privacyContext)) {
         $privileges = 'disableentitlement';
     } else {
         $privileges = "privacycontext:{$privacyContext},enableentitlement,sessionkey:{$sessionUserId}";
     }
     $ks = $client->generateSessionV2($adminSecret, $sessionUserId, \Kaltura_Client_Enum_SessionType::ADMIN, $partnerId, $expirySeconds, $privileges);
     $client->setKs($ks);
     return $client;
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->offlineMessage = (string) $xml->offlineMessage;
     $this->streamRemoteId = (string) $xml->streamRemoteId;
     $this->streamRemoteBackupId = (string) $xml->streamRemoteBackupId;
     if (empty($xml->bitrates)) {
         $this->bitrates = array();
     } else {
         $this->bitrates = Kaltura_Client_Client::unmarshalItem($xml->bitrates);
     }
     $this->primaryBroadcastingUrl = (string) $xml->primaryBroadcastingUrl;
     $this->secondaryBroadcastingUrl = (string) $xml->secondaryBroadcastingUrl;
     $this->streamName = (string) $xml->streamName;
     $this->streamUrl = (string) $xml->streamUrl;
     $this->hlsStreamUrl = (string) $xml->hlsStreamUrl;
     if (count($xml->dvrStatus)) {
         $this->dvrStatus = (int) $xml->dvrStatus;
     }
     if (count($xml->dvrWindow)) {
         $this->dvrWindow = (int) $xml->dvrWindow;
     }
     $this->urlManager = (string) $xml->urlManager;
     if (empty($xml->liveStreamConfigurations)) {
         $this->liveStreamConfigurations = array();
     } else {
         $this->liveStreamConfigurations = Kaltura_Client_Client::unmarshalItem($xml->liveStreamConfigurations);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->message = (string) $xml->message;
     if (empty($xml->actions)) {
         $this->actions = array();
     } else {
         $this->actions = Kaltura_Client_Client::unmarshalItem($xml->actions);
     }
     if (empty($xml->conditions)) {
         $this->conditions = array();
     } else {
         $this->conditions = Kaltura_Client_Client::unmarshalItem($xml->conditions);
     }
     if (empty($xml->contexts)) {
         $this->contexts = array();
     } else {
         $this->contexts = Kaltura_Client_Client::unmarshalItem($xml->contexts);
     }
     if (!empty($xml->stopProcessing)) {
         $this->stopProcessing = true;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->srcFileSyncLocalPath = (string) $xml->srcFileSyncLocalPath;
     $this->actualSrcFileSyncLocalPath = (string) $xml->actualSrcFileSyncLocalPath;
     $this->srcFileSyncRemoteUrl = (string) $xml->srcFileSyncRemoteUrl;
     if (count($xml->engineVersion)) {
         $this->engineVersion = (int) $xml->engineVersion;
     }
     if (count($xml->flavorParamsOutputId)) {
         $this->flavorParamsOutputId = (int) $xml->flavorParamsOutputId;
     }
     if (!empty($xml->flavorParamsOutput)) {
         $this->flavorParamsOutput = Kaltura_Client_Client::unmarshalItem($xml->flavorParamsOutput);
     }
     if (count($xml->mediaInfoId)) {
         $this->mediaInfoId = (int) $xml->mediaInfoId;
     }
     if (count($xml->currentOperationSet)) {
         $this->currentOperationSet = (int) $xml->currentOperationSet;
     }
     if (count($xml->currentOperationIndex)) {
         $this->currentOperationIndex = (int) $xml->currentOperationIndex;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->id)) {
         $this->id = (int) $xml->id;
     }
     if (count($xml->createdAt)) {
         $this->createdAt = (int) $xml->createdAt;
     }
     if (count($xml->updatedAt)) {
         $this->updatedAt = (int) $xml->updatedAt;
     }
     if (count($xml->partnerId)) {
         $this->partnerId = (int) $xml->partnerId;
     }
     $this->name = (string) $xml->name;
     if (count($xml->status)) {
         $this->status = (int) $xml->status;
     }
     $this->engineType = (string) $xml->engineType;
     if (!empty($xml->entryFilter)) {
         $this->entryFilter = Kaltura_Client_Client::unmarshalItem($xml->entryFilter);
     }
     if (count($xml->actionIfInfected)) {
         $this->actionIfInfected = (int) $xml->actionIfInfected;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->playlistContent = (string) $xml->playlistContent;
     if (empty($xml->filters)) {
         $this->filters = array();
     } else {
         $this->filters = Kaltura_Client_Client::unmarshalItem($xml->filters);
     }
     if (count($xml->totalResults)) {
         $this->totalResults = (int) $xml->totalResults;
     }
     if (count($xml->playlistType)) {
         $this->playlistType = (int) $xml->playlistType;
     }
     if (count($xml->plays)) {
         $this->plays = (int) $xml->plays;
     }
     if (count($xml->views)) {
         $this->views = (int) $xml->views;
     }
     if (count($xml->duration)) {
         $this->duration = (int) $xml->duration;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->distributionProfileId)) {
         $this->distributionProfileId = (int) $xml->distributionProfileId;
     }
     if (!empty($xml->distributionProfile)) {
         $this->distributionProfile = Kaltura_Client_Client::unmarshalItem($xml->distributionProfile);
     }
     if (count($xml->entryDistributionId)) {
         $this->entryDistributionId = (int) $xml->entryDistributionId;
     }
     if (!empty($xml->entryDistribution)) {
         $this->entryDistribution = Kaltura_Client_Client::unmarshalItem($xml->entryDistribution);
     }
     $this->remoteId = (string) $xml->remoteId;
     $this->providerType = (string) $xml->providerType;
     if (!empty($xml->providerData)) {
         $this->providerData = Kaltura_Client_Client::unmarshalItem($xml->providerData);
     }
     $this->results = (string) $xml->results;
     $this->sentData = (string) $xml->sentData;
     if (empty($xml->mediaFiles)) {
         $this->mediaFiles = array();
     } else {
         $this->mediaFiles = Kaltura_Client_Client::unmarshalItem($xml->mediaFiles);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->userId = (string) $xml->userId;
     $this->uploadedBy = (string) $xml->uploadedBy;
     if (count($xml->conversionProfileId)) {
         $this->conversionProfileId = (int) $xml->conversionProfileId;
     }
     $this->resultsFileLocalPath = (string) $xml->resultsFileLocalPath;
     $this->resultsFileUrl = (string) $xml->resultsFileUrl;
     if (count($xml->numOfEntries)) {
         $this->numOfEntries = (int) $xml->numOfEntries;
     }
     if (count($xml->numOfObjects)) {
         $this->numOfObjects = (int) $xml->numOfObjects;
     }
     $this->filePath = (string) $xml->filePath;
     $this->bulkUploadObjectType = (string) $xml->bulkUploadObjectType;
     $this->fileName = (string) $xml->fileName;
     if (!empty($xml->objectData)) {
         $this->objectData = Kaltura_Client_Client::unmarshalItem($xml->objectData);
     }
     $this->type = (string) $xml->type;
     $this->emailRecipients = (string) $xml->emailRecipients;
     if (count($xml->numOfErrorObjects)) {
         $this->numOfErrorObjects = (int) $xml->numOfErrorObjects;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->id)) {
         $this->id = (int) $xml->id;
     }
     if (count($xml->partnerId)) {
         $this->partnerId = (int) $xml->partnerId;
     }
     $this->name = (string) $xml->name;
     $this->systemName = (string) $xml->systemName;
     $this->description = (string) $xml->description;
     if (count($xml->createdAt)) {
         $this->createdAt = (int) $xml->createdAt;
     }
     if (count($xml->updatedAt)) {
         $this->updatedAt = (int) $xml->updatedAt;
     }
     if (count($xml->isDefault)) {
         $this->isDefault = (int) $xml->isDefault;
     }
     if (empty($xml->rules)) {
         $this->rules = array();
     } else {
         $this->rules = Kaltura_Client_Client::unmarshalItem($xml->rules);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->id)) {
         $this->id = (int) $xml->id;
     }
     if (count($xml->partnerId)) {
         $this->partnerId = (int) $xml->partnerId;
     }
     $this->name = (string) $xml->name;
     $this->systemName = (string) $xml->systemName;
     $this->description = (string) $xml->description;
     if (count($xml->createdAt)) {
         $this->createdAt = (int) $xml->createdAt;
     }
     if (count($xml->isSystemDefault)) {
         $this->isSystemDefault = (int) $xml->isSystemDefault;
     }
     $this->tags = (string) $xml->tags;
     if (empty($xml->requiredPermissions)) {
         $this->requiredPermissions = array();
     } else {
         $this->requiredPermissions = Kaltura_Client_Client::unmarshalItem($xml->requiredPermissions);
     }
     if (count($xml->sourceRemoteStorageProfileId)) {
         $this->sourceRemoteStorageProfileId = (int) $xml->sourceRemoteStorageProfileId;
     }
     if (count($xml->remoteStorageProfileIds)) {
         $this->remoteStorageProfileIds = (int) $xml->remoteStorageProfileIds;
     }
     $this->mediaParserType = (string) $xml->mediaParserType;
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (!empty($xml->field)) {
         $this->field = Kaltura_Client_Client::unmarshalItem($xml->field);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->key = (string) $xml->key;
     if (!empty($xml->value)) {
         $this->value = Kaltura_Client_Client::unmarshalItem($xml->value);
     }
 }
 public function registerPartner($partner)
 {
     $config = $this->_client->getConfig();
     $this->_client->setKs(null);
     $config->partnerId = null;
     $oldTimeout = $config->curlTimeout;
     $config->curlTimeout = 40;
     $result = $this->_client->partner->register($partner);
     $config->curlTimeout = $oldTimeout;
     return $result;
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->orderBy = (string) $xml->orderBy;
     if (!empty($xml->advancedSearch)) {
         $this->advancedSearch = Kaltura_Client_Client::unmarshalItem($xml->advancedSearch);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->id)) {
         $this->id = (int) $xml->id;
     }
     if (count($xml->partnerId)) {
         $this->partnerId = (int) $xml->partnerId;
     }
     $this->name = (string) $xml->name;
     $this->description = (string) $xml->description;
     $this->type = (string) $xml->type;
     if (count($xml->status)) {
         $this->status = (int) $xml->status;
     }
     if (count($xml->conversionProfileId)) {
         $this->conversionProfileId = (int) $xml->conversionProfileId;
     }
     if (count($xml->dc)) {
         $this->dc = (int) $xml->dc;
     }
     $this->path = (string) $xml->path;
     if (count($xml->fileSizeCheckInterval)) {
         $this->fileSizeCheckInterval = (int) $xml->fileSizeCheckInterval;
     }
     if (count($xml->fileDeletePolicy)) {
         $this->fileDeletePolicy = (int) $xml->fileDeletePolicy;
     }
     if (count($xml->autoFileDeleteDays)) {
         $this->autoFileDeleteDays = (int) $xml->autoFileDeleteDays;
     }
     $this->fileHandlerType = (string) $xml->fileHandlerType;
     $this->fileNamePatterns = (string) $xml->fileNamePatterns;
     if (!empty($xml->fileHandlerConfig)) {
         $this->fileHandlerConfig = Kaltura_Client_Client::unmarshalItem($xml->fileHandlerConfig);
     }
     $this->tags = (string) $xml->tags;
     $this->errorCode = (string) $xml->errorCode;
     $this->errorDescription = (string) $xml->errorDescription;
     $this->ignoreFileNamePatterns = (string) $xml->ignoreFileNamePatterns;
     if (count($xml->createdAt)) {
         $this->createdAt = (int) $xml->createdAt;
     }
     if (count($xml->updatedAt)) {
         $this->updatedAt = (int) $xml->updatedAt;
     }
     if (count($xml->lastAccessedAt)) {
         $this->lastAccessedAt = (int) $xml->lastAccessedAt;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (empty($xml->emailRecipients)) {
         $this->emailRecipients = array();
     } else {
         $this->emailRecipients = Kaltura_Client_Client::unmarshalItem($xml->emailRecipients);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->validationError = (string) $xml->validationError;
     if (empty($xml->assetDistributionConditions)) {
         $this->assetDistributionConditions = array();
     } else {
         $this->assetDistributionConditions = Kaltura_Client_Client::unmarshalItem($xml->assetDistributionConditions);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (!empty($xml->resource)) {
         $this->resource = Kaltura_Client_Client::unmarshalItem($xml->resource);
     }
     if (count($xml->assetParamsId)) {
         $this->assetParamsId = (int) $xml->assetParamsId;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->columns = (string) $xml->columns;
     if (empty($xml->results)) {
         $this->results = array();
     } else {
         $this->results = Kaltura_Client_Client::unmarshalItem($xml->results);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->xslt = (string) $xml->xslt;
     if (empty($xml->itemXpathsToExtend)) {
         $this->itemXpathsToExtend = array();
     } else {
         $this->itemXpathsToExtend = Kaltura_Client_Client::unmarshalItem($xml->itemXpathsToExtend);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (!empty($xml->conversionProfileIdFilter)) {
         $this->conversionProfileIdFilter = Kaltura_Client_Client::unmarshalItem($xml->conversionProfileIdFilter);
     }
     if (!empty($xml->assetParamsIdFilter)) {
         $this->assetParamsIdFilter = Kaltura_Client_Client::unmarshalItem($xml->assetParamsIdFilter);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (!empty($xml->flavorAsset)) {
         $this->flavorAsset = Kaltura_Client_Client::unmarshalItem($xml->flavorAsset);
     }
     if (!empty($xml->flavorParams)) {
         $this->flavorParams = Kaltura_Client_Client::unmarshalItem($xml->flavorParams);
     }
     $this->entryId = (string) $xml->entryId;
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     $this->xpath = (string) $xml->xpath;
     if (!empty($xml->identifier)) {
         $this->identifier = Kaltura_Client_Client::unmarshalItem($xml->identifier);
     }
     if (count($xml->extensionMode)) {
         $this->extensionMode = (int) $xml->extensionMode;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (!empty($xml->isSiteRestricted)) {
         $this->isSiteRestricted = true;
     }
     if (!empty($xml->isCountryRestricted)) {
         $this->isCountryRestricted = true;
     }
     if (!empty($xml->isSessionRestricted)) {
         $this->isSessionRestricted = true;
     }
     if (!empty($xml->isIpAddressRestricted)) {
         $this->isIpAddressRestricted = true;
     }
     if (!empty($xml->isUserAgentRestricted)) {
         $this->isUserAgentRestricted = true;
     }
     if (count($xml->previewLength)) {
         $this->previewLength = (int) $xml->previewLength;
     }
     if (!empty($xml->isScheduledNow)) {
         $this->isScheduledNow = true;
     }
     if (!empty($xml->isAdmin)) {
         $this->isAdmin = true;
     }
     $this->streamerType = (string) $xml->streamerType;
     $this->mediaProtocol = (string) $xml->mediaProtocol;
     $this->storageProfilesXML = (string) $xml->storageProfilesXML;
     if (empty($xml->accessControlMessages)) {
         $this->accessControlMessages = array();
     } else {
         $this->accessControlMessages = Kaltura_Client_Client::unmarshalItem($xml->accessControlMessages);
     }
     if (empty($xml->accessControlActions)) {
         $this->accessControlActions = array();
     } else {
         $this->accessControlActions = Kaltura_Client_Client::unmarshalItem($xml->accessControlActions);
     }
     if (empty($xml->flavorAssets)) {
         $this->flavorAssets = array();
     } else {
         $this->flavorAssets = Kaltura_Client_Client::unmarshalItem($xml->flavorAssets);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (empty($xml->objects)) {
         $this->objects = array();
     } else {
         $this->objects = Kaltura_Client_Client::unmarshalItem($xml->objects);
     }
     if (count($xml->totalCount)) {
         $this->totalCount = (int) $xml->totalCount;
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->csvVersion)) {
         $this->csvVersion = (int) $xml->csvVersion;
     }
     if (empty($xml->columns)) {
         $this->columns = array();
     } else {
         $this->columns = Kaltura_Client_Client::unmarshalItem($xml->columns);
     }
 }
 public function __construct(SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (empty($xml->objects)) {
         $this->objects = array();
     } else {
         $this->objects = Kaltura_Client_Client::unmarshalItem($xml->objects);
     }
     if (!empty($xml->needMediaInfo)) {
         $this->needMediaInfo = true;
     }
 }