Is there a way to access video thumbnails from templates?

Something like this:

echo $node->field_video[0]['thumb'];

or similar.

Is it possible?

k.

Comments

chellman’s picture

Try this:

$node->field_video[0][data][thumbnail]
smoothify’s picture

This doesn't work for me - the data array is empty when i do a print_r on the field. (using mainly youtube videos)

i'd like to retrieve the thumbnail inside a template but can't find out how - i've been looking at the following in the video_cck,module but don't know the right way to call it.

function theme_video_cck_video_thumbnail($field, $item, $formatter, $node)

Anyone able to shed some light?

Thanks

Ben

aaron’s picture

Status: Active » Fixed

the easiest way would be to set the display to thumbnail for teasers (at /admin/content/types/[your content type name]/display ), then $node->field_video[0]['view'] would display the thumbnail. alternatively, i'm pretty sure you could do theme('cck_video_thumbnail', $node->field_video, $node->field_video[0], 'video_thumbnail', $node), although i haven't tested it.

aaron

Anonymous’s picture

Status: Fixed » Closed (fixed)
elvis2’s picture

I am trying to use the cck_video_thumbnail theming option for a block. Can you instruct me what fields to put into:
theme_video_cck_video_thumbnail($field, $item, $formatter, $node)

I am running a query to get 5 recent videos and would like to get a thumbnail printout. How can I get the above function to display the thumbnails? I am not sure what $item and $formatter refers too?

Thanks

tom_o_t’s picture

Version: 5.x-1.x-dev » 5.x-1.0

just in case someone stumbles across this...

to embed a video thumbnail in a tpl.php file outside of the teaser (I need to display both the thumbnail and full size video on the same page), I had to use:

print theme('video_cck_video_thumbnail', $node->field_video, $node->field_video[0], 'video_thumbnail', $node) . 'hello world';

emfield 1.0, drupal 5.7