2016-07-16 150 views
0

您好,我已經檢查了很多關於此問題的Stackoverflow問題。以下是我所看到的問題清單:使用Facebook視頻ID獲取Facebook視頻縮略圖大尺寸 - PHP

  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,它的工作,但給我非常小的縮略圖。

如果您有任何方法,請幫助我。在此先感謝

+0

檢查/ videoid /縮略圖 – CBroe

回答

0

同樣你,我使用圖形資源管理器可以得到縮略圖視頻,但我不能從「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 */ 
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我從圖形Explorer工具獲得,或者你的代碼功能登錄博客,你可以得到的access_token。 https://developers.facebook.com/docs/php/howto/example_facebook_login

我希望能幫到你!