简体   繁体   中英

Facebook Like Button for a Facebook video

Today, i created an iframe-Tab on our Facebook Page as a landingpage. On this tab we display a video, implemented from Facebook.

Now i want to add the Facebook Like Button for this video on this page, i implement the code generated by the LIKE BUTTON Developer Page.

<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fvideo%2Fvideo.php%3Fv%3D345848348745&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:120px; height:21px;" allowTransparency="true"></iframe>

Now the button where displayed, but without a count. If i click on the like button the counter getting visible (displaying +1) and jumping back then (displaying no count).

Do you know, if i can use the like button directly for the Facebook URL? http://www.facebook.com/video/video.php?v=345848348745

Thank u!

See the below code for an example implementation of a LIKE button that works in all browsers.

HTML:

<iframe  id="IframeTemp" src="#"  scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:55px;" allowTransparency="true">
</iframe>

JavaScript:

<script type="text/javascript">
    var currenturl = document.URL + "&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=55";

    var url = "//www.facebook.com/plugins/like.php?href="+currenturl;
    document.getElementById("IframeTemp").src = url;
    var myIframe = parent.document.getElementById("IframeTemp");  

    // Setup the width and height 
    myIframe.src = url;  
</script>

Don't forget to keep the Javascript on the master page which is available in developer Facebook.

I had the same problem you did on a project I'm working on. I've found that you can "like" the url for the actual video file, in your case http://www.facebook.com/v/345848348745

however, the problem with this solution is that the likes will not aggregate onto the actual video page's url. They will be two separate "like' entities

This seems to be a limitation of the fb like functionality at the moment I'm afraid

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM