时间轴上的视频帖子未内嵌播放

发布于 2024-12-29 11:43:11 字数 1731 浏览 1 评论 0原文

我在通过我的应用程序向具有 TimeLine 个人资料的用户发布视频时遇到问题。 该帖子看起来非常小,点击后视频会在新选项卡上打开,而不是在 Facebook 内播放。

以下是一些细节:

我正在构建一个应用程序,用于创建自定义视频(SWF)并将其发布到用户的朋友墙上。 我将 SWF 文件“包装”在包含以下“meta og:”标记的 HTML 文件中 -

    <meta property="fb:app_id" content="******" />
    <meta property="og:url" content="THIS PAGE URL" />
    <meta property="og:title" content="Title" /> 
    <meta property="og:description" content="some description" /> 
    <meta property="og:type" content="video" />
    <meta property="og:image" content="an img url" />   
    <meta property="og:video" content="URL TO THE SWF FILE" />  
    <meta property="og:video:type" content="application/x-shockwave-flash" />
    <meta property="og:video:width" content="396" />
    <meta property="og:video:height" content="297" />
    <meta property="og:site_name" content="pickle-games" />

然后在正文中使用“embed”标记嵌入 SWF。
您可以通过查看 http://pickle 的源代码来查看示例-games.com/BigBully/hitVideo.php?hit_id=1327242593&hit=hit2

我是使用 facebook PHP SDK 像这样在墙上发布:

$facebook->api("/" . $uid . "/feed", "POST",
                        array(
                        'link' => $server_url . 'hitVideo.php?hit='. $hit . "&hit_id=".$hit_id ."&u_name=" . $u_name . "&f_name=". $f_name                  
                             ));

当使用旧配置文件(而不是时间线)向用户发布时,一切正常,并且视频在墙上内联播放。

如上所述,问题仅出现在使用时间线配置文件的用户上发帖时

顺便说一句 - 如果我在朋友的时间线上手动共享链接(而不是通过我的应用程序),那么一切都会正常工作。 ?

我缺少什么 我如何通过我的应用程序发布它,使其在时间轴上也能工作? 谢谢。

I have a problem when posting video through my app on users with TimeLine profile.
the post appears very small and when clicked the video opens on a new tab instead of playing inside facebook.

Here are some details :

I'm building an application that create customized videos (SWF) and post them on a user's friend wall.
I'm "wrapping" the SWF file in an HTML file that include the following "meta og:" tags -

    <meta property="fb:app_id" content="******" />
    <meta property="og:url" content="THIS PAGE URL" />
    <meta property="og:title" content="Title" /> 
    <meta property="og:description" content="some description" /> 
    <meta property="og:type" content="video" />
    <meta property="og:image" content="an img url" />   
    <meta property="og:video" content="URL TO THE SWF FILE" />  
    <meta property="og:video:type" content="application/x-shockwave-flash" />
    <meta property="og:video:width" content="396" />
    <meta property="og:video:height" content="297" />
    <meta property="og:site_name" content="pickle-games" />

and then in the body i embed the SWF using the "embed" tag.
You can see an example by viewing the source of http://pickle-games.com/BigBully/hitVideo.php?hit_id=1327242593&hit=hit2

I'm using the facebook PHP SDK to post on the wall like this :

$facebook->api("/" . $uid . "/feed", "POST",
                        array(
                        'link' => $server_url . 'hitVideo.php?hit='. $hit . "&hit_id=".$hit_id ."&u_name=" . $u_name . "&f_name=". $f_name                  
                             ));

When posting on a user with the old profile (not the timeline) everything works fine and the video plays inline, on the wall.

The problem, as mentioned above, is only when posting on a user that uses the TimeLine profile

BTW - if i share the link manually (not through my app) on the friend's timeline then everything works fine...

What am i missing?
How do i post it through my app in a way that it will work also on the timeline?
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橙味迷妹 2025-01-05 11:43:11

试试这个

$attachment = array(
        'message' => 'SOMETHING HERE!',
        'name' => 'name!',
        'caption' => 'caption!',
        'link' => 'http://link.com',
        'description' => 'description here!',
        'access_token' => $request["oauth_token"],
        'picture' => 'http://link.com/image.jpg',
        'source' => 'link.com/flash.swf',
        'actions' => array(array('name' => 'some action',
                          'link' => 'https://link.com/'))
);      

$result = $facebook->api('/'.$friend_id.'/feed/','post',$attachment);

在“消息”中添加一些内容非常重要,否则会给您带来同样的错误......

Try this

$attachment = array(
        'message' => 'SOMETHING HERE!',
        'name' => 'name!',
        'caption' => 'caption!',
        'link' => 'http://link.com',
        'description' => 'description here!',
        'access_token' => $request["oauth_token"],
        'picture' => 'http://link.com/image.jpg',
        'source' => 'link.com/flash.swf',
        'actions' => array(array('name' => 'some action',
                          'link' => 'https://link.com/'))
);      

$result = $facebook->api('/'.$friend_id.'/feed/','post',$attachment);

It is very important to put something in the 'message' or else is going to give you that same error...

终陌 2025-01-05 11:43:11

请注意,如果您没有

<meta property="fb:app_id" content="xxxxxxxxxxxxxxxx" />

发布到墙上,视频将在窗口中打开。

Just a note, if you do not have

<meta property="fb:app_id" content="xxxxxxxxxxxxxxxx" />

When posted to the wall, the video will open in a NEW window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文