Support » Plugins and Hacks » [Plugin: Viper’s Video Quicktags] Automatic Vimeo thumbnail

  • Hi. Does anyone know if is possible to get an automatic vimeo thumbnail to use in my own template design?. I want to do a list of videos (posts) and I want to display the thumbnail at left and the post title at right, son I need to generate, if is possible, an automatic thumbnail from a vimeo video.

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • i woiuld also be really intrested in this(if its possible?)

    No idea.

    Hi it’s no big problem for youtube as they store the picture with the video id in the url, others suck …

    for my quick use i didn’t find plugin doing it completely, so i use Viper’s Video Quicktags, which grabs the image and puts it instead when JS is disabled, so i just load the_content as it goes and trim the things off to get the address. The way is a bit jerky but it works for now. Hope helps.
    TV

    <?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    <?php 
    
    $nolines = '/[\n\r]/';
    $cont = get_the_content(null, 0, '');
    $cont = apply_filters('the_content', $cont);
    $tillnolines = preg_replace($nolines, ' ', $cont);
    $till = preg_replace('/^(.*)(com\/watch)/', '', $tillnolines);
    $almost = preg_replace('/(alt\=\"YouTube Preview Image\")(.*)/', '', $till);
    $core = preg_replace('/(.*)( src=)/', '', $almost);
    echo '<img class="prev video" src='.$core.' alt="" />';
    
    ?>
    		<?php endwhile; endif; ?>

    Here’s Vimeo Thumbnail thing.

    <?
    $imgid = 4715514;
    $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
    print_r($hash);
    echo '<br />';
    foreach($hash as $hashed){
    echo $hashed[thumbnail_medium];
    }
    
    ?>

    My plugin already displays YouTube’s thumbnail if JS disabled.

    However I didn’t know about the Vimeo one. That’s handy.

    If anyone can still help me with this subject I really need the help. I’m new to WordPress as well as PHP, and I need Vimeo’s Thumbnail.

    I’ve tried to place the code above in the Viper script but I obviously have not done this correctly. Where do you place the above script? Does it go in a Viper plug-in file? If so, do you have to add anything when you post the embedded video?

    Thanks for your help!

    There is still a plugin that gets a thumbnail from Vimeo but it doesn’t was as usefull as I want. This plugin is Vimeo Badge

    http://www.colak.net/vimeo-badge/

    I currently use a workaround using Vimeo widget to emulate a video list player. Therefore I will try using the code that Tomas posted.

    jtclark18: I guess that you have to put the code within the_loop as follows:

    <?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    <?
    $imgid = 4715514;
    $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
    print_r($hash);
    echo '<br />';
    foreach($hash as $hashed){
    echo $hashed[thumbnail_medium];
    }
    
    ?>
    		<?php endwhile; endif; ?>

    I not sure if $imgid = 4715514; is equal to the vimeo video id.

    Thanks for your help to everyone!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Viper’s Video Quicktags] Automatic Vimeo thumbnail’ is closed to new replies.