@stream-io/video-react-native-sdk 0.0.1-alpha.404 → 0.0.1-alpha.406

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.1-alpha.406](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.405...@stream-io/video-react-native-sdk-0.0.1-alpha.406) (2023-08-31)
6
+
7
+
8
+
9
+ ## [0.0.1-alpha.405](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.404...@stream-io/video-react-native-sdk-0.0.1-alpha.405) (2023-08-31)
10
+
11
+
12
+
5
13
  ## [0.0.1-alpha.404](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.403...@stream-io/video-react-native-sdk-0.0.1-alpha.404) (2023-08-31)
6
14
 
7
15
 
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * This hook is meant to be used in Lobby view or equivalent.
3
+ * It will cleanup the media stream on unmount if call is not meant to be joined.
3
4
  */
4
5
  export declare const useCallMediaStreamCleanup: () => void;
@@ -6,6 +6,7 @@ const video_react_bindings_1 = require("@stream-io/video-react-bindings");
6
6
  const react_1 = require("react");
7
7
  /**
8
8
  * This hook is meant to be used in Lobby view or equivalent.
9
+ * It will cleanup the media stream on unmount if call is not meant to be joined.
9
10
  */
10
11
  const useCallMediaStreamCleanup = () => {
11
12
  const call = (0, video_react_bindings_1.useCall)();
@@ -14,10 +15,11 @@ const useCallMediaStreamCleanup = () => {
14
15
  callRef.current = call;
15
16
  (0, react_1.useEffect)(() => {
16
17
  return () => {
17
- if (!(callRef.current?.state.callingState === video_client_1.CallingState.JOINED ||
18
- callRef.current?.state.callingState === video_client_1.CallingState.JOINING)) {
18
+ const mediaStream = callRef.current?.camera.state.mediaStream;
19
+ if (mediaStream &&
20
+ !(callRef.current?.state.callingState === video_client_1.CallingState.JOINED ||
21
+ callRef.current?.state.callingState === video_client_1.CallingState.JOINING)) {
19
22
  // we cleanup media stream only if call is not joined or joining
20
- const mediaStream = callRef.current?.camera.state.mediaStream;
21
23
  (0, video_client_1.disposeOfMediaStream)(mediaStream);
22
24
  }
23
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useCallMediaStreamCleanup.js","sourceRoot":"","sources":["../../../../src/hooks/internal/useCallMediaStreamCleanup.ts"],"names":[],"mappings":";;;AACA,0DAA6E;AAC7E,0EAA0D;AAC1D,iCAA0C;AAE1C;;GAEG;AACI,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,IAAI,GAAG,IAAA,8BAAO,GAAE,CAAC;IACvB,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAEvB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IACE,CAAC,CACC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,2BAAY,CAAC,MAAM;gBAC3D,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,2BAAY,CAAC,OAAO,CAC7D,EACD;gBACA,gEAAgE;gBAChE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,WAErC,CAAC;gBACd,IAAA,mCAAoB,EAAC,WAAW,CAAC,CAAC;aACnC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAtBW,QAAA,yBAAyB,6BAsBpC"}
1
+ {"version":3,"file":"useCallMediaStreamCleanup.js","sourceRoot":"","sources":["../../../../src/hooks/internal/useCallMediaStreamCleanup.ts"],"names":[],"mappings":";;;AACA,0DAA6E;AAC7E,0EAA0D;AAC1D,iCAA0C;AAE1C;;;GAGG;AACI,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,IAAI,GAAG,IAAA,8BAAO,GAAE,CAAC;IACvB,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAEvB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,WAErC,CAAC;YACd,IACE,WAAW;gBACX,CAAC,CACC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,2BAAY,CAAC,MAAM;oBAC3D,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,2BAAY,CAAC,OAAO,CAC7D,EACD;gBACA,gEAAgE;gBAChE,IAAA,mCAAoB,EAAC,WAAW,CAAC,CAAC;aACnC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAvBW,QAAA,yBAAyB,6BAuBpC"}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.1-alpha.404";
1
+ export declare const version = "0.0.1-alpha.406";
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '0.0.1-alpha.404';
4
+ exports.version = '0.0.1-alpha.406';
5
5
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.0.1-alpha.404",
3
+ "version": "0.0.1-alpha.406",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "text-encoding-polyfill": "0.6.7"
39
39
  },
40
40
  "peerDependencies": {
41
- "@notifee/react-native": ">=7.7.0",
41
+ "@notifee/react-native": ">=7.8.0",
42
42
  "@react-native-community/netinfo": ">=9.0.0",
43
43
  "@react-native-firebase/app": ">=17.5.0",
44
44
  "@react-native-firebase/messaging": ">=17.5.0",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@babel/preset-typescript": "^7.21.5",
72
- "@notifee/react-native": "7.7.1",
72
+ "@notifee/react-native": "7.8.0",
73
73
  "@react-native-community/eslint-config": "^3.2.0",
74
74
  "@react-native-community/netinfo": "9.3.9",
75
75
  "@react-native-firebase/app": "17.5.0",
@@ -5,6 +5,7 @@ import { useEffect, useRef } from 'react';
5
5
 
6
6
  /**
7
7
  * This hook is meant to be used in Lobby view or equivalent.
8
+ * It will cleanup the media stream on unmount if call is not meant to be joined.
8
9
  */
9
10
  export const useCallMediaStreamCleanup = () => {
10
11
  const call = useCall();
@@ -14,16 +15,17 @@ export const useCallMediaStreamCleanup = () => {
14
15
 
15
16
  useEffect(() => {
16
17
  return () => {
18
+ const mediaStream = callRef.current?.camera.state.mediaStream as
19
+ | MediaStream
20
+ | undefined;
17
21
  if (
22
+ mediaStream &&
18
23
  !(
19
24
  callRef.current?.state.callingState === CallingState.JOINED ||
20
25
  callRef.current?.state.callingState === CallingState.JOINING
21
26
  )
22
27
  ) {
23
28
  // we cleanup media stream only if call is not joined or joining
24
- const mediaStream = callRef.current?.camera.state.mediaStream as
25
- | MediaStream
26
- | undefined;
27
29
  disposeOfMediaStream(mediaStream);
28
30
  }
29
31
  };