diff --git a/assets/img/ios-27-switching-camera-distorted.jpg b/assets/img/ios-27-switching-camera-distorted.jpg new file mode 100644 index 0000000..5d1b2cf Binary files /dev/null and b/assets/img/ios-27-switching-camera-distorted.jpg differ diff --git a/assets/img/ios-27-switching-camera-expected.jpg b/assets/img/ios-27-switching-camera-expected.jpg new file mode 100644 index 0000000..e927e2e Binary files /dev/null and b/assets/img/ios-27-switching-camera-expected.jpg differ diff --git a/barcode-reader/web/camera/camera-preview-renders-incorrectly-ios.md b/barcode-reader/web/camera/camera-preview-renders-incorrectly-ios.md new file mode 100644 index 0000000..0b1e379 --- /dev/null +++ b/barcode-reader/web/camera/camera-preview-renders-incorrectly-ios.md @@ -0,0 +1,111 @@ +--- +layout: default-layout +title: Why does the camera preview render incorrectly on iOS 27? +keywords: iOS 27, camera, preview, distorted, video, switching camera, changing resolution, Safari, Chrome, Edge, Firefox, WebKit, Dynamsoft Camera Enhancer, Dynamsoft Barcode Reader, Dynamsoft MRZ Scanner +description: On iOS 27, switching cameras or changing resolution can make the live camera preview render distorted or fit its container incorrectly. Fixed in dynamsoft-barcode-reader-bundle 11.6.3200 and dynamsoft-capture-vision-bundle 3.6.3200; workarounds are available for earlier versions. +needAutoGenerateSidebar: false +--- + +# Why does the camera preview render incorrectly on iOS 27? + +## Applicable Products + +This article applies to: + +- Dynamsoft Barcode Reader (DBR) JavaScript SDK (`dynamsoft-barcode-reader-bundle`) 11.6.3000 and earlier +- Dynamsoft Capture Vision (DCV) JavaScript SDK (`dynamsoft-capture-vision-bundle`) 3.6.3000 and earlier + +## Summary + +On iOS 27, switching cameras or changing resolution can make the live camera preview render incorrectly. The exact behavior depends on the SDK version: + +| Version | Behavior | +|---|---| +| DBR 11.4 – 11.6.3000 (DCV 3.4 – 3.6.3000) | The preview renders distorted — squeezed or stretched instead of filling its container. Intermittent: the same switch can render correctly on one attempt and distorted on the next. | +| DBR 11.2 and earlier (DCV 3.2 and earlier) | The preview isn't distorted, but it no longer fits its container — shown at the wrong zoom or size and not extending to the borders. | + +It's reproducible on Safari, Chrome, Edge, and Firefox — all iOS browsers share WebKit's camera implementation, so we suspect the issue originates there rather than in any Dynamsoft SDK. It does not occur on iOS 26. + +> [!NOTE] +> Reported to Apple, but not confirmed as an Apple bug and still open as of iOS 27 RC. Details here may change if Apple ships a fix. + +
+
+ Camera video rendering correctly on iOS +
Expected
+
+
+ Camera video rendering distorted after switching cameras on iOS 27 +
Distorted after switching cameras
+
+
+ +## Resolution + +### Recommended: upgrade + +Upgrade to `dynamsoft-barcode-reader-bundle` **11.6.3200+** or `dynamsoft-capture-vision-bundle` **3.6.3200+**, which include a built-in workaround. + +### If you can't upgrade yet + +Both workarounds below are temporary and version-specific — neither replaces upgrading. + +**DBR 11.4 – 11.6.3000 (DCV 3.4 – 3.6.3000)** + +The distortion requires `object-fit: fill` on the video element plus an ancestor using `display: flex` with `flex: 0 0 auto`, so overriding `object-fit` with `cover` on the `