获取Facebook视频缩略图URL URL? [英] Get Facebook video thumbnail image URLs?

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

问题描述

我们可以使用URL中的视频ID获取YouTube视频的视频缩略图。

We can get the video thumb of YouTube videos by using the video ID in an URL the way defined below

$src = "http://img.youtube.com/vi/".$video_id."/default.jpg";               

同样,如何获取Facebook视频的视频缩略图?是否有任何预定义的URL,我们把Facebook的视频ID和YouTube的定义如上所述?

Similarly, how can I get the video thumb of Facebook videos? Is there any predefined URL in which we put the Facebook video ID and get the as like youtube defined in the way above?

推荐答案

试图做到这一点,但它并不是这样。
示例:
a视频我在一个页面与
ID1015030122022040
有一个缩略图网址:

Trying to do this as well but it does not appear so. Example: a video I have on a Page with ID "1015030122022040" has a thumbnail url of:

http://vthumb.ak.fbcdn.net/hvthumb-ak-ash2/51388_10150301225830401_10150301220220401_62962_1470_t.jpg

另一个ID为10150361184550401的视频
的缩略图网址为:
http://vthumb.ak.fbcdn.net/hvthumb-ak-snc4/162098_10150361242815401_10150361184550401_35242_2053_t.jpg

While another video with ID: 10150361184550401 has a thumbnail url of: http://vthumb.ak.fbcdn.net/hvthumb-ak-snc4/162098_10150361242815401_10150361184550401_35242_2053_t.jpg

我看过别人,发现没有明显的模式。然而,您可以使用FQL返回uid的视频数组。

I looked through others and found no obvious pattern. You can however do an FQL to return the array of videos by uid.

使用一些代码从教程,我在第三步中编辑了sql查询示例:

Using some code from a tutorial, I edited the "sql query example" in Step Three to this:

try {
    //get user id
    $uid    = $facebook->getUser();
    //or you can use $uid = $fbme['id'];

   $fql = "SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner=" . $uid;

    $param  =   array(
        'method'    => 'fql.query',
        'query'     => $fql,
        'callback'  => ''
    );
    $fqlResult   =   $facebook->api($param);
}
catch(Exception $o){
    d($o);
}

然后从他的例子中可以看到数组<?php d($ fqlResult); ?>

Then from his example was able to the view the arrays <?php d($fqlResult); ?>

然后抓住我最近的视频缩略图:

And grabbed my most recent video thumbnail thusly:

<img src="<?php echo $fqlResult[0][thumbnail_link]; ?>" />

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

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