What do I need to add to the Facebook Page Plugin, showing the page posts, so that the videos in the posts will play? - facebook

I am trying to use the Facebook Page Plugin, https://developers.facebook.com/docs/plugins/page-plugin/, including the page posts. Any videos that appear in the posts do NOT play.
The website where I have added the plugin is hosted by Main Street sites. I added the JavaScript SDK code to the site options, global content, after body section.
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
I added the plugin code to the home page:
<div class="fb-page" data-href="https://www.facebook.com/MusicTogetherBR?fref=ts" data-hide-cover="false" data-show-facepile="false" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/MusicTogetherBR?fref=ts">Music Together of Bay Ridge</blockquote></div></div>
Has anyone else tried this and experienced the same issue? Is it possible to get the videos to play?
Thank you.

This appears to be a bug. I went ahead and filed one on your behalf. Here's the link - https://developers.facebook.com/bugs/994234910609982/. Please subscribe to the bug and we'll provide an update there.
UPDATE: This should now be fixed. Can you please check and let us know if it's not working correctly ?

Related

Specific Facebook page plugin doesn't work on mobile

I came across something strange; the Facebok Page Plugin doesn't load on mobile only if it's for a specific Facebook page.
My code:
<div id="fb-root"> </div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4&appId=1591121954498982";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-page" data-adapt-container-width="true" data-height="350" data-hide-cover="false" data-href="https://www.facebook.com/pages/סיפורי-פירות-Fruit-Story/410067012494711?fref=ts" data-show-facepile="true" data-show-posts="true" data-small-header="false"> </div>
Changing just this line:
data-href="https://www.facebook.com/pages/סיפורי-פירות-Fruit-Story/410067012494711?fref=ts"
to another page's URL such as:
data-href="https://www.facebook.com/CocaColaUnitedStates?fref=ts"
...makes the plugin load fine.
Is it because the page URL contains Hebrew? Is there a relevant page setting?
I set up a small demo page:
http://s-fruit.co.il/facebook-test.html
Found the cause!
This is an intentional (though peculiar) behavior of Facebook when dealing with age-restricted pages and guest users (not logged in, as it often happens on mobile browsers as most use the app).
Why not simply display a login prompt? Some paraphrased info? Who knows. At least the mystery is solved.
An official response can be found here:
https://developers.facebook.com/bugs/828224027247232/

Can't get the Facebook comment moderation to work

I have implemented the Facebook comments plugin to a page on my site. In addition to this I would like to be bale to moderate the comments. I followed the instructions on the Facebook developer section and implemented as described. I wanted to use the inline moderation tool rather than create an app. So I placed the following meta data.
<meta property="fb:admins" content="533551342"/>
Where the content is set to my Facebook profile ID.
I have then placed the script code as per Facebook developer instructions.
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=672941899483225&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Once that is in place, I added the comments section to the site using the code instructed.
<div class="fb-comments" data-href="http://www.microspot.com/case-studies/boat_design.htm" data-width="540" data-numposts="10" data-colorscheme="light"></div>
So with all this in place the comments section shows and works, but the moderate link does not appear next to the number of posts text (which is what should happen according to face books documentation).
The web page is http://www.microspot.com/case-studies/boat_design.htm
Thanks in advance.
It seems the issue was not with the code but with Facebook re-indexing my changes. There is a tool on the Facebook developer page for debugging and indexing your changes.
Any update you make to the Facebook code on your webpage, especially the meta data, you should always use the following debug tool.
https://developers.facebook.com/tools/debug/
Simply paste your webpage link (should be a live page not local) into the box and follow the instructions each time you make a change.
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=672941899483225&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

How to add facebook comments to my website page using facebook API?

With the new "comments edge" implementation, does somebody know if I can let people to add comments to my website page using my own "add comment" form?
According to documentation you can publish a comment to any object_id (and an object_id could be a website url I think).
Couldn't you just use the Comments Plugin (https://developers.facebook.com/docs/plugins/comments), or do you need to create something custom by all means?
After a research, is not possible to use an external form to add facebook comments to a page, so we are using a "mix" with the facebook comments plugin to submit a comment, and our display comments view to show them. You can check it here: http://www.gemsmoda.com/p44026-ref-55.html (down bellow)
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.8&appId='your-app-key'";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://stackoverflow.com/questions/19050121/how-can-i-moderate-facebook-comments-posted-in-my-website" data-numposts="5"></div>

Comments box acting unexpected

I am tring to implement the comments box into my website, providing the following code:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=204934639590323";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://my_web.com/" data-num-posts="2" data-width="500"></div>
When i post a message into the comments box, that message is not posted onto my wall. Also, when i logout from fb, that message dissapers. Hope to give me some ideas. Thanks.
If you logout of Facebook and then the comment disappears it seems a privacy configuration on your account, that's why when you become anonymous Facebook hides the comment.
Also, if the comment is not posted (despite you check you want this behavior on the comment box) maybe your app is in sandbox mode OR again you have specific configurations for this app.
To quickly have a better idea of what is going on you could ask someone else to comment.
Hope that helps.

Facebook comments, for each page

I installed facebook comments on my website. My website is a dynamic website and pages are like this www.example.com/page?id=54, www.example.com/page?id=67
If I post a comment in this page: www.site.com/page?id=54, it also appears in www.example.com/page?id=67. The comments are not unique for a page, but appear in every page. Why is that ?
It seems that FB ignores the ?query part of the URL when retrieving comments.
What you could do: use some form of URl rewriting, so that your URLs are in the form http://www.example.com/page/id/54/ or similar (i.e., appearing to not use the ?id=something query part). That way, the comments should load for each page separately.
Here is a solution that worked for me.
1- Copy this SDK from Facebook. Most probably you already did that.
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=114215202075258";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
2- Then this
<div class="fb-comments" data-href="http://example.com" data-width="470" data-num-posts="3"></div>
3- The the solution line. Paste these lines of JS at the end. Make sure you do everything in the similar order as I have. It will work, no matter you have a ? in your URL.
<script>
$(".fb-comments").attr("data-href", window.location.href);
</script>