I'd like to show zoom factors in my video app in the same way the iOS native app does. Opposed to the options shown in the iOS cam app, a call to AVCaptureDevice.virtualDeviceSwitchOverVideoZoomFactors returns factors starting at 1.0 for "full field of view". It looks like there is a device specific magic factor to map virtualDeviceSwitchOverVideoZoomFactors factors to options in the UI:
| device | options cam app | virtualDeviceSwitchOverVideoZoomFactors | magic factor |
|---|---|---|---|
| iPhone X | 1, 2 | (1), 1.799 | 1.11 |
| iPhone 11 Pro Max | 0.5, 1, 2 | (1), 2, 4 | 0.5 |
| iPhone 12 Pro Max | 0.5, 1, 2.5 | (1), 2, 5 | 0.5 |
Am I doing something wrong or do I need to hard code the magic factor in my app? I'd rather do not... Otherwise I need to run this through a maintenance cycle every time Apple releases some new angle / zoom option.