Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Created July 13, 2021 15:41
Show Gist options
  • Save frankyonnetti/e7f02edcc645f6ae7212de9770173ac4 to your computer and use it in GitHub Desktop.
Save frankyonnetti/e7f02edcc645f6ae7212de9770173ac4 to your computer and use it in GitHub Desktop.
#video #vimeo Get image for video
// example: https://vimeo.com/api/oembed.json?url=https://vimeo.com/387724556
<?php
$vimeo_url = 'https://vimeo.com/387724556';
$data = json_decode(file_get_contents('http://vimeo.com/api/oembed.json?url=' . $vimeo_url));
echo '<img class="vimeo-video" src="' . $data->thumbnail_url . '" alt="Video: ' . $data->title . '">';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment