当前位置: 首页>>代码示例>>PHP>>正文


PHP KalturaClient::startMultiRequest方法代码示例

本文整理汇总了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]);
}
开发者ID:tempbottle,项目名称:Work,代码行数:25,代码来源:getKalturaPlaylist.php

示例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}';
开发者ID:nagyistoce,项目名称:Kaltura-Paid-Content-Gallery-With-Stripe,代码行数:30,代码来源:payment.php


注:本文中的KalturaClient::startMultiRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。