@capgo/camera-preview 8.11.4 → 8.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/web.js +18 -15
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +18 -15
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +18 -15
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapgoCameraPreviewPlugin/Plugin.swift +1 -1
- package/package.json +5 -7
package/dist/plugin.cjs.js
CHANGED
|
@@ -107,7 +107,7 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
107
107
|
try {
|
|
108
108
|
stream === null || stream === void 0 ? void 0 : stream.getTracks().forEach((t) => t.stop());
|
|
109
109
|
}
|
|
110
|
-
catch (
|
|
110
|
+
catch (_c) {
|
|
111
111
|
/* no-op */
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -217,16 +217,13 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
217
217
|
const leftInset = parseInset(styles.paddingLeft);
|
|
218
218
|
const rightInset = parseInset(styles.paddingRight);
|
|
219
219
|
probe.remove();
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
else {
|
|
228
|
-
top = Math.max(topInset, leftInset, rightInset);
|
|
229
|
-
}
|
|
220
|
+
const top = orientation === 1
|
|
221
|
+
? topInset
|
|
222
|
+
: orientation === 2
|
|
223
|
+
? leftInset > 0
|
|
224
|
+
? leftInset
|
|
225
|
+
: rightInset
|
|
226
|
+
: Math.max(topInset, leftInset, rightInset);
|
|
230
227
|
return { orientation, top };
|
|
231
228
|
}
|
|
232
229
|
async getZoomButtonValues() {
|
|
@@ -422,7 +419,7 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
422
419
|
}
|
|
423
420
|
this.videoElement.style.setProperty('top', `${y}px`, 'important');
|
|
424
421
|
// Force a style recalculation
|
|
425
|
-
this.videoElement.offsetHeight;
|
|
422
|
+
void this.videoElement.offsetHeight;
|
|
426
423
|
console.log('Positioning video:', {
|
|
427
424
|
positioning,
|
|
428
425
|
viewportHeight: window.innerHeight,
|
|
@@ -906,7 +903,9 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
906
903
|
await video.play();
|
|
907
904
|
}
|
|
908
905
|
catch (error) {
|
|
909
|
-
|
|
906
|
+
const err = new Error(`Failed to flip camera: ${String(error)}`);
|
|
907
|
+
err.cause = error;
|
|
908
|
+
throw err;
|
|
910
909
|
}
|
|
911
910
|
}
|
|
912
911
|
async setOpacity(_options) {
|
|
@@ -1097,7 +1096,9 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
1097
1096
|
});
|
|
1098
1097
|
}
|
|
1099
1098
|
catch (error) {
|
|
1100
|
-
|
|
1099
|
+
const err = new Error(`Failed to set zoom: ${String(error)}`);
|
|
1100
|
+
err.cause = error;
|
|
1101
|
+
throw err;
|
|
1101
1102
|
}
|
|
1102
1103
|
}
|
|
1103
1104
|
async getFlashMode() {
|
|
@@ -1143,7 +1144,9 @@ class CameraPreviewWeb extends core.WebPlugin {
|
|
|
1143
1144
|
await video.play();
|
|
1144
1145
|
}
|
|
1145
1146
|
catch (error) {
|
|
1146
|
-
|
|
1147
|
+
const err = new Error(`Failed to swap to device ${options.deviceId}: ${String(error)}`);
|
|
1148
|
+
err.cause = error;
|
|
1149
|
+
throw err;
|
|
1147
1150
|
}
|
|
1148
1151
|
}
|
|
1149
1152
|
async getAspectRatio() {
|