Fetching Video Thumbnails

9 replies [Last post]
Joined: 03/29/2009
Points: 755

Fetching video thumbnails and the All in One Video Pack.

Joined: 03/29/2009
Points: 755

Is there a way to fetch video thumbnails in the WP loop? I want to use multiple loops and for one loop, I want it to show thumbnails of the the videos.

Joined: 03/29/2009
Points: 755

You can fetch the videos manually and make a loop over it

Should look like this:

Code: Select all
require_once("kaltura_model.php");
$kalturaAdminClient = getKalturaClient(true);
$pageSize = 18;
$page = 1;
$result = KalturaModel::getKshows($kalturaAdminClient, $pageSize, $page);
$totalCount = $result["count"];

Joined: 06/16/2009
Points: 21

I want to do the same, but the solution provided isn't what I'm looking for. In fact, I don't want the video only, but all the information contained in the wordpress post as well. In that way, it would be nicer to get the video from the loop, meaning by parsing the content of the post.

To get the thumbnail, you can use the Extra URL service "thumbnail", it looks something like this :
<img src="http://cdn.kaltura.com/p/1/sp/1/thumbnail/entry_id/921594/width/320/height/252">
Doc : http://corp.kaltura.com/wiki/index.php/KalturaAPI:thumbnail

Further than just a thumbnail, there is this great script to do a thumbnail rotator when the mouse is over :
Doc : http://www.kaltura.org/kaltura-thumb-rotator-guide

My problem to get it all working, is that in the post, the plug-in has written the wid (widget id), and not the id (entry id). And to get the thumbnail (with )How can I get the id out of the wid with PHP ?

I've been looking into Kaltura's API, but I must say, I'm a little lost, I'm not that able to read the notation.

Any input on how to get an id from a wid in PHP ?

Joined: 02/22/2009
Points: 32

You can do the same using the wid (widget id).

Joined: 06/16/2009
Points: 21

Eh, why didn't I think of that earlier ?!? ;-)

For the record, you only need to replace "entry_id" by "widget_id", it looks something like this :
<img src="http://cdn.kaltura.com/p/1/sp/1/thumbnail/widget_id/921594/">

Thanks !

Joined: 06/02/2010
Points: 3

where exactly do i put this in the loop and how do insert the entry_id dynamically can you show me the code you used.
I am trying to add a custom field to show just the thumbnail to the videos on the home page.

Joined: 06/16/2009
Points: 21

Hi principalcrown,

where you put it in the loop doesn't matter, you put it where you want to display it. If you look at the line I had posted :

<img src="http://cdn.kaltura.com/p/1/sp/1/thumbnail/widget_id/921594/">

The last number is the id you need to replace dynamically.

You can also check out this little plugin I made for my Wordpress deployment, it uses Wordpress plugin called More-fields, then you have the uploader right in your Wordpress admin page. But I haven't checked if it still works with the newest Wordpress 3.
kaltura.org/visible-uploader-kaltura-entry-field-type-wordpress-more-fields-plug

Good luck !

Joined: 06/16/2009
Points: 21

Where you put it in the loop doesn't matter, you put it where you want to display it. If you look at the line I had posted :

<img src="http://cdn.kaltura.com/p/1/sp/1/thumbnail/widget_id/921594/">

The last number is the id you need to replace dynamically.

You can also check out this little plugin I made for my Wordpress deployment, it uses Wordpress plugin called More-fields, then you have the uploader right in your Wordpress admin page. But I haven't checked if it still works with the newest Wordpress 3. Search for visible-uploader-kaltura-entry-field-type-wordpress-more-fields-plug in the forum (I'm not able to post the link because of the SPAM filter)

Good luck !

Joined: 07/06/2010
Points: 3

but what is the /p/1/sp/1 ???