I embedded a video from facebook in my website and i set it in autoplay, but the sound is muted unless you click the volume and it will play the sound.
Scroll down and tap Settings & Privacy then tap Settings. Scroll down to Preferences and tap Media. Below Autoplay, tap or next to Videos Start With Sound to turn automatic sound on or off.
To share things from Facebook on your website, you can embed a Public post or video. When you embed a post that contains a video, the message that was posted with the video will be included. When you embed a video, only the video player will be included.
Upload video to Creator Studio. Select Allow embedding under the Publishing Options tab.
Just add &mute=0
to the iframe url.
<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2F.....&height=280&mute=0" width="500" height="280" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"></iframe>
You can actually use Facebook Embedded Video Player API to control your embedded video in your website, such as unmuting it on page load.
Take note that this doesn't work on embedding videos thru <iframe>
tag. Use the <div>
tag as mentioned in the link (or see sample below).
Here's a sample script I got from the link, with insertion of my_video_player.unmute()
on xfbml.ready
event. Make sure you provide the proper FB appId
.
<html>
<head>
<title>Your Website Title</title>
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '{your-app-id}',
xfbml : true,
version : 'v2.5'
});
// Get Embedded Video Player API Instance
var my_video_player;
FB.Event.subscribe('xfbml.ready', function(msg) {
if (msg.type === 'video') {
my_video_player = msg.instance;
my_video_player.unmute();
}
});
};
(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";
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-autoplay="true"
data-allowfullscreen="true"></div>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With