使用图形获取大型Facebook视频缩略图 [英] Get large facebook video thumbnail using graph

查看:75
本文介绍了使用图形获取大型Facebook视频缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用图形获取较大的Facebook视频缩略图.下面的代码获取小缩略图

I want to get the large facebook video thumbnail using graph. Below code get the small thumbnail

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

此代码将返回Ex:

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

如果我将"t"替换为"n",我会得到大图像

If i replace "t" with "n" i will get the large image

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

但是如何使用Facebook图形获取它,或者使用php将"t"替换为"n"

But how do i get it using facebook graph or replace "t" with "n" using php

谢谢.

推荐答案

您可以使用此php代码,对我有用.

you can use this php code, its working for me.

<?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;?>">

这篇关于使用图形获取大型Facebook视频缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