Facebook:通过JS API和Open Graph共享Flash播放器
问题描述:
我试图在Facebook上使用Open Graph API和Facebook JS API共享Flash播放器。我做这种方式:Facebook:通过JS API和Open Graph共享Flash播放器
FB.ui(
{
method : 'feed',
link : theUrl[0],
// OR
method : 'share',
href : theUrl[0],
},
function(response) {
if (response && response.post_id) {
// alert('Shared !');
} else {
// alert('An error occured. Your link has not been shared...');
}
});
和
<meta property="og:site_name" content="Believe Digital Player">
<meta property="og:url" content="URL">
<meta property="og:title" content="TITLE">
<meta property="og:type" content="video">
<meta property="og:image" content="IMAGE">
<meta property="og:video" content="SWF_PATH"/>
<meta property="og:video:secure_url" content="S_SWF_PATH"/>
<meta property="og:video:type" content="application/x-shockwave-flash">
<meta property="og:video:width" content="400">
<meta property="og:video:height" content="400">
当我直接分享在Facebook上的一切我的链接就可以了。 但是,当我使用我创建的JS按钮在我的应用中执行相同操作时,除了og:video和og:video:secured_url之外,所有打开的图形标记都正确匹配。结果是该链接张贴在我的墙上,但它的行为像它不是一个视频播放器,所以当我点击它,我被重定向到我的网站
我发现了另一种方法来做同样的事情(但它doesn 't在手机上工作,弹出窗口是空的'-_-):
var paramUrl = {'p' : {'url' : theUrl[0]}};
var urlFb = "http://www.facebook.com/sharer.php?"+$.param(paramUrl);
window.open(urlFb, "", "menubar=no, status=no, scrollbars=no, menubar=no, width=500, height=430");
任何人都可以帮助我吗?
答
我找到了一个解决方案通过修改的的网址:
var paramUrl = {'p' : {'url' : theUrl}};
var urlFb = "http://www.facebook.com/sharer.php?"+$.param(paramUrl);
window.open(urlFb, "", "menubar=no, status=no, scrollbars=no, menubar=no, width=500, height=430");
成为
var paramUrl = {'u' : theUrl};
var urlFb = "http://www.facebook.com/sharer.php?"+$.param(paramUrl);
window.open(urlFb, "", "menubar=no, status=no, scrollbars=no, menubar=no, width=500, height=430");
,它工作正常。
你能链接到你的页面吗?您是否尝试使用https://developers.facebook.com/tools/debug调试网址 – WizKid 2014-09-22 17:18:47