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


PHP entry::setSource方法代码示例

本文整理汇总了PHP中entry::setSource方法的典型用法代码示例。如果您正苦于以下问题:PHP entry::setSource方法的具体用法?PHP entry::setSource怎么用?PHP entry::setSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entry的用法示例。


在下文中一共展示了entry::setSource方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: attachRemoteAssetResource

 protected function attachRemoteAssetResource(entry $entry, kDistributionSubmitJobData $data)
 {
     $distributionProfile = DistributionProfilePeer::retrieveByPK($data->getDistributionProfileId());
     /* @var $distributionProfile UnicornDistributionProfile */
     $domainGuid = $distributionProfile->getDomainGuid();
     $applicationGuid = $distributionProfile->getAdFreeApplicationGuid();
     $assetParamsId = $distributionProfile->getRemoteAssetParamsId();
     $mediaItemGuid = $data->getRemoteId();
     $url = "{$domainGuid}/{$applicationGuid}/{$mediaItemGuid}/content.m3u8";
     $entry->setSource(KalturaSourceType::URL);
     $entry->save();
     $isNewAsset = false;
     $asset = assetPeer::retrieveByEntryIdAndParams($entry->getId(), $assetParamsId);
     if (!$asset) {
         $isNewAsset = true;
         $assetParams = assetParamsPeer::retrieveByPK($assetParamsId);
         $asset = assetPeer::getNewAsset($assetParams->getType());
         $asset->setPartnerId($entry->getPartnerId());
         $asset->setEntryId($entry->getId());
         $asset->setStatus(asset::FLAVOR_ASSET_STATUS_QUEUED);
         $asset->setFlavorParamsId($assetParamsId);
         $asset->setFromAssetParams($assetParams);
         if ($assetParams->hasTag(assetParams::TAG_SOURCE)) {
             $asset->setIsOriginal(true);
         }
     }
     $asset->incrementVersion();
     $asset->setFileExt('m3u8');
     $asset->setStatus(asset::FLAVOR_ASSET_STATUS_READY);
     $asset->save();
     $syncKey = $asset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $storageProfile = StorageProfilePeer::retrieveByPK($distributionProfile->getStorageProfileId());
     $fileSync = kFileSyncUtils::createReadyExternalSyncFileForKey($syncKey, $url, $storageProfile);
     if ($isNewAsset) {
         kEventsManager::raiseEvent(new kObjectAddedEvent($asset));
     }
     kEventsManager::raiseEvent(new kObjectDataChangedEvent($asset));
     kBusinessPostConvertDL::handleConvertFinished(null, $asset);
 }
开发者ID:DBezemer,项目名称:server,代码行数:39,代码来源:UnicornService.php

示例2: attachUrlResource

 /**
  * @param kUrlResource $resource
  * @param entry $dbEntry
  * @param asset $dbAsset
  * @return asset
  */
 protected function attachUrlResource(kUrlResource $resource, entry $dbEntry, asset $dbAsset = null)
 {
     if ($dbAsset instanceof flavorAsset) {
         $dbEntry->setSource(KalturaSourceType::URL);
         $dbEntry->save();
     }
     $url = $resource->getUrl();
     if (!$resource->getForceAsyncDownload()) {
         // TODO - move image handling to media service
         if ($dbEntry->getMediaType() == KalturaMediaType::IMAGE) {
             $entryFullPath = myContentStorage::getFSUploadsPath() . '/' . $dbEntry->getId() . '.jpg';
             if (KCurlWrapper::getDataFromFile($url, $entryFullPath)) {
                 return $this->attachFile($entryFullPath, $dbEntry, $dbAsset);
             }
             KalturaLog::err("Failed downloading file[{$url}]");
             $dbEntry->setStatus(entryStatus::ERROR_IMPORTING);
             $dbEntry->save();
             return null;
         }
         if ($dbAsset && !$dbAsset instanceof flavorAsset) {
             $ext = pathinfo($url, PATHINFO_EXTENSION);
             $entryFullPath = myContentStorage::getFSUploadsPath() . '/' . $dbEntry->getId() . '.' . $ext;
             if (KCurlWrapper::getDataFromFile($url, $entryFullPath)) {
                 $dbAsset = $this->attachFile($entryFullPath, $dbEntry, $dbAsset);
                 return $dbAsset;
             }
             KalturaLog::err("Failed downloading file[{$url}]");
             $dbAsset->setStatus(asset::FLAVOR_ASSET_STATUS_ERROR);
             $dbAsset->save();
             return null;
         }
     }
     kJobsManager::addImportJob(null, $dbEntry->getId(), $this->getPartnerId(), $url, $dbAsset, null, $resource->getImportJobData());
     return $dbAsset;
 }
