I’m trying to get the facebook video player instance in order to subscribe to different player events.
In the desktop browser, it just works fine and I’m able to get player instance on the xfbml.ready
function call but on mobile, it just won’t fire.
Here’s my code.
window.fbAsyncInit = function() {
// Get Embedded Video Player API Instance
var my_video_player;
FB.Event.subscribe('xfbml.ready', function(msg) {
alert("ready");
if (msg.type === 'video') {
my_video_player = msg.instance;
}
});
};
(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 = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
if anyone want to tryout the code it is here: http://milracle.github.io/fbPlayer.html
The same code was working a day ago and now it just stopped working in mobile browsers. Does anyone know about any changes made to the video player itself? I googled it but found nothing. I believe the Stack Overflow community can help as always!
2
Answers
This issue has been fixed by facebook developer team. review thread at: https://developers.facebook.com/bugs/338091156930372/?legacy_version=true
I am also looking for a solution to this issue – I am also pretty sure this has just stopped working recently – I can replicate the issue in chrome dev tools using the mobile device mode.