update the thumbnail of a playlist

2 replies [Last post]
Joined: 04/05/2009
Points: 11

is there any way for this?

Joined: 09/30/2010
Points: 4

We are using the playlist functionality as a sort of 'album' based collection for videos. Since this is the only way (that I'm aware of) to do something like this, I'd like to know if it's possible to:

1) Add a thumbnail to a represent a playlist...
-or-
2) Extend the CE version of Kaltura to allow this...

I'd appreciate any help or advice on accomplishing this.

Thanks in advance

Joined: 09/30/2010
Points: 4

So here's what I had to do to add a thumbnail to a playlist:

I uploaded an image to the playlist.

During the loop of the available playlists, I run through the actual playlist data and look for an image.

When I find an image, I store the image URL and just spit that out.

It's a little messy... but it works until I hear of something better.

foreach ($a_playlists as $playlist) {
 if ($n_collectioncounter < 8) {
  // Load up each item in the playlist.
  $a_content = $playlist->playlistContent;
  $a_content = explode(",", $a_content);
                                                                       
  // Looping through the playlist, looking for an image.
  foreach ($a_content as $content) {
   // We're looking for an image
   $kImageFilter                                        = new KalturaMediaEntryFilter();
   $kImageFilter->idEqual                       = $content;
   $kImageFilter->mediaTypeEqual        = 2;
   $kImageResponse                              = $kclient->media->listAction($kImageFilter);
                                                                               
   // Store Media Items in array
   $a_image                             = $kImageResponse->objects;
                                                                               
   foreach ($a_image as $play_thumb) {
    $playlist_thumb_url = "http://YourCECalturaURL.com/";
    $playlist_thumb_url .= "p/" . PARTNER_ID . "/thumbnail/entry_id/" . $play_thumb->id;
   }
  }
                                                                       
  echo '<li>';
   echo '<a id="collection-' . $playlist->id . '" href="/collections/' . toSlug($playlist->name) . "/" . $playlist->id . '" class="thumb">';

  if ($playlist_thumb_url != "") {
   echo '<img src="' . $playlist_thumb_url . '" />';
  } else {
   echo '<img src="/_images/placeholder.png" />';
  }

   echo '</a>';
   echo '<h4>' . $playlist->name . "</h4>";
  echo '</li>';
                                                                       
   // Clear Playlist
   $playlist_thumb_url = "";
  }
}