本文整理汇总了PHP中KalturaClient::startMultiRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaClient::startMultiRequest方法的具体用法?PHP KalturaClient::startMultiRequest怎么用?PHP KalturaClient::startMultiRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaClient
的用法示例。
在下文中一共展示了KalturaClient::startMultiRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getKalturaPlaylist
/**
* Takes in a :
* $wid, string, The widget id
* $playlistId, string, The playlist_id
*/
function getKalturaPlaylist($partnerId, $playlistId)
{
$config = new KalturaConfiguration($partnerId);
$config->serviceUrl = 'http://www.kaltura.com/';
$client = new KalturaClient($config);
$client->startMultiRequest();
// the session:
$kparams = array();
$client->addParam($kparams, 'widgetId', '_' . $partnerId);
$client->queueServiceActionCall('session', 'startWidgetSession', $kparams);
// The playlist meta:
$kparams = array();
$client->addParam($kparams, 'ks', '{1:result:ks}');
$client->addParam($kparams, 'id', $playlistId);
$client->queueServiceActionCall('playlist', 'get', $kparams);
// The playlist entries:
$client->queueServiceActionCall('playlist', 'execute', $kparams);
$rawResultObject = $client->doQueue();
return array('meta' => (array) $rawResultObject[1], 'playlist' => (array) $rawResultObject[2]);
}
示例2: KalturaConfiguration
//Creates a window when a video's free preview ends and informs the user of payment options
require_once "kalturaConfig.php";
//Includes the client library and starts a Kaltura session to access the API
//More informatation about this process can be found at
//http://knowledge.kaltura.com/introduction-kaltura-client-libraries
require_once 'client/KalturaClient.php';
$config = new KalturaConfiguration(PARTNER_ID);
$config->serviceUrl = 'http://www.kaltura.com/';
$config->format = KalturaClientBase::KALTURA_SERVICE_FORMAT_PHP;
$client = new KalturaClient($config);
global $USER_ID;
$ks = $client->generateSession(ADMIN_SECRET, $USER_ID, KalturaSessionType::ADMIN, PARTNER_ID);
$client->setKs($ks);
//To optimize, we use multi-request to bundle the 3 API requests together in one call to the server:
$client->startMultiRequest();
//Request #1: get the entry details
$client->media->get($_REQUEST['entryId']);
//Request #2: get the entry's payment metadata
$filter = new KalturaMetadataFilter();
$filter->objectIdEqual = $_REQUEST['entryId'];
//return only metadata for this entry
$filter->metadataProfileIdEqual = PAYPAL_METADATA_PROFILE_ID;
//return only the relevant profile
$client->metadata->listAction($filter);
//since we're limiting to entry id and profile this will return at most 1 result
//Request #3: get the entry's payment metadata
$filter = new KalturaMetadataFilter();
$filter->metadataObjectTypeEqual = KalturaMetadataObjectType::CATEGORY;
//search for all category metadatas
$filter->objectIdIn = '{1:result:categoriesIds}';