I know it seems impossible to get facebook videos embed code from YouTube, but here I will help you writing normal embed code for Facebook videos and on that we will get help from YouTube. Officially Facebook doesn’t provide embed code for videos hosted on their server, but we had shared ways to embed facebook videos on WordPress blog without writing any code and also shared firefox add-ons to download or embed facebook videos. But here we will get simple embed HTML code from YouTube and replace the embed URL in that code to get facebook videos on our blog.
[ad id=’15’ style=’margin:10px 0;’]
As we all know that we can get embed code for any YouTube video from the site itself. For example, I took the embed code of a video on YouTube by clicking on the “Embed” link below the YouTube video. The generated code was something like this,
HTML Embed code from YouTube
Here you can see, the YouTube video URL is written in two different places in the full code. There we need to replace the URL with something like “http://www.facebook.com/v/XXXXXXXXX”, here “XXXXXXXXX” is video ID of Facebook videos which can be find in the URL of the Facebook video. Once the video appears on your Facebook wall, you can click on the title of the video and open the video page. There you can see video_ID in the URL section. Example is shown below.
Now once you will replace the URL in the embed HTML code generated by YouTube, the embed code will look something like this,
YouTube embed code – Finally edited for Facebook Video Embed
Here “XXXXXXXXX” is Facebook Video ID.
That’s it. You just need to paste this code in HTML section of your blog or in HTML format of post to get that video in the post content.