How to automatically run embedded videos on Facebook?

This page shows how to create code to embed any video on Facebook to embed on external websites.

Is there a way to automatically start playback when the page loads?

+7
source share
8 answers

Unfortunately for you , Facebook’s rules prohibit auto-play of content (thank God).

I tried to track the actual political document, but it was drowned out in the SERPS noise of people saying it was banned on Facebook! You can find the questions that support this concept on https://stackoverflow.com/a/166339/ and WebApps .

StackOverflow is the official support channel for Facebook developers, so their users can learn more about the topic.

It is also possible that some whistling jQuery might fake a click, but facebook updates it so often that I doubt that any hack will last long.

The best answer is to use YouTube or another channel that allows you to share outside your network. Do not rely on a hacker solution for a network that is clearly not interested in collaborative video that goes beyond its own boundaries.

Users can easily change the privacy settings of their videos, and Facebook will probably try to disrupt the ability to embed their content if this becomes a popular task.

+6
source

For Youtube, add &autoplay=1 to the end of the URL used to auto-play the video. For example:

If the URL for the video:

 http://www.youtube.com/v/xxx 

Autoplay url:

 http://www.youtube.com/v/xxx&autoplay=1 

The above works for Youtube, but Facebook is a little different:

In the built-in part of the code for auto-playing video on your site, add the following parameter:

 <param name="autoplay" value="true"> 

This method also works on other sites, mainly those that use a Flash video player.

+3
source

The best way for me is to use the Facebook URL as follows: https://www.facebook.com/v2.3/plugins/video.php?allowfullscreen=true&autoplay=true&container_width=800&href=https%3A%2F%2Fwww.facebook .com% 2Fredbull% 2Fvideos% 2F10155801793140352% 2F & locale = en_US & sdk = joey

This is better than the embedded URL. The video is inserted into the viewing window, you can control autorun using the query string / parameter.

+3
source

As with the latest Facebook SDK today, you can automatically play the video by adding data-autoplay = "true" to the embed code div tag.

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

I just implemented this in my own project, but it works, but as of right now it will only play passively (in mute mode). This is similar to what you would see if you were scrolling through your news feed on Facebook. The user must manually disable the video.

Hope this helps.

+2
source

waitforclick

Specifies whether to auto-play the Flash object (false), if enabled. false does not work in profiles for security and esthetics reasons, except after calling AJAX. The default value is true.

https://developers.facebook.com/docs/reference/fbml/swf/

U need to change the example code from below to the facebook video as described in the link you provided.

Not tried, but maybe helps

considers

0
source

Since I don’t have a video identifier, I can’t test it, but adding the “play” or “autoplay” parameter may work:

 <object width="400" height="224" > <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="movie" value="http://www.facebook.com/v/xxx" /> <param name="autoplay" value="true" /> <embed src="http://www.facebook.com/v/xxx" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="224" autoplay="true"> </embed> </object> 
0
source

The answer here is a bit outdated, so just an updated answer can be seen, Facebook Documentation for all the details.

TL; DR:

Here's how embedding Facebook videos looks like this:

 <html> <head> <title>Your Website Title</title> </head> <body> <!-- Load Facebook SDK for JavaScript --> <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.6"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Your embedded video player code --> <div class="fb-video" data-href="https://www.facebook.com/facebook/videos/10153231379946729/" data-width="500" data-show-text="false"> <div class="fb-xfbml-parse-ignore"> <blockquote cite="https://www.facebook.com/facebook/videos/10153231379946729/"> <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> </div> </body> </html> 

The following html tag allows you to set auto play to true:

 <div class="fb-video" data-href="<video-post-url>" data-autoplay="true"> 

The default value for data-autoplay is of course false .

0
source

it doesn't matter what videos you embed. adding code

& auto play = 1

to the end of the URL of the video you embed, it should allow the delivery and allow the video to play automatically.

-4
source

All Articles