Reputation: 89
I am developing a WP plugin to post WP posts to FB. I am trying to post SWF videos generated from my site to FB using javascript SDK. The thumbnail,description link and all other things are get posted.But when I click the thumbanil it is not playing the video,instead redirecting to the link.The Play Button is also not showing.I am attaching the screen shot.
I am attaching part of my code...
var picture = data.preview_img;
var source = swf_path+'fbap.swf?wpContent='+content+'&bg_clr='+bg_color+'&bg_image='+bg_image+'&font_color='+font_color+'&repeat='+fill_mode+'&video_url='+uid;
var all_item = {
method: 'feed',
type: 'video',
picture: picture,
source: source,
name:'Facebook Dialogs',
description: 'Using Dialogs to interact with users.'
}
.................................................................
FB.api('/me/feed', 'post', all_item , function(response) {
if (!response || response.error) {
alert('Error occured: ' + response.error.message);
} else {
//Code
}
}
I also did it with the meta tags.
<meta property="og:title" content="Fly, you fools!" />
<meta property="og:type" content="website"/>
<meta property="og:description" content="Content for Description" />
<meta property="og:image" content="http://i2.ytimg.com/vi/meOCdyS7ORE/mqdefault.jpg" />
<meta property="og:site_name" content="Content for caption"/>
<meta property="og:video" content="http://www.youtube.com/v/meOCdyS7ORE?version=3&autohide=1">
<meta property="og:video:type" content="application/x-shockwave-flash">
<meta property="og:video:width" content="640">
<meta property="og:video:height" content="360">
Youtube video as an test get posted correctly.But it has cache problem.And also I can't pass the large source url. Is there any solution?Thanks in advance for your help.
Upvotes: 0
Views: 110
Reputation: 475
Are you trying to post same post to the FB.It does not have any cache probelem.It is because you are posting the same WP post.
Instead of passing Large query string why don't you pass the post ID and get the things to the meta Tag.
Use this
var all_item = {type: 'link',link:'link to the meta tag?id='+postID}
FB.api('/me/feed', 'post', all_item , function(response) {//Code }
Get the things in meta Tag by $_GET
and You are Done.
Upvotes: 1