Search code examples
facebookvideosdkfacebook-php-sdkpublish

Howto publish an embedded video with Facebook's latest PHP SDK?


I know this question has been rised quite a lot of times, but then they constantly change things at Facebook and none of the numerous ways I've discovered on the web, works for me. Maybe it worked before, but not anymore.

I have a web page with a video playing in our skinned jwplayer. All the og tags are beautifully set, so that when a visitor likes the page, it's title, description, thumb and custom flash player are nicely shared on the users wall. Video even plays right there on the wall, in the embedded and customized flash player. So everything works as expected.

But!.. We would like to auto-post our new posts onto the website's page on Facebook and we want them to look exactly like when they are shared. One would probably expect that it'd be enough to simply post a link through PHP SDK and facebook will do the rest. But it doesn't. It seems to not pay attention at og tags in latter case.

What would be the right way to do this? Is it possible to force facebook to look at og tags? Or how to publish a post with a video in a similar way, but through PHP SDK?


Solution

  • One would probably expect that it'd be enough to simply post a link through PHP SDK and facebook will do the rest. But it doesn't.

    What exactly are you posting – just a link, or a post containing a link?

    (For difference between the two types of creating a feed object see https://developers.facebook.com/docs/reference/api/user/#posts vs https://developers.facebook.com/docs/reference/api/user/#links)

    Is it possible to force facebook to look at og tags?

    Normally it does without any further action neccessary.

    Have you tried, though, putting your new posts URL through Facebook debugger before posting it?