1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 How to embed Facebook Videos?

Discussion in 'Troubleshooting and Problems' started by farang, Apr 17, 2015.

  1. farang

    farang Well-Known Member

    Embedding Facebook Videos doesn't seem to work.

    This is an example code that facebook suggests for sharing a video.

    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/sv_SE/sdk.js#xfbml=1&version=v2.3";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-post" data-href="https://www.facebook.com/Meetville/videos/1008048852591083/" data-width="500"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/Meetville/videos/1008048852591083/"><p>Homemade OlympicsMany thanks to R&#xe9;mi GAILLARD!</p>Posted by <a href="https://www.facebook.com/Meetville">Meetville</a> on <a href="https://www.facebook.com/Meetville/videos/1008048852591083/">den 14 april 2015</a></blockquote></div></div>
    Embedding the URL for video is https://www.facebook.com/Meetville/videos/1008048852591083/ doesn't auto embed as well.

    So if I need to alter anything to make auto embedding Facebook videos work, please provide an example for me. Thanks.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You just need to add this to Match URLs for the Facebook media bb code site.

    Code:
    facebook.com/*/videos/{$id:digits}
     
    farang and Martok like this.
  3. Martok

    Martok Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    Robert F Schmitz and Martok like this.
  5. Bionic Rooster

    Bionic Rooster Well-Known Member

    optrex likes this.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    As do the match URLs I posted above.
     
    Bionic Rooster likes this.
  7. Martok

    Martok Well-Known Member

    Although I use that add-on and would recommend it to members who want to add a range of BB Code media sites, if the OP only wants to embed Facebook videos then the amendment that Brogan suggested is sufficient and saves installing an add-on that adds a lot of stuff that may not be required.
     
    m3commish and Bionic Rooster like this.
  8. farang

    farang Well-Known Member

    Thank You :D
     
  9. Oleg-Sentia

    Oleg-Sentia Member

    Sorry it's not working.
    How I have to change HTML-code for embedding? I seems this one is old
    Code:
    <div class="fb-video" data-href="https://www.facebook.com/video.php?v={$id}" data-width="500"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/video.php?v={$id}">https://www.facebook.com/video.php?v={$id}</a></div></div>
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    This is the default embed code we are using now:
    Code:
    <div class="fb-video" data-href="https://www.facebook.com/video.php?v={$id}" data-width="500"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/video.php?v={$id}">https://www.facebook.com/video.php?v={$id}</a></div></div>
     
  11. Oleg-Sentia

    Oleg-Sentia Member

    Once again it is not working :(
    On the first picture is visible run time string
    Second picture is a result, the blank place instead of video.
    Problem appears when Facebook has changed format for video.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      220.7 KB
      Views:
      8
    • 2.JPG
      2.JPG
      File size:
      255.9 KB
      Views:
      8
  12. Mike

    Mike XenForo Developer Staff Member

    We'd really need a specific URL where it isn't working to give a more specific reason.
     
  13. Oleg-Sentia

    Oleg-Sentia Member

  14. Mike

    Mike XenForo Developer Staff Member

    The match URLs are:
    Code:
    facebook.com/*video.php?v={$id:digits}
    facebook.com/*photo.php?v={$id:digits}
    facebook.com/*/videos/{$id:digits}
    But I think you just missed the first one because the videos are attempting to be embedded.

    I think this might be a Facebook issue of some sort though, because the Facebook recommend feature at the bottom isn't working. I thought it might be language related, but it worked correctly locally in Russian. The only other thing I could think of is either a temporary Facebook issue or some limitation regarding your domain specifically.
     
  15. Oleg-Sentia

    Oleg-Sentia Member

    Hi, problem was at the page Integration with facebook. There was invalid app ID:(
     

Share This Page