开发者ID:DBezemer,项目名称:server,代码行数:41,代码来源:KalturaEntryService.php

示例3: handleEntry


//.........这里部分代码省略.........
                         $thumbTime = 3;
                         if ($duration && $duration < $thumbTime * 1000) {
                             $thumbTime = floor($duration / 1000);
                         }
                         // for videos - thumbail should be created in post convert
                         // otherwise this code will fail if the thumbanil wasn't created successfully (roman)
                         //myFileConverter::autoCaptureFrame($entry_fullPath, $thumbTempPrefix."big_", $thumbTime, -1, -1);
                         $need_thumb = false;
                         $thumbBigFullPath = $thumbTempPrefix . "big_" . $entry_thumbNum . '.jpg';
                     }
                 }
                 //else select existing thumb ($entry_thumbNum already points to the right thumbnail)
             }
         }
         $thumbFullPath = $thumbTempPrefix . $entry_thumbNum . '.jpg';
         // if we arrived here both entry and thumbnail are valid we can now update the db
         // in order to have the final entry_id and move its data to its final destination
         if ($onlyExtractThumb) {
             return $thumbFullPath;
         }
     }
     $entry->setkshowId($this->kshow_id);
     $entry->setKuserId($kuser_id);
     $entry->setCreatorKuserId($kuser_id);
     if ($this->partner_id != null) {
         $entry->setPartnerId($this->partner_id);
         $entry->setSubpId($this->subp_id);
     }
     $entry->setName($name ? $name : $this->getParam('entry_name'));
     //		$entry->setDescription('');//$this->getParam('entry_description'));
     $entry->setType($type);
     $entry->setMediaType($media_type);
     $entry->setTags($tags ? $tags : $this->getParam('entry_tags'));
     $entry->setSource($media_source);
     $entry->setSourceId($this->getParam('entry_media_id'));
     if ($media_date) {
         $entry->setMediaDate($media_date);
     }
     // if source_link wasnt given use the entry_url HOWEVER, use it only if id doesnt contain @ which suggests the use of a password
     $entry->setSourceLink($entry_source_link ? $entry_source_link : (strstr($entry_url, '@') ? "" : $entry_url));
     if ($media_source == entry::ENTRY_MEDIA_SOURCE_FILE) {
         $entry->setSourceLink("file:{$entry_fullPath}");
     }
     $entry->setLicenseType($this->getParam('entry_license'));
     $entry->setCredit($this->getParam('entry_credit'));
     $entry->setStatus($entry_status);
     if ($duration !== null) {
         $entry->setLengthInMsecs($duration);
     }
     if ($this->entry_id == 0) {
         $entry->save();
         $this->entry_id = $entry->getId();
     }
     // move thumb to final destination and set db entry
     if ($media_type != entry::ENTRY_MEDIA_TYPE_AUDIO && $entry_thumbNum && $need_thumb) {
         KalturaLog::debug("handleEntry: saving none audio thumb [{$thumbBigFullPath}]");
         $entry->setThumbnail('.jpg');
         if ($thumbBigFullPath) {
             if ($media_type != entry::ENTRY_MEDIA_TYPE_IMAGE) {
                 myFileConverter::convertImage($thumbBigFullPath, $thumbFullPath);
             }
             /*$thumbBigFinalPath = $content.$entry->getBigThumbnailPath();
             		myContentStorage::moveFile($thumbBigFullPath, $thumbBigFinalPath, true , $should_copy );
             		*/
             $entryThumbKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
             try {
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:67,代码来源:myInsertEntryHelper.class.php

示例4: toSourceType

 protected function toSourceType(entry $entry)
 {
     $entry->setSource(KalturaSourceType::LIVE_CHANNEL);
 }
开发者ID:DBezemer,项目名称:server,代码行数:4,代码来源:KalturaLiveChannel.php


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