【问题标题】:Get Facebook Video Thumbnails Large Size using Facebook Video ID - PHP使用 Facebook 视频 ID 获取大尺寸的 Facebook 视频缩略图 - PHP
【发布时间】:2016-11-19 12:50:50
【问题描述】:

您好,我已经检查了很多关于此的 Stackoverflow 问题。以下是我看到的问题列表:

  1. Get Facebook video thumbnail image URLs?
  2. How to get Facebook video thumbnail from its video id?
  3. How to get big facebook video thumbnail
  4. How to get facebook video thumbnail from a given video ID using php
  5. Get large facebook video thumbnail using graph

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

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

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

【问题讨论】:

  • 检查 /videoid/thumbnails

标签: php facebook facebook-graph-api video


【解决方案1】:

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

$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 我从 Graph explorer 工具获得,或者你编写函数登录 facebook 你可以获得 access_token。 https://developers.facebook.com/docs/php/howto/example_facebook_login

希望能帮到你!

【讨论】:

    【解决方案2】:

    同样,我使用图形资源管理器可以获取缩略图视频,但我无法从“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 */
    

    【讨论】:

      猜你喜欢
      • 2015-11-16
      • 2011-10-23
      • 2011-06-18
      • 1970-01-01
      • 2015-10-24
      • 2011-08-26
      • 1970-01-01
      • 2011-06-14
      • 1970-01-01
      相关资源
      最近更新 更多