Using the Video Return Object

When you are adding your field in the groups section of the Advanced Custom fields area, you can select the type of return value to get. If you select the Video Object return value you will be able to access a nicely crafted object pulling in data from the Vimeo API.


When available the video object pings the Vimeo API to gather in specifics about your video. You can use this data to recreate a Vimeo type experience on your WordPress site. We use the WordPress Transient API to cache your results for 8 hours (filter available).

The image below shows you the exact object properties that gets returned.


Code example

Here is a simple example how to create a title, description and thumbnail.

$video = get_field('video');
echo $video->title . '<br>';
echo $video->description . '<br>';
echo '<img src="' . $video->thumbnail_large . '">';