Ejemplo n.º 1
0
 public static function fromSearchResultArray($arr, KalturaSearch $search)
 {
     $newArr = new KalturaSearchResultArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaSearchResult();
         $nObj->fromSearchResult($obj, $search);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Ejemplo n.º 2
0
 /**
  * Search for media given a specific URL
  * Kaltura supports a searchURL action on some of the media providers.
  * This action will return a KalturaSearchResult object based on a given URL (assuming the media provider is supported)
  * 
  * @action searchUrl
  * @param KalturaMediaType $mediaType
  * @param string $url
  * @return KalturaSearchResult
  *
  * @throws APIErrors::SEARCH_UNSUPPORTED_MEDIA_SOURCE_FOR_URL
  */
 public function searchUrlAction($mediaType, $url)
 {
     list($mediaSourceProvider, $objId) = myMediaSourceFactory::getMediaSourceAndObjectDataByUrl($mediaType, $url);
     if (!$mediaSourceProvider) {
         throw new KalturaAPIException(APIErrors::SEARCH_UNSUPPORTED_MEDIA_SOURCE_FOR_URL, $url);
     }
     $result = $mediaSourceProvider->getMediaInfo($mediaType, $objId);
     $newSearchResult = new KalturaSearchResult();
     $search = new KalturaSearch();
     $newSearchResult->fromSearchResult($result['objectInfo'], $search);
     return $newSearchResult;
 }