@aws-amplify/ui-react-liveness 3.4.1 → 3.4.2

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.
@@ -13,11 +13,11 @@ function useMediaStreamInVideo(stream) {
13
13
  if (isObject(videoRef.current)) {
14
14
  videoRef.current.srcObject = stream;
15
15
  }
16
- const { height: streamHeight, width: streamWidth } = stream
17
- .getTracks()[0]
18
- .getSettings();
19
- setVideoHeight(streamHeight);
20
- setVideoWidth(streamWidth);
16
+ const settings = stream.getTracks()?.[0]?.getSettings();
17
+ if (settings) {
18
+ setVideoHeight(settings.height);
19
+ setVideoWidth(settings.width);
20
+ }
21
21
  }
22
22
  return () => {
23
23
  if (stream) {
@@ -1,3 +1,3 @@
1
- const VERSION = '3.4.1';
1
+ const VERSION = '3.4.2';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -1055,7 +1055,7 @@ function createRequestStreamGenerator(stream) {
1055
1055
  };
1056
1056
  }
1057
1057
 
1058
- const VERSION = '3.4.1';
1058
+ const VERSION = '3.4.2';
1059
1059
 
1060
1060
  const BASE_USER_AGENT = `ui-react-liveness/${VERSION}`;
1061
1061
  const getLivenessUserAgent = () => {
@@ -2706,11 +2706,11 @@ function useMediaStreamInVideo(stream) {
2706
2706
  if (ui.isObject(videoRef.current)) {
2707
2707
  videoRef.current.srcObject = stream;
2708
2708
  }
2709
- const { height: streamHeight, width: streamWidth } = stream
2710
- .getTracks()[0]
2711
- .getSettings();
2712
- setVideoHeight(streamHeight);
2713
- setVideoWidth(streamWidth);
2709
+ const settings = stream.getTracks()?.[0]?.getSettings();
2710
+ if (settings) {
2711
+ setVideoHeight(settings.height);
2712
+ setVideoWidth(settings.width);
2713
+ }
2714
2714
  }
2715
2715
  return () => {
2716
2716
  if (stream) {
@@ -1 +1 @@
1
- export declare const VERSION = "3.4.1";
1
+ export declare const VERSION = "3.4.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-liveness",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {