PHP

Get Vimeo Video Thumbnail From Video Url

When we need to display a Vimeo video thumbnail on the page as a placeholder we can call it from Vimeo API.

Please insert the below function in function.php to fetch the thumbnail image.

function grab_vimeo_thumbnail($vimeo_url){
    if( !$vimeo_url ) return false;

    $data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) );

    if( !$data ) return false;

    return $data->thumbnail_url;  OR
    return $data->thumbnail_url_with_play_button;  
}

Now we can call the “grab_vimeo_thumbnail()” function anywhere with the Vimeo video URL.

Please find the demo below.

I have called the demo video thumbnail with function API.

Het Patel

I'm a Professional WordPress Developer with 5+ years of web design and development experience including custom websites for small & enterprise businesses. I also have acquired fame and popularity in API Integration & Development and am responsible for producing high-quality solutions for the company customers, Bringing a deep understanding of Modern HTML, JavaScript, and CSS, Plugin Customization, Theme Customization, Theme Creation, creating websites from scratch, and the software development life cycle, And strong ability to execute and implement standard software architecture patterns.

Share
Published by
Het Patel

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

3 years ago