Enable live video

I'm currently trying to embed a real-time video in real time, which will automatically play with the sound muted. I tried using the solution in this post , however it does not seem to work with live videos, since the xfbml.ready event does not seem to be triggered.

Has anyone figured out a way to incorporate sound into a live embedded video?

+2
facebook facebook-javascript-sdk
source share
1 answer

The trick is that you should not use autoplay and then turn on the sound, but rather embed the video and then run it using msg.instance.play() .

See the code below or use this link: http://shoepimper.com/fb.html

 <script> window.fbAsyncInit = function() { FB.init({ appId : '{your-app-id}', xfbml : true, version : 'v2.5' }); // Get Embedded Video Player API Instance FB.Event.subscribe('xfbml.ready', function(msg) { if (msg.type === 'video') { msg.instance.play(); } }); }; (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/GoSportsLive/videos/vb.1481996068797424/1779032592427102/" data-width="500" data-allowfullscreen="true"></div> 
0
source share

All Articles