使用Facebook Video ID - PHP获取Facebook视频缩略图大尺寸


Get Facebook Video Thumbnails Large Size using Facebook Video ID - PHP

你好,我已经检查了许多关于这个问题的Stackoverflow问题。以下是我看到的问题列表:

  1. 获取脸书视频缩略图网址?
  2. 如何从其视频ID中获取Facebook视频缩略图?
  3. 如何获得大脸书视频缩略图
  4. 如何使用php从给定的视频ID获取Facebook视频缩略图
  5. 使用图表获取大型脸书视频缩略图

但我不知从哪里得到了答案。

我使用了这个:https://graph.facebook.com/VIDEO_ID/picture,它有效,但给了我非常小的缩略图。

如果您有任何方法,请帮助我。提前致谢

我发现如何使用获得缩略图高解决方案,并且我成功获得缩略图高解决方案。您可以使用以下代码:

$video_id= Input::get('id_video');
$config = [
    'app_id' => 'Config::get('setting.APP_ID'),
    'app_secret' => 'Config::get('setting.SECRET_ID'),
    'default_graph_version' => 'v2.7',
];
$fb = new Facebook($config);
$accessToken = Input::get('access_token');

$url = "https://graph.facebook.com/".$video_id."?fields=description,thumbnails&access_token=".$accessToken;
//Make the API call
$result = file_get_contents($url);
//Decode the JSON result.
$decoded = json_decode($result, true);
//Dump it out onto the page so that we can take a look at the structure of the data.
var_dump($decoded);

$accessToken我从图形浏览器工具得到,或者你代码函数登录脸书你可以得到access_token。https://developers.facebook.com/docs/php/howto/example_facebook_login

希望对您有所帮助!

同样,我使用 Graph 浏览器可以获取缩略图视频,但我无法从"https://graph.facebook.com/VIDEO_ID/picture"获取缩略图。您可以重新关注

/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{video-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */