本文整理汇总了PHP中kFileSyncUtils类的典型用法代码示例。如果您正苦于以下问题:PHP kFileSyncUtils类的具体用法?PHP kFileSyncUtils怎么用?PHP kFileSyncUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了kFileSyncUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getLocalThumbFilePath
public function getLocalThumbFilePath($version, $width, $height, $type, $bgcolor = "ffffff", $crop_provider = null, $quality = 0, $src_x = 0, $src_y = 0, $src_w = 0, $src_h = 0, $vid_sec = -1, $vid_slice = 0, $vid_slices = -1, $density = 0, $stripProfiles = false, $flavorId = null, $fileName = null)
{
if ($this->getStatus() == entryStatus::DELETED || $this->getModerationStatus() == moderation::MODERATION_STATUS_BLOCK) {
KalturaLog::log("rejected live stream entry - not serving thumbnail");
KExternalErrors::dieError(KExternalErrors::ENTRY_DELETED_MODERATED);
}
$contentPath = myContentStorage::getFSContentRootPath();
$liveEntryExist = false;
$liveThumbEntry = null;
$liveThumbEntryId = null;
$partner = $this->getPartner();
if ($partner) {
$liveThumbEntryId = $partner->getLiveThumbEntryId();
}
if ($liveThumbEntryId) {
$liveThumbEntry = entryPeer::retrieveByPK($liveThumbEntryId);
}
if ($liveThumbEntry && $liveThumbEntry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
$fileSyncVersion = $partner->getLiveThumbEntryVersion();
$liveEntryKey = $liveThumbEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $fileSyncVersion);
$contentPath = kFileSyncUtils::getLocalFilePathForKey($liveEntryKey);
if ($contentPath) {
$msgPath = $contentPath;
$liveEntryExist = true;
} else {
KalturaLog::err('no local file sync for audio entry id');
}
}
if (!$liveEntryExist) {
$msgPath = $contentPath . "content/templates/entry/thumbnail/live_thumb.jpg";
}
return myEntryUtils::resizeEntryImage($this, $version, $width, $height, $type, $bgcolor, $crop_provider, $quality, $src_x, $src_y, $src_w, $src_h, $vid_sec, $vid_slice, $vid_slices, $msgPath, $density, $stripProfiles);
}
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:LiveEntry.php
示例2: addEcSeek
private function addEcSeek($url, $syncKey)
{
$seekTime = $this->params->getSeekFromTime();
if (!empty($seekTime)) {
// remove default seekFrom parameter
$url = preg_replace('/seekFrom\\/-?[0-9]*\\/?/', '', $url);
$url = rtrim($url, '/');
// check if seekFromTime is set to something significant
if ($seekTime > 0) {
// check if flv or not
$extension = $this->params->getFileExtension();
$containerFormat = $this->params->getContainerFormat();
$notFlvFormat = $extension && strtolower($extension) != 'flv' || $containerFormat && strtolower($containerFormat) != 'flash video';
if ($notFlvFormat) {
// not flv - add ec_seek value in seconds
$url .= '?ec_seek=' . $seekTime / 1000;
// convert milliseconds to seconds
} else {
// flv - add ec_seek value in bytes
$url .= '?ec_seek=' . $this->getSeekFromBytes(kFileSyncUtils::getLocalFilePathForKey($syncKey));
}
}
}
return $url;
}
开发者ID:DBezemer,项目名称:server,代码行数:25,代码来源:DeliveryProfileEdgeCastHttp.php
示例3: getFlavorAssetUrl
/**
* @param flavorAsset $flavorAsset
* @return string
*/
public function getFlavorAssetUrl(flavorAsset $flavorAsset)
{
$entry = $flavorAsset->getentry();
$partnerId = $entry->getPartnerId();
$subpId = $entry->getSubpId();
$flavorAssetId = $flavorAsset->getId();
$partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subpId);
$this->setFileExtension($flavorAsset->getFileExt());
$url = "/s{$partnerPath}/serveFlavor/flavorId/{$flavorAssetId}";
if ($this->clipTo) {
$url .= "/clipTo/{$this->clipTo}";
}
if ($this->extention) {
$url .= "/name/{$flavorAssetId}.{$this->extention}";
}
$url = str_replace('\\', '/', $url);
if ($this->protocol != StorageProfile::PLAY_FORMAT_RTMP) {
$url .= '?novar=0';
$url .= '&e=' . (time() + 120);
$secret = $this->getMediaVault();
$fullUrl = $this->protocol . '://' . $this->domain . $url;
$url .= '&h=' . md5($secret . $fullUrl);
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$seekFromBytes = $this->getSeekFromBytes(kFileSyncUtils::getLocalFilePathForKey($syncKey));
if ($seekFromBytes) {
$url .= '&fs=' . $seekFromBytes;
}
} else {
$url .= '/forceproxy/true';
}
return $url;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:36,代码来源:kLimeLightUrlManager.php
示例4: syncAction
/**
* @action sync
* @param int $fileSyncId
* @param file $fileData
* @return KalturaFileSync
*/
function syncAction($fileSyncId, $fileData)
{
$dbFileSync = FileSyncPeer::retrieveByPK($fileSyncId);
if (!$dbFileSync) {
throw new APIException(APIErrors::INVALID_FILE_SYNC_ID, $fileSyncId);
}
$key = kFileSyncUtils::getKeyForFileSync($dbFileSync);
kFileSyncUtils::moveFromFile($fileData['tmp_name'], $key, false);
list($file_root, $real_path) = kPathManager::getFilePathArr($key);
$full_path = $file_root . $real_path;
chmod($full_path, 0644);
if (file_exists($full_path)) {
$dbFileSync->setFileRoot($file_root);
$dbFileSync->setFilePath($real_path);
$dbFileSync->setFileSizeFromPath($full_path);
$dbFileSync->setStatus(FileSync::FILE_SYNC_STATUS_READY);
} else {
$dbFileSync->setFileSize(-1);
$dbFileSync->setStatus(FileSync::FILE_SYNC_STATUS_ERROR);
}
$dbFileSync->save();
$fileSync = new KalturaFileSync();
$fileSync->fromObject($dbFileSync);
return $fileSync;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:FileSyncService.php
示例5: execute
public function execute()
{
$this->forceSystemAuthentication();
myDbHelper::$use_alternative_con = null;
//myDbHelper::DB_HELPER_CONN_PROPEL2
$uiConfId = $this->getRequestParameter("id");
$uiConf = uiConfPeer::retrieveByPK($uiConfId);
$subTypes = array(uiconf::FILE_SYNC_UICONF_SUB_TYPE_DATA, uiconf::FILE_SYNC_UICONF_SUB_TYPE_FEATURES);
foreach ($subTypes as $subType) {
if ($subType == uiconf::FILE_SYNC_UICONF_SUB_TYPE_DATA) {
echo "Data:" . PHP_EOL;
} else {
if ($subType == uiconf::FILE_SYNC_UICONF_SUB_TYPE_FEATURES) {
echo "Features:" . PHP_EOL;
}
}
$syncKey = $uiConf->getSyncKey($subType);
if (kFileSyncUtils::file_exists($syncKey)) {
echo "File sync already exists." . PHP_EOL;
} else {
list($rootPath, $filePath) = $uiConf->generateFilePathArr($subType);
$fullPath = $rootPath . $filePath;
if (file_exists($fullPath)) {
kFileSyncUtils::createSyncFileForKey($syncKey);
echo "Created successfully." . PHP_EOL;
} else {
echo "File not found:" . PHP_EOL;
echo $fullPath . PHP_EOL;
echo "Not creating file sync." . PHP_EOL;
}
}
echo PHP_EOL;
}
die;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:35,代码来源:fixUiConfFileSyncAction.class.php
示例6: __construct
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaDailymotionDistributionProfile) {
return;
}
$flavorAssets = flavorAssetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
if (count($flavorAssets)) {
// if we have specific flavor assets for this distribution, grab the first one
$flavorAsset = reset($flavorAssets);
} else {
// take the source asset
$flavorAsset = flavorAssetPeer::retrieveOriginalReadyByEntryId($distributionJobData->entryDistribution->entryId);
}
if ($flavorAsset) {
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->videoAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
}
$thumbAssets = thumbAssetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
if (count($thumbAssets)) {
$syncKey = reset($thumbAssets)->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
}
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:26,代码来源:KalturaDailymotionDistributionJobProviderData.php
示例7: entryHandled
public function entryHandled(entry $dbEntry)
{
parent::entryHandled($dbEntry);
$originalFlavorAsset = assetPeer::retrieveOriginalByEntryId($dbEntry->getId());
$syncKey = $originalFlavorAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$sourceFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
// call mediaInfo for file
$dbMediaInfo = new mediaInfo();
try {
$mediaInfoParser = new KMediaInfoMediaParser($sourceFilePath, kConf::get('bin_path_mediainfo'));
$mediaInfo = $mediaInfoParser->getMediaInfo();
$dbMediaInfo = $mediaInfo->toInsertableObject($dbMediaInfo);
$dbMediaInfo->setFlavorAssetId($originalFlavorAsset->getId());
$dbMediaInfo->save();
} catch (Exception $e) {
KalturaLog::err("Getting media info: " . $e->getMessage());
$dbMediaInfo = null;
}
// fix flavor asset according to mediainfo
if ($dbMediaInfo) {
KDLWrap::ConvertMediainfoCdl2FlavorAsset($dbMediaInfo, $originalFlavorAsset);
$flavorTags = KDLWrap::CDLMediaInfo2Tags($dbMediaInfo, array(flavorParams::TAG_WEB, flavorParams::TAG_MBR));
$originalFlavorAsset->setTags(implode(',', array_unique($flavorTags)));
}
$originalFlavorAsset->setStatusLocalReady();
$originalFlavorAsset->save();
$dbEntry->setStatus(entryStatus::READY);
$dbEntry->save();
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:29,代码来源:KalturaWebcamTokenResource.php
示例8: doGetFlavorAssetUrl
/**
* @param flavorAsset $flavorAsset
* @return string
*/
protected function doGetFlavorAssetUrl(flavorAsset $flavorAsset)
{
$entry = $flavorAsset->getentry();
$partnerId = $entry->getPartnerId();
$subpId = $entry->getSubpId();
$flavorAssetId = $flavorAsset->getId();
$partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subpId);
$this->setFileExtension($flavorAsset->getFileExt());
$versionString = $this->getFlavorVersionString($flavorAsset);
$url = "/s{$partnerPath}/serveFlavor/entryId/" . $flavorAsset->getEntryId() . "{$versionString}/flavorId/{$flavorAssetId}";
if ($this->clipTo) {
$url .= "/clipTo/{$this->clipTo}";
}
if ($this->extention) {
$url .= "/name/a.{$this->extention}";
}
$url = str_replace('\\', '/', $url);
if ($this->protocol != StorageProfile::PLAY_FORMAT_RTMP) {
$url .= '?novar=0';
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$seekFromBytes = $this->getSeekFromBytes(kFileSyncUtils::getLocalFilePathForKey($syncKey));
if ($seekFromBytes) {
$url .= '&fs=' . $seekFromBytes;
}
} else {
if ($this->extention && strtolower($this->extention) != 'flv' || $this->containerFormat && strtolower($this->containerFormat) != 'flash video') {
$url = "mp4:{$url}";
}
}
return $url;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:35,代码来源:kLimeLightUrlManager.php
示例9: parseAction
/**
* Parse content of caption asset and index it
*
* @action parse
* @param string $captionAssetId
* @throws KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND
*/
function parseAction($captionAssetId)
{
$captionAsset = assetPeer::retrieveById($captionAssetId);
if (!$captionAsset) {
throw new KalturaAPIException(KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND, $captionAssetId);
}
$captionAssetItems = CaptionAssetItemPeer::retrieveByAssetId($captionAssetId);
foreach ($captionAssetItems as $captionAssetItem) {
/* @var $captionAssetItem CaptionAssetItem */
$captionAssetItem->delete();
}
$syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$content = kFileSyncUtils::file_get_contents($syncKey, true, false);
if (!$content) {
return;
}
$captionsContentManager = kCaptionsContentManager::getCoreContentManager($captionAsset->getContainerFormat());
$itemsData = $captionsContentManager->parse($content);
foreach ($itemsData as $itemData) {
$item = new CaptionAssetItem();
$item->setCaptionAssetId($captionAsset->getId());
$item->setEntryId($captionAsset->getEntryId());
$item->setPartnerId($captionAsset->getPartnerId());
$item->setStartTime($itemData['startTime']);
$item->setEndTime($itemData['endTime']);
$item->setContent(utf8_encode($itemData['content']));
$item->save();
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:36,代码来源:CaptionAssetItemService.php
示例10: addParseCaptionAssetJob
/**
* @param CaptionAsset $captionAsset
* @param BatchJob $parentJob
* @throws kCoreException FILE_NOT_FOUND
* @return BatchJob
*/
public function addParseCaptionAssetJob(CaptionAsset $captionAsset, BatchJob $parentJob = null)
{
$syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
if (!$fileSync) {
if (!PermissionPeer::isValidForPartner(CaptionPermissionName::IMPORT_REMOTE_CAPTION_FOR_INDEXING, $captionAsset->getPartnerId())) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
$fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
if (!$fileSync) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
$fullPath = myContentStorage::getFSUploadsPath() . '/' . $captionAsset->getId() . '.tmp';
if (!kFile::downloadUrlToFile($fileSync->getExternalUrl($captionAsset->getEntryId()), $fullPath)) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
kFileSyncUtils::moveFromFile($fullPath, $syncKey, true, false, true);
}
$jobData = new kParseCaptionAssetJobData();
$jobData->setCaptionAssetId($captionAsset->getId());
$batchJob = null;
if ($parentJob) {
$batchJob = $parentJob->createChild();
} else {
$batchJob = new BatchJob();
$batchJob->setEntryId($captionAsset->getEntryId());
$batchJob->setPartnerId($captionAsset->getPartnerId());
}
return kJobsManager::addJob($batchJob, $jobData, CaptionSearchPlugin::getBatchJobTypeCoreValue(CaptionSearchBatchJobType::PARSE_CAPTION_ASSET));
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:36,代码来源:kCaptionSearchFlowManager.php
示例11: __construct
/**
* Called on the server side and enables you to populate the object with any data from the DB
*
* @param KalturaDistributionJobData $distributionJobData
*/
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaQuickPlayDistributionProfile) {
return;
}
$this->videoFilePaths = new KalturaStringArray();
$this->thumbnailFilePaths = new KalturaStringArray();
// loads all the flavor assets that should be submitted to the remote destination site
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
$entry = entryPeer::retrieveByPK($distributionJobData->entryDistribution->entryId);
foreach ($flavorAssets as $asset) {
$syncKey = $asset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
$str = new KalturaString();
$str->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
$this->videoFilePaths[] = $str;
}
}
foreach ($thumbAssets as $asset) {
$syncKey = $asset->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
$str = new KalturaString();
$str->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
$this->thumbnailFilePaths[] = $str;
}
}
$feed = new QuickPlayFeed($distributionJobData, $this, $flavorAssets, $thumbAssets, $entry);
$this->xml = $feed->getXml();
}
开发者ID:DBezemer,项目名称:server,代码行数:39,代码来源:KalturaQuickPlayDistributionJobProviderData.php
示例12: __construct
/**
* Called on the server side and enables you to populate the object with any data from the DB
*
* @param KalturaDistributionJobData $distributionJobData
*/
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaFreewheelGenericDistributionProfile) {
return;
}
$this->videoAssetFilePaths = new KalturaStringArray();
// loads all the flavor assets that should be submitted to the remote destination site
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
foreach ($flavorAssets as $flavorAsset) {
$videoAssetFilePath = new KalturaString();
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$videoAssetFilePath->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
$this->videoAssetFilePaths[] = $videoAssetFilePath;
}
$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
if (count($thumbAssets)) {
$thumbAsset = reset($thumbAssets);
$syncKey = $thumbAssets->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
// entry cue points
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
$c->add(CuePointPeer::PARTNER_ID, $distributionJobData->entryDistribution->partnerId);
$c->add(CuePointPeer::ENTRY_ID, $distributionJobData->entryDistribution->entryId);
$c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD));
$c->addAscendingOrderByColumn(CuePointPeer::START_TIME);
$cuePointsDb = CuePointPeer::doSelect($c);
$this->cuePoints = KalturaCuePointArray::fromDbArray($cuePointsDb);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:38,代码来源:KalturaFreewheelGenericDistributionJobProviderData.php
示例13: __construct
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaUverseDistributionProfile) {
return;
}
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
if (count($flavorAssets)) {
// if we have specific flavor assets for this distribution, grab the first one
$flavorAsset = reset($flavorAssets);
} else {
// take the source asset
$flavorAsset = assetPeer::retrieveOriginalReadyByEntryId($distributionJobData->entryDistribution->entryId);
}
if ($flavorAsset) {
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
$this->localAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
}
$entryDistributionDb = EntryDistributionPeer::retrieveByPK($distributionJobData->entryDistributionId);
if ($entryDistributionDb) {
$this->remoteAssetUrl = $entryDistributionDb->getFromCustomData(UverseEntryDistributionCustomDataField::REMOTE_ASSET_URL);
$this->remoteAssetFileName = $entryDistributionDb->getFromCustomData(UverseEntryDistributionCustomDataField::REMOTE_ASSET_FILE_NAME);
} else {
KalturaLog::err('Entry distribution [' . $distributionJobData->entryDistributionId . '] not found');
}
}
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:KalturaUverseDistributionJobProviderData.php
示例14: validateEntry
public function validateEntry(entry $dbEntry)
{
parent::validateEntry($dbEntry);
$this->validatePropertyNotNull('entryId');
$srcEntry = entryPeer::retrieveByPK($this->entryId);
if (!$srcEntry) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $this->entryId);
}
if ($srcEntry->getMediaType() == KalturaMediaType::IMAGE) {
return parent::validateEntry($dbEntry);
}
$srcFlavorAsset = null;
if (is_null($this->flavorParamsId)) {
$srcFlavorAsset = assetPeer::retrieveOriginalByEntryId($this->entryId);
if (!$srcFlavorAsset) {
throw new KalturaAPIException(KalturaErrors::ORIGINAL_FLAVOR_ASSET_IS_MISSING);
}
} else {
$srcFlavorAsset = assetPeer::retrieveByEntryIdAndParams($this->entryId, $this->flavorParamsId);
if (!$srcFlavorAsset) {
throw new KalturaAPIException(KalturaErrors::FLAVOR_ASSET_ID_NOT_FOUND, $this->assetId);
}
}
$key = $srcFlavorAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$c = FileSyncPeer::getCriteriaForFileSyncKey($key);
$c->addAnd(FileSyncPeer::FILE_TYPE, array(FileSync::FILE_SYNC_FILE_TYPE_FILE, FileSync::FILE_SYNC_FILE_TYPE_LINK), Criteria::IN);
$fileSyncs = FileSyncPeer::doSelect($c);
foreach ($fileSyncs as $fileSync) {
$fileSync = kFileSyncUtils::resolve($fileSync);
if ($fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_FILE) {
return;
}
}
throw new KalturaAPIException(KalturaErrors::FILE_DOESNT_EXIST);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:35,代码来源:KalturaEntryResource.php
示例15: copyLiveMetadata
protected function copyLiveMetadata(baseEntry $object, $liveEntryId)
{
$recordedEntryId = $object->getId();
$partnerId = $object->getPartnerId();
$metadataProfiles = MetadataProfilePeer::retrieveAllActiveByPartnerId($partnerId, MetadataObjectType::ENTRY);
foreach ($metadataProfiles as $metadataProfile) {
$originMetadataObj = MetadataPeer::retrieveByObject($metadataProfile->getId(), MetadataObjectType::ENTRY, $liveEntryId);
if ($originMetadataObj) {
$metadataProfileId = $metadataProfile->getId();
$metadataProfileVersion = $metadataProfile->getVersion();
$destMetadataObj = new Metadata();
$destMetadataObj->setPartnerId($partnerId);
$destMetadataObj->setMetadataProfileId($metadataProfileId);
$destMetadataObj->setMetadataProfileVersion($metadataProfileVersion);
$destMetadataObj->setObjectType(MetadataObjectType::ENTRY);
$destMetadataObj->setObjectId($recordedEntryId);
$destMetadataObj->setStatus(KalturaMetadataStatus::VALID);
$originMetadataKey = $originMetadataObj->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA);
$originXml = kFileSyncUtils::file_get_contents($originMetadataKey, true, false);
// validate object exists
$object = kMetadataManager::getObjectFromPeer($destMetadataObj);
if ($object) {
$destMetadataObj->save();
} else {
KalturaLog::err('invalid object type');
continue;
}
$destMetadataKey = $destMetadataObj->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA);
kFileSyncUtils::file_put_contents($destMetadataKey, $originXml);
}
}
}
开发者ID:DBezemer,项目名称:server,代码行数:32,代码来源:kMetadataObjectCreatedHandler.php
示例16: fromThumbAsset
public static function fromThumbAsset($thumbAsset)
{
$fileSyncKey = $thumbAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$thumbPath = kFileSyncUtils::getReadyLocalFilePathForKey($fileSyncKey);
$thumbWidth = $thumbAsset->getWidth();
$thumbHeight = $thumbAsset->getHeight();
return self::fromParams($thumbWidth, $thumbHeight, $thumbPath, false);
}
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:kThumbnailDescriptor.class.php
示例17: doGetFlavorAssetUrl
protected function doGetFlavorAssetUrl(flavorAsset $flavorAsset)
{
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
$url = $this->getFileSyncUrl($fileSync);
$url = $this->formatByExtension($url, false);
return $url;
}
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:DeliveryProfileLocalPathRtmp.php
示例18: execute
public function execute()
{
$jobId = $this->getRequestParameter("id");
$partnerId = $this->getRequestParameter("pid");
$type = $this->getRequestParameter("type");
$c = new Criteria();
$c->addAnd(BatchJobPeer::ID, $jobId);
$c->addAnd(BatchJobPeer::PARTNER_ID, $partnerId);
$c->addAnd(BatchJobPeer::JOB_TYPE, BatchJobType::BULKUPLOAD);
$batchJob = BatchJobPeer::doSelectOne($c);
if (!$batchJob) {
die("File not found");
}
header("Content-Type: text/plain; charset=UTF-8");
if ($type == "log") {
$bulkUploadResults = BulkUploadResultPeer::retrieveByBulkUploadId($jobId);
if (!count($bulkUploadResults)) {
$syncKey = $batchJob->getSyncKey(BatchJob::FILE_SYNC_BATCHJOB_SUB_TYPE_BULKUPLOADLOG);
if (kFileSyncUtils::file_exists($syncKey, true)) {
$content = kFileSyncUtils::file_get_contents($syncKey, true);
echo $content;
die;
}
die("Log file is not ready");
}
$STDOUT = fopen('php://output', 'w');
$data = $batchJob->getData();
foreach ($bulkUploadResults as $bulkUploadResult) {
$values = array($bulkUploadResult->getTitle(), $bulkUploadResult->getDescription(), $bulkUploadResult->getTags(), $bulkUploadResult->getUrl(), $bulkUploadResult->getContentType());
if ($data instanceof kBulkUploadJobData && $data->getCsvVersion() > kBulkUploadJobData::BULK_UPLOAD_CSV_VERSION_V1) {
$values[] = $bulkUploadResult->getConversionProfileId();
$values[] = $bulkUploadResult->getAccessControlProfileId();
$values[] = $bulkUploadResult->getCategory();
$values[] = $bulkUploadResult->getScheduleStartDate('Y-m-d\\TH:i:s');
$values[] = $bulkUploadResult->getScheduleEndDate('Y-m-d\\TH:i:s');
$values[] = $bulkUploadResult->getThumbnailUrl();
$values[] = $bulkUploadResult->getPartnerData();
}
$values[] = $bulkUploadResult->getEntryId();
$values[] = $bulkUploadResult->getEntryStatus();
$values[] = $bulkUploadResult->getErrorDescription();
fputcsv($STDOUT, $values);
}
fclose($STDOUT);
} else {
$syncKey = $batchJob->getSyncKey(BatchJob::FILE_SYNC_BATCHJOB_SUB_TYPE_BULKUPLOADCSV);
if (kFileSyncUtils::file_exists($syncKey, true)) {
$content = kFileSyncUtils::file_get_contents($syncKey, true);
echo $content;
die;
} else {
die("File not found");
}
}
die;
// no template needed
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:57,代码来源:bulkuploadfileAction.class.php
示例19: incLiveSegmentVersion
public function incLiveSegmentVersion($index)
{
$subType = self::FILE_SYNC_ASSET_SUB_TYPE_LIVE_PRIMARY;
if ($index == MediaServerIndex::SECONDARY) {
$subType = self::FILE_SYNC_ASSET_SUB_TYPE_LIVE_SECONDARY;
}
$newVersion = kFileSyncUtils::calcObjectNewVersion($this->getId(), $this->getLiveSegmentVersion($index), FileSyncObjectType::ASSET, $subType);
$this->putInCustomData("liveSegmentVersion-{$index}", $newVersion);
}
开发者ID:DBezemer,项目名称:server,代码行数:9,代码来源:liveAsset.php
示例20: __construct
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData || !$distributionJobData->distributionProfile instanceof KalturaTvinciDistributionProfile || !$distributionJobData->entryDistribution) {
return;
}
$entry = null;
if ($distributionJobData->entryDistribution->entryId) {
$entry = entryPeer::retrieveByPK($distributionJobData->entryDistribution->entryId);
}
if (!$entry) {
KalturaLog::err("Can't find entry with id: {$distributionJobData->entryDistribution->entryId}");
return;
}
$feedHelper = new TvinciDistributionFeedHelper($distributionJobData->distributionProfile);
$feedHelper->setEntryId($entry->getId());
$feedHelper->setReferenceId($entry->getReferenceID());
$feedHelper->setDescription($entry->getDescription());
$feedHelper->setTitleName($entry->getName());
$feedHelper->setSunrise($distributionJobData->entryDistribution->sunrise);
$feedHelper->setSunset($distributionJobData->entryDistribution->sunset);
$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
$picRatios = array();
$defaultThumbUrl = null;
foreach ($thumbAssets as $thumbAsset) {
$thumbDownloadUrl = $this->getAssetDownloadUrl($thumbAsset);
$ratio = KDLVideoAspectRatio::ConvertFrameSize($thumbAsset->getWidth(), $thumbAsset->getHeight());
$picRatios[] = array('url' => $thumbDownloadUrl, 'ratio' => $ratio);
if ($thumbAsset->hasTag(thumbParams::TAG_DEFAULT_THUMB)) {
$defaultThumbUrl = $thumbDownloadUrl;
}
}
$feedHelper->setPicRatiosArray($picRatios);
if (!$defaultThumbUrl && count($picRatios)) {
// Choose the URL of the first resource in the array
$defaultThumbUrl = $picRatios[0]['url'];
}
$feedHelper->setDefaultThumbnailUrl($defaultThumbUrl);
$this->createPlayManifestURLs($distributionJobData->entryDistribution, $entry, $feedHelper);
$metadatas = MetadataPeer::retrieveAllByObject(MetadataObjectType::ENTRY, $distributionJobData->entryDistribution->entryId);
$fullMetadataXML = '';
foreach ($metadatas as $metadataField) {
$syncKey = $metadataField->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA);
$currMetaXML = kFileSyncUtils::file_get_contents($syncKey, true, false);
$fullMetadataXML .= $currMetaXML;
}
$feedHelper->setMetasXML($fullMetadataXML);
if ($distributionJobData instanceof KalturaDistributionSubmitJobData) {
$this->xml = $feedHelper->buildSubmitFeed();
} elseif ($distributionJobData instanceof KalturaDistributionUpdateJobData) {
$this->xml = $feedHelper->buildUpdateFeed();
} elseif ($distributionJobData instanceof KalturaDistributionDeleteJobData) {
$this->xml = $feedHelper->buildDeleteFeed();
}
KalturaLog::debug("XML Constructed by the Tvinci feed helper :{$this->xml}");
}
开发者ID:kubrickfr,项目名称:server,代码行数:56,代码来源:KalturaTvinciDistributionJobProviderData.php
注:本文中的kFileSyncUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论