How to Embed Facebook Video

Step 1:

Prepare the link of the video that you want to embed to your page. If you have no idea on how to get the URL of the video, simply right click on the facebook video, then click Show Video URL. facebook show video url

Step 2:

Go to Facebook Developer Page for embedding videos. Note: You don't have to login your facebook account.

Step 3:

Fill up URL of video field using the link of the video that you want to embed. Then click Get Code. fill up embed video form

Step 4:

Take note of the Code generated and put them in the page where you want to embed the video.

Example

Here's the sample HTML with codes inserted to the page that I want to embed the video.
  1. <!DOCTYPE html>
  2.         <meta charset="utf-8">
  3.         <title>How to Embed Facebook Video</title>
  4.         <link rel="stylesheet" type="text/css" href="bootstrap4/css/bootstrap.min.css">
  5. </head>
  6. <div id="fb-root"></div>
  7. <script>(function(d, s, id) {
  8.         var js, fjs = d.getElementsByTagName(s)[0];
  9.         if (d.getElementById(id)) return;
  10.         js = d.createElement(s); js.id = id;
  11.         js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12';
  12.         fjs.parentNode.insertBefore(js, fjs);
  13. }(document, 'script', 'facebook-jssdk'));</script>
  14. <div class="container">
  15.         <h1 class="text-center" style="margin-top:30px;">Embed Facebook Video</h1>
  16.         <hr>
  17.         <div class="row justify-content-center">
  18.                 <div class="col-sm-6">
  19.                         <div class="fb-video" data-href="https://www.facebook.com/facebook/videos/10153231379946729/" data-width="500" data-show-text="false"><blockquote cite="https://www.facebook.com/facebook/videos/10153231379946729/" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/facebook/videos/10153231379946729/">How to Share With Just Friends</a><p>How to share with just friends.</p>Posted by <a href="https://www.facebook.com/facebook/">Facebook</a> on Friday, December 5, 2014</blockquote></div>
  20.                 </div>
  21.         </div>
  22. </div>
  23. </body>
  24. </html>
That ends this tutorial. Happy Coding :)

Add new comment