4

I am having a strange issue with Facebook's videos. I can start videos perfectly fine, but if I skip from, say 0.10 to 0.30, the video would freeze: it just won't continue playing. I have not experienced the issue on other video platforms such as YouTube, and my

I have googled the issue, but only found marginally related issues. I tried the following:

  • Tried other browsers, but all have this issue. (Chrome, Edge, Firefox.)
  • Disabled all plug-ins for the browser
  • Disabled hardware-acceleration for the browser
  • Re-installed the browser
  • Re-installed the OS (Windows 10 Pro, 64 bit): clean install, no upgrade

As you can see, I am very annoyed by this, even so much that I formatted my complete set-up and even that did not work. Because it is across browsers, I wonder if it is a Windows issue, a Windows update issue, or a Facebook issue. I haven't found anyone with the exact same issue, so I am lost. Any help?

Update: As of today, 25 June '17, the problem has disappeared for me.

9
  • 2
    I have the same bug as you. I found it interesting that I can make it work if I log out from facebook. To test you can open a public video url in a browser window where you aren't logged in (or incognito). Still haven't found a fix for the situation. Maybe it's a partial rollout from facebook. – Marius P. Jun 2 '17 at 18:29
  • have you tried clearing browser cache? before logging into facbook? and i mean like all the cache – Nalaurien Jun 8 '17 at 5:28
  • 1
    We did. It has nothing to do with the cache. It happens on any browser/PC we login with our users. – Marius P. Jun 8 '17 at 8:17
  • You could try to install a good codecs pack. My favorite is the K-Lite Codec Pack. – harrymc Jun 8 '17 at 13:29
  • 2
    @harrymc How could a codec problem be fixed if I just log out out of facebook and then open the same video without being logged in? Like I said, I tried on different machines, including Mac. So a codec can be rulled out. – Marius P. Jun 9 '17 at 11:22
5
+50

After some hours of debugging I found the culprit. It seems it was indeed partial rollout/AB test from facebook.

More precisely it was a flag called disableDuplicatePlayingRequest from VideoPlayerExperiments which gets loaded in the page source for your profile. Having it set to true requires you to pause the video before changing time, otherwise the video will freeze/hang.

Now as for the solution, there is no simple one. It seems to be used in closures so no easy way to change it. At least from what I saw/tested.

Only way I was able to bypass it was to replace the https://www.facebook.com/rsrc.php/v3iTQQ4/yd/l/fb_LT/JTeC8QI2Wlf.js (later edit: the script name/location changes often, I've added a tutorial to find the right one) script from facebook and load a customised version of the script with the help of an extension that bypasses the check from the file: if (c('VideoPlayerExperiments').disableDuplicatePlayingRequest && this.isState('playing')) return;

If anyone is interested in the extension, it's called Resource Override, but it's not that straight forward to use. You need a server to host the modified js file and a few Header rules to bypass CORS and CSP.

P.S. I created a community question here in order to get some answers from Facebook. Anyone can help by voting (or on mobile liking) the question.

