How to embed facebook video in mobile friendly websites

Well, in this post I want to talk about how you can embed a facebook video on a mobile friendly websites. By mobile friendly websites I mean a website when you visit with a mobile it shows you the contents in a slightly different way. If you work with website coding and stuff then you'll definitely know what I'm talking about.

Any way coming to the main point. Recently I've noticed that when you try to get facebook embed code, it gives you an iframe which looks like this.

<iframe src="" height="315" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

Note: If you just copy the link from the iframe and paste in the addressbar then it will not work. So first you'll need to get the actual link from it by changing a bit.
%3A = :
%2F = /
So now we know that the actual link is

And let's now talk about the problem, when you give a certain width and height to an iframe it gets kind of difficult for mobile sites. So instead of making iframe you can use automatic script which will sort all the problems. I mean when you use the script it will make it small for mobile sites and will make bigger for desktop sites. Let's see the script then.

<div id="fb-root">
<script>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); = id;  js.src = "//";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-video" data-allowfullscreen="1" data-href="">

Now you can just copy the script above and paste into your site and make sure you change the link to your own. The video below is an example of the script, and if you don't see the video then that means video might be deleted.



  1. Hey, thank you so much for this tip! I've been wondering if this is possible for a while! Much appreciated :)

  2. Video is playing with black screen and Sound

  3. It gives additionally top of the line innovation to its NATO-partners, and gives them section rights on (or under) its key Greenland region, while giving them military insight. danmark


Newly posted:
Reason why rich getting richer and poor getting poorer