本文整理汇总了PHP中entry::getFlavorParamsIds方法的典型用法代码示例。如果您正苦于以下问题:PHP entry::getFlavorParamsIds方法的具体用法?PHP entry::getFlavorParamsIds怎么用?PHP entry::getFlavorParamsIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entry
的用法示例。
在下文中一共展示了entry::getFlavorParamsIds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendMediaEntryMrss
/**
* @param entry $entry
* @param SimpleXMLElement $mrss
*/
protected static function appendMediaEntryMrss(entry $entry, SimpleXMLElement $mrss)
{
$media = $mrss->addChild('media');
$media->addChild('mediaType', $entry->getMediaType());
$media->addChild('duration', $entry->getLengthInMsecs());
$media->addChild('flavorParamsIds', $entry->getFlavorParamsIds());
}
示例2: getLiveEntryStreamConfig
/**
* @return array primary URL and backup URL
*/
private function getLiveEntryStreamConfig()
{
$this->initFlavorParamsIds();
$tag = null;
$tags = $this->deliveryAttributes->getTags();
if (count($tags) == 1) {
$tag = reset($tags);
}
$protocol = $this->deliveryAttributes->getMediaProtocol();
if (in_array($this->deliveryAttributes->getFormat(), self::$httpFormats) && !in_array($protocol, self::$httpProtocols)) {
$protocol = requestUtils::getProtocol();
}
// use only cloud transcode flavors if timeAlignedRenditions was set
$partnerId = $this->entry->getPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
$partnerTimeAligned = $partner->getTimeAlignedRenditions();
if ($partnerTimeAligned && $this->getRequestParameter("playerType") === 'flash') {
// check entry's flavors
$entryFlavorParams = assetParamsPeer::retrieveByPKs(explode(',', $this->entry->getFlavorParamsIds()));
$hasTranscode = false;
foreach ($entryFlavorParams as $flavor) {
// check if we have any transcode flavor
if (!$flavor->hasTag("ingest")) {
$hasTranscode = true;
}
}
// if so, use only the transcode
if ($hasTranscode) {
$tag = 'mbr';
}
}
$liveStreamConfig = $this->entry->getLiveStreamConfigurationByProtocol($this->deliveryAttributes->getFormat(), $protocol, $tag, false, $this->flavorParamsIds);
/* @var $liveStreamConfig kLiveStreamConfiguration */
if ($liveStreamConfig) {
return $liveStreamConfig;
}
switch ($this->deliveryAttributes->getFormat()) {
case PlaybackProtocol::RTMP:
$baseUrl = $this->entry->getStreamUrl();
$baseUrl = rtrim($baseUrl, '/');
if (strpos($this->deliveryAttributes->getMediaProtocol(), "rtmp") === 0) {
$baseUrl = $this->deliveryAttributes->getMediaProtocol() . '://' . preg_replace('/^rtmp.*?:\\/\\//', '', $baseUrl);
}
$liveStreamConfig = new kLiveStreamConfiguration();
$liveStreamConfig->setUrl($baseUrl);
$liveStreamConfig->setProtocol(PlaybackProtocol::RTMP);
return $liveStreamConfig;
case PlaybackProtocol::APPLE_HTTP:
// TODO pass single tag
$liveStreamConfig = new kLiveStreamConfiguration();
$liveStreamConfig->setUrl($this->entry->getHlsStreamUrl());
$liveStreamConfig->setProtocol(PlaybackProtocol::APPLE_HTTP);
return $liveStreamConfig;
}
return null;
}
示例3: setSearchTextDiscreteForEntry
public static function setSearchTextDiscreteForEntry(entry $obj)
{
$searchText = array();
// categories
if ($obj->getCategoriesIds()) {
$categories = explode(entry::ENTRY_CATEGORY_SEPARATOR, $obj->getCategoriesIds());
foreach ($categories as $category) {
$searchText[] = self::ENTRY_CATEGORY_ID_PREFIX . $category;
}
}
// duration type
$duration = $obj->getDurationInt();
$searchText[] = self::ENTRY_DURATION_TYPE_PREFIX . entryPeer::getDurationType($duration);
// flavor params ids
$getFlavorParamsIds = explode(",", $obj->getFlavorParamsIds());
foreach ($getFlavorParamsIds as $getFlavorParamsIds) {
$searchText[] = self::ENTRY_FLAVOR_PARAMS_PREFIX . $getFlavorParamsIds;
}
$obj->setSearchTextDiscrete(implode(" ", $searchText));
}
示例4: copyEntry
public static function copyEntry(entry $entry, Partner $toPartner = null, $dontCopyUsers = false)
{
KalturaLog::log("copyEntry - Copying entry [" . $entry->getId() . "] to partner [" . $toPartner->getId() . "]");
$newEntry = $entry->copy();
$newEntry->setIntId(null);
if ($toPartner instanceof Partner) {
$newEntry->setPartnerId($toPartner->getId());
$newEntry->setSubpId($toPartner->getId() * 100);
$newEntry->setAccessControlId($toPartner->getDefaultAccessControlId());
$flavorParamsStr = $entry->getFlavorParamsIds();
$flavorParams = explode(',', $flavorParamsStr);
$newFlavorParams = array();
foreach ($flavorParams as $flavorParamsId) {
$newFlavorParamsId = kObjectCopyHandler::getMappedId('flavorParams', $flavorParamsId);
if (is_null($newFlavorParamsId)) {
$newFlavorParamsId = $flavorParamsId;
}
$newFlavorParams[] = $newFlavorParamsId;
}
$newEntry->setFlavorParamsIds(implode(',', $newFlavorParams));
}
$newKuser = null;
if (!$dontCopyUsers) {
// copy the kuser (if the same puser id exists its kuser will be used)
kuserPeer::setUseCriteriaFilter(false);
$kuser = $entry->getKuser();
$newKuser = kuserPeer::createKuserForPartner($newEntry->getPartnerId(), $kuser->getPuserId());
$newEntry->setKuserId($newKuser->getId());
kuserPeer::setUseCriteriaFilter(true);
}
// copy the kshow
kshowPeer::setUseCriteriaFilter(false);
$kshow = $entry->getKshow();
if ($kshow) {
$newKshow = $kshow->copy();
$newKshow->setIntId(null);
$newKshow->setPartnerId($toPartner->getId());
$newKshow->setSubpId($toPartner->getId() * 100);
if ($newKuser) {
$newKshow->setProducerId($newKuser->getId());
}
$newKshow->save();
$newEntry->setKshowId($newKshow->getId());
}
kshowPeer::setUseCriteriaFilter(true);
// reset the statistics
myEntryUtils::resetEntryStatistics($newEntry);
// set the new partner id into the default category criteria filter
$defaultCategoryFilter = categoryPeer::getCriteriaFilter()->getFilter();
$oldPartnerId = $defaultCategoryFilter->get(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->remove(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->addAnd(categoryPeer::PARTNER_ID, $newEntry->getPartnerId());
// save the entry
$newEntry->save();
// restore the original partner id in the default category criteria filter
$defaultCategoryFilter->remove(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->addAnd(categoryPeer::PARTNER_ID, $oldPartnerId);
KalturaLog::log("copyEntry - New entry [" . $newEntry->getId() . "] was created");
// for any type that does not require assets:
$shouldCopyDataForNonClip = $entry->getType() != entryType::MEDIA_CLIP;
$shouldCopyDataForClip = false;
// only images get their data copied
if ($entry->getType() == entryType::MEDIA_CLIP) {
if ($entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_VIDEO && $entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_AUDIO) {
$shouldCopyDataForClip = true;
}
}
if ($shouldCopyDataForNonClip || $shouldCopyDataForClip) {
// copy the data
$from = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
// replaced__getDataPath
$to = $newEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
// replaced__getDataPath
KalturaLog::log("copyEntriesByType - copying entry data [" . $from . "] to [" . $to . "]");
kFileSyncUtils::softCopy($from, $to);
}
$ismFrom = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
if (kFileSyncUtils::fileSync_exists($ismFrom)) {
$ismTo = $newEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
KalturaLog::log("copying entry ism [" . $ismFrom . "] to [" . $ismTo . "]");
kFileSyncUtils::softCopy($ismFrom, $ismTo);
}
$ismcFrom = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);
if (kFileSyncUtils::fileSync_exists($ismcFrom)) {
$ismcTo = $newEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);
KalturaLog::log("copying entry ism [" . $ismcFrom . "] to [" . $ismcTo . "]");
kFileSyncUtils::softCopy($ismcFrom, $ismcTo);
}
$from = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
// replaced__getThumbnailPath
$considerCopyThumb = true;
// if entry is image - data is thumbnail, and it was copied
if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
$considerCopyThumb = false;
}
// if entry is not clip, and there is no file in both DCs - nothing to copy
if ($entry->getType() != entryType::MEDIA_CLIP && !kFileSyncUtils::file_exists($from, true)) {
$considerCopyThumb = false;
}
if ($considerCopyThumb) {
//.........这里部分代码省略.........
示例5: copyEntry
public static function copyEntry(entry $entry, Partner $toPartner = null, $dontCopyUsers = false)
{
KalturaLog::log("copyEntry - Copying entry [" . $entry->getId() . "] to partner [" . $toPartner->getId() . "]");
$newEntry = $entry->copy();
$newEntry->setIntId(null);
$newEntry->setCategories(null);
$newEntry->setCategoriesIds(null);
if ($toPartner instanceof Partner) {
$newEntry->setPartnerId($toPartner->getId());
$newEntry->setSubpId($toPartner->getId() * 100);
$newEntry->setAccessControlId($toPartner->getDefaultAccessControlId());
$flavorParamsStr = $entry->getFlavorParamsIds();
$flavorParams = explode(',', $flavorParamsStr);
$newFlavorParams = array();
foreach ($flavorParams as $flavorParamsId) {
$newFlavorParamsId = kObjectCopyHandler::getMappedId('flavorParams', $flavorParamsId);
if (is_null($newFlavorParamsId)) {
$newFlavorParamsId = $flavorParamsId;
}
$newFlavorParams[] = $newFlavorParamsId;
}
$newEntry->setFlavorParamsIds(implode(',', $newFlavorParams));
}
$newKuser = null;
if (!$dontCopyUsers) {
// copy the kuser (if the same puser id exists its kuser will be used)
kuserPeer::setUseCriteriaFilter(false);
$kuser = $entry->getKuser();
$newKuser = kuserPeer::createKuserForPartner($newEntry->getPartnerId(), $kuser->getPuserId());
$newEntry->setKuserId($newKuser->getId());
$newEntry->setCreatorKuserId($newKuser->getId());
kuserPeer::setUseCriteriaFilter(true);
}
// copy the kshow
kshowPeer::setUseCriteriaFilter(false);
$kshow = $entry->getKshow();
if ($kshow) {
$newKshow = $kshow->copy();
$newKshow->setIntId(null);
$newKshow->setPartnerId($toPartner->getId());
$newKshow->setSubpId($toPartner->getId() * 100);
if ($newKuser) {
$newKshow->setProducerId($newKuser->getId());
}
$newKshow->save();
$newEntry->setKshowId($newKshow->getId());
}
kshowPeer::setUseCriteriaFilter(true);
// reset the statistics
myEntryUtils::resetEntryStatistics($newEntry);
// set the new partner id into the default category criteria filter
$defaultCategoryFilter = categoryPeer::getCriteriaFilter()->getFilter();
$oldPartnerId = $defaultCategoryFilter->get(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->remove(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->addAnd(categoryPeer::PARTNER_ID, $newEntry->getPartnerId());
// save the entry
$newEntry->save();
//we must flush events to sync categories to sphinx. if categories are not synced - then they might be duplicated, if 2 entries are assign to the same category.
kEventsManager::flushEvents();
// restore the original partner id in the default category criteria filter
$defaultCategoryFilter->remove(categoryPeer::PARTNER_ID);
$defaultCategoryFilter->addAnd(categoryPeer::PARTNER_ID, $oldPartnerId);
KalturaLog::log("copyEntry - New entry [" . $newEntry->getId() . "] was created");
// for any type that does not require assets:
$shouldCopyDataForNonClip = true;
if ($entry->getType() == entryType::MEDIA_CLIP) {
$shouldCopyDataForNonClip = false;
}
if ($entry->getType() == entryType::PLAYLIST) {
$shouldCopyDataForNonClip = false;
}
$shouldCopyDataForClip = false;
// only images get their data copied
if ($entry->getType() == entryType::MEDIA_CLIP) {
if ($entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_VIDEO && $entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_AUDIO) {
$shouldCopyDataForClip = true;
}
}
//if entry is a static playlist, link between it and its new child entries
if ($entry->getType() == entryType::PLAYLIST) {
switch ($entry->getMediaType()) {
case entry::ENTRY_MEDIA_TYPE_TEXT:
$from = $entry->getDataContent();
KalturaLog::debug("Entries to copy from source static playlist: [{$from}]");
$fromEntryIds = explode(",", $from);
$toEntryIds = array();
foreach ($fromEntryIds as $fromEntryId) {
$toEntryIds[] = kObjectCopyHandler::getMappedId(entryPeer::OM_CLASS, $fromEntryId);
}
$newEntry->setDataContent(implode(",", $toEntryIds));
break;
case entry::ENTRY_MEDIA_TYPE_XML:
list($totalResults, $fromFiltersList) = myPlaylistUtils::getPlaylistFilterListStruct($entry->getDataContent());
$toPlaylistXml = new SimpleXMLElement("<playlist/>");
$toPlaylistXml->addChild("total_results", $totalResults);
$toFiltersXml = $toPlaylistXml->addChild("filters");
foreach ($fromFiltersList as $filterXML) {
$entryFilter = new entryFilter();
$entryFilter->fillObjectFromXml($filterXML, "_");
if (isset($entryFilter->fields["_matchand_categories_ids"])) {
//.........这里部分代码省略.........