本文整理汇总了PHP中Kaltura_Client_Client::doMultiRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Kaltura_Client_Client::doMultiRequest方法的具体用法?PHP Kaltura_Client_Client::doMultiRequest怎么用?PHP Kaltura_Client_Client::doMultiRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kaltura_Client_Client
的用法示例。
在下文中一共展示了Kaltura_Client_Client::doMultiRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMultiRequest
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");
}
}