P.S.2: Ok, so to actually fix this issue, you need to be using Chrome and follow the next steps:

  1. Go on FB and login. Search all the js sources for the flag disableDuplicatePlayingRequest. If you don't know how to do that, you can use this tutorial

  2. After you found the file that contains it, use the {} button (Pretty Print) and then copy the whole contents from the file to a text editor. Go to the line that has something like if (c('VideoPlayerExperiments').disableDuplicatePlayingRequest && this.isState('playing')) return; and remove or comment it. You now need to save this file and upload it to a server. I can't share my file since FB might consider it a breach of terms, so you'll have to do this on your own. Remember the public access url for the file.

  3. Install the Resource Override extension from the chrome store

  4. Open the extension's options. In the Tab URL enter *facebook.com*

  5. Add a change headers rule. In the For: enter https://www.facebook.com*. Now go into Edit headers. We will only work with response headers, so be sure to only use the second section. Add 2 set header rules for Content-Security-Policy and X-Content-Security-Policy. Now we need to add your server to the existing policy that FB uses. To do that go back to the facebook page and into the Dev Console > Network tab. Select one of the .js file requests. In the response headers you will see content-security-policy. Copy the whole thing after : to a text editor. It should start with default-src.... Now find blob:;script-src and after it add the domain that you use to host your js file. For example xyz.com or *.xyz.com (if you use a subdomain). Be sure to leave spaces before and after it so it doesn't affect the existing string of policies. Now use this new line and put it in the 2 value fields from the set header fields from the extension. They should both be identical. Now we need one more set header rule for Access-Control-Allow-Origin with a value of *. Click on close to go back to the main menu.

  6. Add one more change headers rule. This time we'll use it for your domain to be sure you have the right headers there as well. In the For: field enter the exact link that your modified file is accessible on the net. Preferable https. Using http or a local file might cause problems. Now go into the change headers section of the rule. We will use here the response section as well. In the presets make sure to select the Allow outside content option in order to have it auto add 2 rules for you. After those 2, we need one more set header rule for Access-Control-Allow-Origin with a value of https://www.facebook.com. Not click close and get back to the main menu.

  7. The last step is to actually replace the FB js file with your modified file. To do that add a rule for URL -> URL. In the From: add the file from step (1). As an extra note, this link will change periodically because facebook tends to update it every 1-3 days. You will need to change it as well when you notice videos will start to freeze again. You can follow step (1) to get the new link for it. Now in the To: field you need to put your link to the modified file. One last thing is to check that all these 3 rules are set to ON. That's it, videos should work again as they once did.

P.S.3: You can find the saved extension rules here. You need to replace the xyz.co and https://xyz.co/modified.js names with your own. They each appear 2 times. After that, make sure that the file link that contains the disableDuplicatePlayingRequest is correct.

11
  • Very interesting find, thanks for debugging! Did you report these findings to Facebook? – Bram Vanroy Jun 18 '17 at 14:06
  • I submitted a bug report just now. The last bug report on this topic took 10 days to get a generic answer from them. I have little faith that this one will do anything to actually change that flag for my profile. – Marius P. Jun 18 '17 at 14:20
  • Could you give a link to the bug report? Then I can +1 it. I'm happy the cause is at least found. I'll accept and start a small bounty to award you for your efforts. – Bram Vanroy Jun 18 '17 at 14:22
  • 1
    The link to your community question has disappeared. Was it removed/marked as solved? Because for me the problem has disappeared. – Bram Vanroy Jun 25 '17 at 9:33
  • 1
    @BramVanroy I can still access the link, but only if I am logged in. Meaning that FB probably made the question hidden. And I checked and they removed the disableDuplicatePlayingRequest flag from my profile as well, so now I don't need the fix either. This means that they probably read the community unhappiness and decided to remove the a/b test or whatever it was. – Marius P. Jun 25 '17 at 17:23
1

I had the same issue like yours but for me, even YouTube videos would stop playing midway.
To solve this i first installed VirtualBox and then Ubuntu 16.04. After installing and setting it up, I ran tcpdump (while watching a video on YouTube) and opened the .pcap file in WireShark.
Inspecting the packets, I found that my NIC was midway dropping packets for some weird reason even though the driver for the NIC was up to date.
But just to try it out, I reinstalled the driver and set up my network interface again.
I guess somehow it worked cause I haven't had that issue ever since.
Might wanna try it out!

1
  • I wish that was the case here. I tried with different PCs, Macbooks, networks, ISPs and several other factors. Same thing everywhere. It works when I am not logged in, but fails after I log in. All my tests point to the facebook JS files that get loaded when I am logged in as the probable culprits. I already spent some time debugging what exactly happens, but their code minimization makes the whole thing take more time than I have had up until now. – Marius P. Jun 13 '17 at 9:15
0

