本文整理汇总了PHP中asset::getDownloadUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP asset::getDownloadUrl方法的具体用法?PHP asset::getDownloadUrl怎么用?PHP asset::getDownloadUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asset
的用法示例。
在下文中一共展示了asset::getDownloadUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purgeAssetFromEdgeCast
private static function purgeAssetFromEdgeCast(asset $asset)
{
// get partner
$partnerId = $asset->getPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
KalturaLog::err('Cannot find partner with id [' . $partnerId . ']');
return false;
}
$mediaType = $asset instanceof thumbAsset ? self::EDGE_SERVICE_HTTP_SMALL_OBJECT_MEDIA_TYPE : self::EDGE_SERVICE_HTTP_LARGE_OBJECT_MEDIA_TYPE;
$mediaTypePathList = array();
try {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $asset->getDownloadUrl());
// asset download url
} catch (Exception $e) {
KalturaLog::err('Cannot get asset URL for asset id [' . $asset->getId() . '] - ' . $e->getMessage());
}
if ($asset instanceof flavorAsset) {
// get a list of all URLs leading to the asset for purging
$subPartnerId = $asset->getentry()->getSubpId();
$partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subPartnerId);
$assetId = $asset->getId();
$serveFlavorUrl = "{$partnerPath}/serveFlavor/entryId/" . $asset->getEntryId() . "/flavorId/{$assetId}" . '*';
// * wildcard should delete all serveFlavor urls
$hosts = array($partner->getCdnHost(), $partner->getRtmpUrl(), $partner->getIisHost());
foreach ($hosts as $host) {
if (!empty($host)) {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $host . $serveFlavorUrl);
}
}
}
return self::purgeFromEdgeCast($mediaTypePathList, $partner);
}
示例2: purgeAssetFromEdgeCast
private static function purgeAssetFromEdgeCast(asset $asset)
{
// get partner
$partnerId = $asset->getPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
KalturaLog::err('Cannot find partner with id [' . $partnerId . ']');
return false;
}
$mediaType = $asset instanceof thumbAsset ? self::EDGE_SERVICE_HTTP_SMALL_OBJECT_MEDIA_TYPE : self::EDGE_SERVICE_HTTP_LARGE_OBJECT_MEDIA_TYPE;
$mediaTypePathList = array();
try {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $asset->getDownloadUrl());
// asset download url
} catch (Exception $e) {
KalturaLog::err('Cannot get asset URL for asset id [' . $asset->getId() . '] - ' . $e->getMessage());
}
if ($asset instanceof flavorAsset) {
// get a list of all URLs leading to the asset for purging
$subPartnerId = $asset->getentry()->getSubpId();
$partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subPartnerId);
$assetId = $asset->getId();
$serveFlavorUrl = "{$partnerPath}/serveFlavor/entryId/" . $asset->getEntryId() . "/flavorId/{$assetId}" . '*';
// * wildcard should delete all serveFlavor urls
$types = array(kPluginableEnumsManager::apiToCore(EdgeCastDeliveryProfileType::EDGE_CAST_HTTP), kPluginableEnumsManager::apiToCore(EdgeCastDeliveryProfileType::EDGE_CAST_RTMP));
$deliveryProfile = $partner->getDeliveryProfileIds();
$deliveryProfileIds = array();
foreach ($deliveryProfile as $key => $value) {
$deliveryProfileIds = array_merge($deliveryProfileIds, $value);
}
$c = new Criteria();
$c->add(DeliveryProfilePeer::PARTNER_ID, $partnerId);
$c->add(DeliveryProfilePeer::ID, $deliveryProfileIds, Criteria::IN);
$c->addSelectColumn(DeliveryProfilePeer::HOST_NAME);
$stmt = PermissionPeer::doSelectStmt($c);
$hosts = $stmt->fetchAll(PDO::FETCH_COLUMN);
foreach ($hosts as $host) {
if (!empty($host)) {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $host . $serveFlavorUrl);
}
}
}
return self::purgeFromEdgeCast($mediaTypePathList, $partner);
}