當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。