I don't think you've factored out enough issues in trying to to isolate this further. I've seen similar things in the past. Some other things to look at:

  • it's possible that a proxy server upstream may be causing this. Nowadays, there's a lot more caching then you'd expect. I know of heaps of smaller companies using stuff like memcache, nginx, and squid; other companies using more expensive and integrated Proxy/WAN Acceleration solutions like BlueCoat and Riverbed; major IT companies using WAN based caching solutions such as Akamai. That's really just the tip of the iceberg... When configured and functioning well they're completely transparent and can help network performance drastically. However, when they aren't working quite so well you can end up seeing really weird stuff that is extremely difficult to diagnose such as this. The only way to figure out whether it comes down to a proxy server is to try changing your proxy server, re-configuring it or trying to not use one at all. If this is within your local network this is easy to fix. If it's outside of your network it's a completely different issue altogether. I used to work with firms where we were pushing massive track across international networks but we still struggled to get help in diagnosing let alone overcoming issues such as this
  • it could also be a network configuration or performance issue somewhere. I often switch networks from time to time which means I know first hand what you're dealing with. On certain networks the video won't even buffer, while others don't allow me to move the time marker alone, etc... The only way I can deal with it is by downloading videos beforehand prior to playing it via VLC (plenty of tools out there such as browser extensions and command line utilities such as youtube-dl). This leads me to my next point. Ideally, an organisation should have multiple backup connections or alternate ISP's (with separate backbones) in case you have to deal with something like this but if you just want to test I figure you could get away with simply testing with a 3G/4G connection to see whether it's consistent behaviour across both connections (or try bringing a system home to check whether the problem still exists). I'd also be trying to figure out whether it was perhaps linked to Facebook itself. For instance, is it limited to bigger videos, smaller videos, lower quality videos, higher quality videos, videos that are likely to be stored in a particular data centre, etc... To diagnose this run a packet tracer and then run a traceroute on the IP address to figure out the path. Use whois information to get information regarding geographical area and narrow it down to a particular data centre. If that's too hard download the video to get the URL of the host and then run a whois on this to narrow down the geographical location and data centre. Another way to see whether it is network related is to try via a VPN such as the Tor network (try the Tor browser pack)

https://www.torproject.org/download/download-easy.html.en

  • one thing you'll need to note, is that if you've ever needed to diagnose a problem such as this, it can be difficult to get in contact with someone at a firm such as Facebook via the normal support lines. It'll be easier if you know someone who knows someone, etc... That way you can bypass front line support who can sometimes be contractors who don't know much more then what they're told and can't really do all that much because that's not their job
  • it can be partly down to caching but in reality I think that sort of bundles itself in with the whole performance aspect nature of the problem
  • I've also seen this type of problem crop up when dealing with sub-par hardware. For instance, I know that using one an Atom based netbook with LinkedIn is virtually unseable because it's so heavily dependent on JavaScript code which is executed client side. The same performance issue exists across video sites as well (can't buffer or else move the time marker). This issue does not exist on anything above an Core I3 based processor though... That said, I see you're using Windows 10 which means it's unlikely that you're IT budget is overly constrained
  • since it's clearly possible that it could be down to raw performance I wouldn't rule issues regarding software drivers, Operating System, codecs, and software configuration as well. I'd try to run it as close as I could bare (software and hardware wise) which I've seen you have tried but I'd also be also be looking at whether or not there are other better optimised or updated drivers out there, ways to boost Operating System performance and so on... I'd also try fiddling around with the hardware and also attempting to cannibalise parts from elsewhere within the network to see whether that changes things
  • if it comes do public versus private profile I think you may be ruling things out a bit too early. My guess is that the code to load up a private page versus a public page is different (for personalisation reasons). This could lead to the slightly performance discrepancy. Look through the code and the website. Notice how much of it is dependent on JavaScript. Could be somewhat similar to my LinkedIn issue. My guess is that it's a combination of issues including the above points (if you want to debug things further open up a browser developer debugging tool (Dragonfly in Opera is a good example). It will give you the load times for all elements as well as the relative size and what code is actually being loaded as well)
2
  • 1) I tried on completely different networks, including work/home/mobile data 2) It could not be a network issue because if I just log out of my fb account, all public videos work perfectly (same videos that don't work if I am logged in) 3) I already submitted a bug report and unfortunately I don't know anyone working there 4) I emptied everything in the browser cache, same results, plus reason 2. and I tested on different machines 5) Hardware is not a problem because reason 2. and I tested with i7 6) We also tested on vanilla operating systems (Windows and Mac) and it didn't work. – Marius P. Jun 9 '17 at 11:35
  • Added some more stuff to explain the possible discrepancy – dtbnguyen Jun 9 '17 at 13:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.