3 ms·
Looking at the videos, it looks like the camera opens when the main view is swiped to the right. And you can see a ~300ms delay between when he swipes down and
by jhgg 7y ago
Looking at the videos, it looks like the camera opens when the main view is swiped to the right. And you can see a ~300ms delay between when he swipes down and when the camera starts. This makes sense, because the way you open the story feature on FB is to swipe right. It's a good UX feature to start booting the camera as soon as you initiate the gesture, rather than when you've fully navigated so the camera is ready when you've finished your swipe.
Their layering system also pushes the view slightly to the right to create a perspective effect when it transitions back to the app from viewing an image.
Of course, this triggers the component that thinks the app is starting to pan to the right - and starts the camera and renders to the view behind the main view.
This seems totally plausible to be a bug - and I'm not sure why other commenters on HN aren't bringing this up.
Their app is fairly complicated, and it's totally reasonable that the team that worked on the story feature assumed that the only thing that would cause the view to move right was a user gesture. However, it looks like their layering system also caused it to move right as part of a perspective transition. This sounds like a bug to me.
If you really wanted to keep the camera open in the background, there are other ways to do so, such as literally not rendering the image to a visible framebuffer upon initiating the AVCaptureSession. iOS does not require you to attach a AVCaptureVideoPreviewLayer to the capture session - and you could very easily just take those frames and process them without ever showing a preview to the user.
The bug is not that they were capturing in the background, but that the perspective transform of the main view caused the view behind it (for the story camera feature) to think the user was swiping the main view to the right and to start up the camera to make sure it's ready asap. Running the camera in the background is actually pretty expensive - you don't want to suck power doing so. As much as facebook wants your data, it also wants you to regularly interact with the app. If users think the app is draining battery too fast - they'll use it less throughout the day to preserve battery life. Making sure it isn't a power suck is important to their core business.
- coldcode 7y agoI have heard that facebook's app delivery pipeline is automated (so that they could release in a day if they wish) but also that they dogfood their apps with employees. So not sure how such an obvious bug us released. Either their employees don't use the app or their 100% automation is pathetically bad.
- kelnos 7y agoOr they knew about the bug, but considered it just a visual glitch (not considering people might get upset about privacy implications), and didn't prioritize fixing it.