. // // @ignore // =================================================================================================== /** * @package Kaltura * @subpackage Client */ class Kaltura_Client_MediaService extends Kaltura_Client_ServiceBase { function __construct(Kaltura_Client_Client $client = null) { parent::__construct($client); } function add(Kaltura_Client_Type_MediaEntry $entry) { $kparams = array(); $this->client->addParam($kparams, "entry", $entry->toParams()); $this->client->queueServiceActionCall("media", "add", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addContent($entryId, Kaltura_Client_Type_Resource $resource = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); if ($resource !== null) $this->client->addParam($kparams, "resource", $resource->toParams()); $this->client->queueServiceActionCall("media", "addContent", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromUrl(Kaltura_Client_Type_MediaEntry $mediaEntry, $url) { $kparams = array(); $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->addParam($kparams, "url", $url); $this->client->queueServiceActionCall("media", "addFromUrl", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromSearchResult(Kaltura_Client_Type_MediaEntry $mediaEntry = null, Kaltura_Client_Type_SearchResult $searchResult = null) { $kparams = array(); if ($mediaEntry !== null) $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); if ($searchResult !== null) $this->client->addParam($kparams, "searchResult", $searchResult->toParams()); $this->client->queueServiceActionCall("media", "addFromSearchResult", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromUploadedFile(Kaltura_Client_Type_MediaEntry $mediaEntry, $uploadTokenId) { $kparams = array(); $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); $this->client->queueServiceActionCall("media", "addFromUploadedFile", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromRecordedWebcam(Kaltura_Client_Type_MediaEntry $mediaEntry, $webcamTokenId) { $kparams = array(); $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->addParam($kparams, "webcamTokenId", $webcamTokenId); $this->client->queueServiceActionCall("media", "addFromRecordedWebcam", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromEntry($sourceEntryId, Kaltura_Client_Type_MediaEntry $mediaEntry = null, $sourceFlavorParamsId = null) { $kparams = array(); $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); if ($mediaEntry !== null) $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->addParam($kparams, "sourceFlavorParamsId", $sourceFlavorParamsId); $this->client->queueServiceActionCall("media", "addFromEntry", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function addFromFlavorAsset($sourceFlavorAssetId, Kaltura_Client_Type_MediaEntry $mediaEntry = null) { $kparams = array(); $this->client->addParam($kparams, "sourceFlavorAssetId", $sourceFlavorAssetId); if ($mediaEntry !== null) $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->queueServiceActionCall("media", "addFromFlavorAsset", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function convert($entryId, $conversionProfileId = null, array $dynamicConversionAttributes = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); if ($dynamicConversionAttributes !== null) foreach($dynamicConversionAttributes as $index => $obj) { $this->client->addParam($kparams, "dynamicConversionAttributes:$index", $obj->toParams()); } $this->client->queueServiceActionCall("media", "convert", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "integer"); return $resultObject; } function get($entryId, $version = -1) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "version", $version); $this->client->queueServiceActionCall("media", "get", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function getMrss($entryId, array $extendingItemsArray = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); if ($extendingItemsArray !== null) foreach($extendingItemsArray as $index => $obj) { $this->client->addParam($kparams, "extendingItemsArray:$index", $obj->toParams()); } $this->client->queueServiceActionCall("media", "getMrss", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); if(!$resultObject) $resultObject = array(); $this->client->validateObjectType($resultObject, "string"); return $resultObject; } function update($entryId, Kaltura_Client_Type_MediaEntry $mediaEntry) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); $this->client->queueServiceActionCall("media", "update", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function updateContent($entryId, Kaltura_Client_Type_Resource $resource, $conversionProfileId = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "resource", $resource->toParams()); $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); $this->client->queueServiceActionCall("media", "updateContent", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function delete($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("media", "delete", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function approveReplace($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("media", "approveReplace", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function cancelReplace($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("media", "cancelReplace", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function listAction(Kaltura_Client_Type_MediaEntryFilter $filter = null, Kaltura_Client_Type_FilterPager $pager = null) { $kparams = array(); if ($filter !== null) $this->client->addParam($kparams, "filter", $filter->toParams()); if ($pager !== null) $this->client->addParam($kparams, "pager", $pager->toParams()); $this->client->queueServiceActionCall("media", "list", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaListResponse"); return $resultObject; } function count(Kaltura_Client_Type_MediaEntryFilter $filter = null) { $kparams = array(); if ($filter !== null) $this->client->addParam($kparams, "filter", $filter->toParams()); $this->client->queueServiceActionCall("media", "count", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "integer"); return $resultObject; } function upload($fileData) { $kparams = array(); $kfiles = array(); $this->client->addParam($kfiles, "fileData", $fileData); $this->client->queueServiceActionCall("media", "upload", $kparams, $kfiles); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); if(!$resultObject) $resultObject = array(); $this->client->validateObjectType($resultObject, "string"); return $resultObject; } function updateThumbnail($entryId, $timeOffset, $flavorParamsId = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "timeOffset", $timeOffset); $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); $this->client->queueServiceActionCall("media", "updateThumbnail", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function updateThumbnailFromSourceEntry($entryId, $sourceEntryId, $timeOffset, $flavorParamsId = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); $this->client->addParam($kparams, "timeOffset", $timeOffset); $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); $this->client->queueServiceActionCall("media", "updateThumbnailFromSourceEntry", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function updateThumbnailJpeg($entryId, $fileData) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $kfiles = array(); $this->client->addParam($kfiles, "fileData", $fileData); $this->client->queueServiceActionCall("media", "updateThumbnailJpeg", $kparams, $kfiles); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_MediaEntry"); return $resultObject; } function updateThumbnailFromUrl($entryId, $url) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "url", $url); $this->client->queueServiceActionCall("media", "updateThumbnailFromUrl", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_BaseEntry"); return $resultObject; } function requestConversion($entryId, $fileFormat) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "fileFormat", $fileFormat); $this->client->queueServiceActionCall("media", "requestConversion", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "integer"); return $resultObject; } function flag(Kaltura_Client_Type_ModerationFlag $moderationFlag) { $kparams = array(); $this->client->addParam($kparams, "moderationFlag", $moderationFlag->toParams()); $this->client->queueServiceActionCall("media", "flag", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function reject($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("media", "reject", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function approve($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("media", "approve", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function listFlags($entryId, Kaltura_Client_Type_FilterPager $pager = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); if ($pager !== null) $this->client->addParam($kparams, "pager", $pager->toParams()); $this->client->queueServiceActionCall("media", "listFlags", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_ModerationFlagListResponse"); return $resultObject; } function anonymousRank($entryId, $rank) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "rank", $rank); $this->client->queueServiceActionCall("media", "anonymousRank", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function bulkUploadAdd($fileData, Kaltura_Client_Type_BulkUploadJobData $bulkUploadData = null, Kaltura_Client_Type_BulkUploadEntryData $bulkUploadEntryData = null) { $kparams = array(); $kfiles = array(); $this->client->addParam($kfiles, "fileData", $fileData); if ($bulkUploadData !== null) $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); if ($bulkUploadEntryData !== null) $this->client->addParam($kparams, "bulkUploadEntryData", $bulkUploadEntryData->toParams()); $this->client->queueServiceActionCall("media", "bulkUploadAdd", $kparams, $kfiles); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_BulkUpload"); return $resultObject; } }