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


PHP myPartnerUtils::getThumbnailHost方法代码示例

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


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

示例1: getThumbnailUrl

 public function getThumbnailUrl($version = null, $protocol = null)
 {
     if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_DISABLE_KMC_DRILL_DOWN_THUMB_RESIZE, $this->getPartnerId())) {
         $subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA;
         if ($this->getType() == entryType::MEDIA_CLIP && $this->getMediaType() != entry::ENTRY_MEDIA_TYPE_IMAGE) {
             $subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB;
         }
         $syncKey = $this->getSyncKey($subType);
         $fileSync = null;
         $serveRemote = false;
         $partner = PartnerPeer::retrieveByPK($this->getPartnerId());
         switch ($partner->getStorageServePriority()) {
             case StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY:
                 $serveRemote = true;
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_FIRST:
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if ($fileSync) {
                     $serveRemote = true;
                 }
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST:
                 $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
                 if ($fileSync) {
                     break;
                 }
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 $serveRemote = true;
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY:
                 $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 break;
         }
         if ($serveRemote && $fileSync) {
             $url = $fileSync->getExternalUrl($this->getId());
             if (!is_null($protocol)) {
                 $url = preg_replace('/^https?/', $protocol, $url);
             }
             return $url;
         }
     }
     //$path = $this->getThumbnailPath ( $version );
     $path = myPartnerUtils::getUrlForPartner($this->getPartnerId(), $this->getSubpId()) . "/thumbnail/entry_id/" . $this->getId();
     $partner = $this->getPartner();
     if ($partner && $this->getMediaType() == entry::ENTRY_MEDIA_TYPE_AUDIO && $partner->getAudioThumbEntryId() && $partner->getAudioThumbEntryVersion()) {
         $thumbEntryId = $partner->getAudioThumbEntryId();
         $thumbVersion = $partner->getAudioThumbEntryVersion();
         $current_version = "{$thumbVersion}/thumb_entry_id/{$thumbEntryId}";
     } elseif ($partner && in_array($this->getType(), array(entryType::LIVE_STREAM, entryType::LIVE_CHANNEL)) && $partner->getLiveThumbEntryId() && $partner->getLiveThumbEntryVersion()) {
         $thumbEntryId = $partner->getLiveThumbEntryId();
         $thumbVersion = $partner->getLiveThumbEntryVersion();
         $current_version = "{$thumbVersion}/thumb_entry_id/{$thumbEntryId}";
     } else {
         $current_version = $this->getThumbnailVersion();
     }
     if ($version) {
         $path .= "/version/{$version}";
     } else {
         $path .= "/version/{$current_version}";
     }
     $assetCacheVersion = $this->getAssetCacheVersion();
     if ($assetCacheVersion != self::DEFAULT_ASSETCACHEVERSION) {
         // If the version is not the default, include it as part of the URL in order
         // to bypass existing image cache and produce a fresh thumbnail (which will
         // persist until assetCacheVersion is modified again)
         $path .= "/acv/{$assetCacheVersion}";
     }
     $url = myPartnerUtils::getThumbnailHost($this->getPartnerId(), $protocol) . $path;
     return $url;
 }
开发者ID:AdiTal,项目名称:server,代码行数:80,代码来源:entry.php

示例2: getThumbnailUrl

 public function getThumbnailUrl($version = null, $protocol = null)
 {
     if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_DISABLE_KMC_DRILL_DOWN_THUMB_RESIZE, $this->getPartnerId())) {
         $subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA;
         if ($this->getType() == entryType::MEDIA_CLIP && $this->getMediaType() != entry::ENTRY_MEDIA_TYPE_IMAGE) {
             $subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB;
         }
         $syncKey = $this->getSyncKey($subType);
         $fileSync = null;
         $serveRemote = false;
         $partner = PartnerPeer::retrieveByPK($this->getPartnerId());
         switch ($partner->getStorageServePriority()) {
             case StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY:
                 $serveRemote = true;
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_FIRST:
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if ($fileSync) {
                     $serveRemote = true;
                 }
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST:
                 $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
                 if ($fileSync) {
                     break;
                 }
                 $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 $serveRemote = true;
                 break;
             case StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY:
                 $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
                 if (!$fileSync) {
                     return null;
                 }
                 break;
         }
         if ($serveRemote && $fileSync) {
             $url = $fileSync->getExternalUrl($this->getId());
             if (!is_null($protocol)) {
                 $url = preg_replace('/^https?/', $protocol, $url);
             }
             return $url;
         }
     }
     //$path = $this->getThumbnailPath ( $version );
     $path = myPartnerUtils::getUrlForPartner($this->getPartnerId(), $this->getSubpId()) . "/thumbnail/entry_id/" . $this->getId();
     $current_version = $this->getThumbnailVersion();
     if ($version) {
         $path .= "/version/{$version}";
     } else {
         $path .= "/version/{$current_version}";
     }
     $url = myPartnerUtils::getThumbnailHost($this->getPartnerId(), $protocol) . $path;
     return $url;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:62,代码来源:entry.php


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