问题
I want to get thumbnail of facebook videos from a given video ID .
I use the preg_match function to get facebook video ID from a given url retrieved from database
preg_match("~/videos/(?:t\.\d+/)?(\d+)~i", $value->url, $matches);
$video_id = $matches[1];
echo ' <div class="fb-video" data-href="https://www.facebook.com/facebook/videos/'.$video_id.'/"></div>';
I want to posted on website with something like this:
<img src="VIDEO_IMAGE.<?php echo $video_id ?>.jpg">
I don't know if it' posssible? !
回答1:
Your image source is wrong try using
<img src="https://graph.facebook.com/VIDEO_ID/picture" />
Example : https://graph.facebook.com/10153231379946729/picture
来源:https://stackoverflow.com/questions/32155110/how-to-get-facebook-video-thumbnail-from-a-given-video-id-using-php