How to embed facebook video?

10,415

Solution 1

I know this is an old post. But this code is the answer. For more information look here.

<!-- replace {facebook-video-url} with the correct url-->
<iframe 
  src="https://www.facebook.com/plugins/video.php?href={facebook-video-url}&show_text=0&width=560"
  width="560" height="315" 
  style="border:none;overflow:hidden" 
  scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"
></iframe>
<!--example given-->
<iframe 
  src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FPlayStation%2Fvideos%2F10155554431506803%2F&show_text=0&width=560"
  width="560" height="315" 
  style="border:none;overflow:hidden" 
  scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"
></iframe>

Solution 2

When you press recieve code , Click the tab for the Iframe. This works better for me

It would look something like this:

<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Ffacebook%2Fvideos%2F10153231379946729%2F&width=500&show_text=false&height=281&appId" 
        width="500" height="281" 
        style="border:none;overflow:hidden" 
        scrolling="no" frameborder="0" allowTransparency="true"
></iframe>
Share:
10,415
ipegasus
Author by

ipegasus

Updated on June 04, 2022

Comments

  • ipegasus
    ipegasus almost 2 years

    I would like to know how to embed a facebook video?

    I followed instructions at:

    https://developers.facebook.com/docs/plugins/embedded-video-player

    But it does not work. This is the source code:

    <html>
      <head>
        <title>My Website</title>
      </head>
      <body>
        <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>
        <h1>My Video Player</h1>
        <div class="fb-video"
        data-href="https://www.facebook.com/FacebookDevelopers/posts/10151471074398553"
        data-width="500"
        data-allowfullscreen="true"></div>
      </body>
    </html>
    

    Thanks in advance