【问题标题】:Get large facebook video thumbnail using graph使用图形获取大型 facebook 视频缩略图
【发布时间】:2016-09-27 05:41:04
【问题描述】:

我想使用图形获取大型 facebook 视频缩略图。下面的代码得到小缩略图

https://graph.facebook.com/VIDEO_ID/picture

此代码将返回 Ex:

https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-prn1/632393_10151574602254838_10151574598089838_34404_282_t.jpg

如果我用“n”替换“t”,我会得到大图

https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-prn1/632393_10151574602254838_10151574598089838_34404_282_n.jpg

但是我如何使用 facebook graph 或使用 php 将“t”替换为“n”

提前致谢。

【问题讨论】:

标签: php facebook facebook-graph-api


【解决方案1】:

你可以使用这个 php 代码,它对我有用。

<?php 
   $video_id = "10153231379946729"; 
   $xml = file_get_contents('http://graph.facebook.com/' . $video_id); 
   $result = json_decode($xml); 

   $small = $result->format[0]->picture; 
   $medium = $result->format[1]->picture;

   //fetch the 720px sized picture
   $large = $result->format[3]->picture; 
?>

<img src="<?php echo $medium;?>">

【讨论】:

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