@stream-io/video-react-native-sdk 1.9.2 → 1.9.4

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,19 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.9.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.3...@stream-io/video-react-native-sdk-1.9.4) (2025-01-20)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/video-client` updated to version `1.15.2`
10
+ * `@stream-io/video-react-bindings` updated to version `1.4.2`
11
+ ## [1.9.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.2...@stream-io/video-react-native-sdk-1.9.3) (2025-01-20)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * ios 18 pip support ([#1646](https://github.com/GetStream/stream-video-js/issues/1646)) ([242bd1f](https://github.com/GetStream/stream-video-js/commit/242bd1fe08381805a24cc8d17671dd009b79cb09)), closes [#1647](https://github.com/GetStream/stream-video-js/issues/1647)
17
+
5
18
  ## [1.9.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.1...@stream-io/video-react-native-sdk-1.9.2) (2025-01-17)
6
19
 
7
20
 
@@ -58,7 +58,7 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) : Reac
58
58
  }
59
59
  // NOTE: workaround - on PiP mode, android goes to "paused but can render" state
60
60
  // RN pauses rendering in paused mode, so we instruct it to resume here
61
- activity.reactDelegate?.onHostResume()
61
+ reactApplicationContext?.onHostResume(activity)
62
62
  }
63
63
  }
64
64
  }
@@ -13,34 +13,19 @@ var _shouldDisableIOSLocalVideoOnBackground = require("../../../utils/internal/s
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  const COMPONENT_NAME = 'RTCViewPip';
16
- // workaround to support hot reloading
17
- // https://medium.com/tribalscale/beyond-the-framework-using-react-native-with-swift-and-kotlin-cfccf4bb9a03
18
- let RTCViewPipNative;
19
- if (__DEV__) {
20
- /* @ts-ignore */
21
- const cachedView = global.RTCViewPipNative;
22
- if (!cachedView) {
23
- RTCViewPipNative = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME);
24
- /* @ts-ignore */
25
- global.RTCViewPipNative = RTCViewPipNative;
26
- } else {
27
- RTCViewPipNative = cachedView;
28
- }
29
- } else {
30
- RTCViewPipNative = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME);
31
- }
16
+ const RTCViewPipNative = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME);
32
17
 
33
18
  /** Wrapper for the native view
34
19
  * meant to stay private and not exposed */
35
- const RTCViewPip = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
20
+ const RTCViewPip = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((props, ref) => {
36
21
  if (_reactNative.Platform.OS !== 'ios') return null;
37
22
  // @ts-ignore
38
23
  return /*#__PURE__*/_react.default.createElement(RTCViewPipNative, {
39
24
  streamURL: props.streamURL,
40
25
  ref: ref
41
26
  });
42
- });
43
- const RTCViewPipIOS = ({
27
+ }));
28
+ const RTCViewPipIOS = /*#__PURE__*/_react.default.memo(({
44
29
  includeLocalParticipantVideo
45
30
  }) => {
46
31
  const call = (0, _videoReactBindings.useCall)();
@@ -56,21 +41,7 @@ const RTCViewPipIOS = ({
56
41
  (0, _react.useEffect)(() => {
57
42
  _shouldDisableIOSLocalVideoOnBackground.shouldDisableIOSLocalVideoOnBackgroundRef.current = !includeLocalParticipantVideo;
58
43
  }, [includeLocalParticipantVideo]);
59
- const [videoStreamToRender, setVideoStreamToRender] = _react.default.useState();
60
44
  const nativeRef = _react.default.useRef(null);
61
- _react.default.useEffect(() => {
62
- if (!participantInSpotlight) {
63
- setVideoStreamToRender(undefined);
64
- return;
65
- }
66
- const {
67
- videoStream,
68
- screenShareStream
69
- } = participantInSpotlight;
70
- const isScreenSharing = (0, _videoClient.hasScreenShare)(participantInSpotlight);
71
- const _videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
72
- setVideoStreamToRender(_videoStreamToRender);
73
- }, [participantInSpotlight]);
74
45
  _react.default.useEffect(() => {
75
46
  let callClosedInvokedOnce = false;
76
47
  const onCallClosed = () => {
@@ -100,10 +71,22 @@ const RTCViewPipIOS = ({
100
71
  subscription?.unsubscribe();
101
72
  };
102
73
  }, [call]);
74
+ const streamURL = (0, _react.useMemo)(() => {
75
+ if (!participantInSpotlight) {
76
+ return undefined;
77
+ }
78
+ const {
79
+ videoStream,
80
+ screenShareStream
81
+ } = participantInSpotlight;
82
+ const isScreenSharing = (0, _videoClient.hasScreenShare)(participantInSpotlight);
83
+ const videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
84
+ return videoStreamToRender?.toURL();
85
+ }, [participantInSpotlight]);
103
86
  return /*#__PURE__*/_react.default.createElement(RTCViewPip, {
104
- streamURL: videoStreamToRender?.toURL(),
87
+ streamURL: streamURL,
105
88
  ref: nativeRef
106
89
  });
107
- };
90
+ });
108
91
  var _default = exports.default = RTCViewPipIOS;
109
92
  //# sourceMappingURL=RTCViewPipIOS.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_interopRequireWildcard","_reactNative","_useDebouncedValue","_shouldDisableIOSLocalVideoOnBackground","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","COMPONENT_NAME","RTCViewPipNative","__DEV__","cachedView","global","requireNativeComponent","RTCViewPip","React","forwardRef","props","ref","Platform","OS","createElement","streamURL","RTCViewPipIOS","includeLocalParticipantVideo","useCall","useParticipants","useCallStateHooks","_allParticipants","sortBy","speakerLayoutSortPreset","allParticipants","useDebouncedValue","participantInSpotlight","filter","participant","isLocalParticipant","useEffect","shouldDisableIOSLocalVideoOnBackgroundRef","current","videoStreamToRender","setVideoStreamToRender","useState","nativeRef","useRef","undefined","videoStream","screenShareStream","isScreenSharing","hasScreenShare","_videoStreamToRender","callClosedInvokedOnce","onCallClosed","node","findNodeHandle","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","unsubFunc","on","subscription","state","callingState$","subscribe","CallingState","LEFT","IDLE","unsubscribe","toURL","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAOA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,uCAAA,GAAAN,OAAA;AAA2H,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA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;IAACQ,SAAS,EAAEkB,mBAAmB,EAAE6B,KAAK,CAAC,CAAE;IAACnD,GAAG,EAAEyB;EAAU,CAAE,CAAC;AAE3E,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAA7E,OAAA,GAEa6B,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_interopRequireWildcard","_reactNative","_useDebouncedValue","_shouldDisableIOSLocalVideoOnBackground","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","COMPONENT_NAME","RTCViewPipNative","requireNativeComponent","RTCViewPip","React","memo","forwardRef","props","ref","Platform","OS","createElement","streamURL","RTCViewPipIOS","includeLocalParticipantVideo","useCall","useParticipants","useCallStateHooks","_allParticipants","sortBy","speakerLayoutSortPreset","allParticipants","useDebouncedValue","participantInSpotlight","filter","participant","isLocalParticipant","useEffect","shouldDisableIOSLocalVideoOnBackgroundRef","current","nativeRef","useRef","callClosedInvokedOnce","onCallClosed","node","findNodeHandle","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","unsubFunc","on","subscription","state","callingState$","subscribe","CallingState","LEFT","IDLE","unsubscribe","useMemo","undefined","videoStream","screenShareStream","isScreenSharing","hasScreenShare","videoStreamToRender","toURL","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAOA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,uCAAA,GAAAN,OAAA;AAA2H,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF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AAA,GAEY2B,aAAa","ignoreList":[]}
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '1.9.2';
7
+ const version = exports.version = '1.9.4';
8
8
  //# sourceMappingURL=version.js.map
@@ -1,38 +1,23 @@
1
1
  import { CallingState, hasScreenShare, speakerLayoutSortPreset } from '@stream-io/video-client';
2
2
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
3
- import React, { useEffect } from 'react';
3
+ import React, { useEffect, useMemo } from 'react';
4
4
  import { findNodeHandle, Platform, requireNativeComponent, UIManager } from 'react-native';
5
5
  import { useDebouncedValue } from '../../../utils/hooks/useDebouncedValue';
6
6
  import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../../../utils/internal/shouldDisableIOSLocalVideoOnBackground';
7
7
  const COMPONENT_NAME = 'RTCViewPip';
8
- // workaround to support hot reloading
9
- // https://medium.com/tribalscale/beyond-the-framework-using-react-native-with-swift-and-kotlin-cfccf4bb9a03
10
- let RTCViewPipNative;
11
- if (__DEV__) {
12
- /* @ts-ignore */
13
- const cachedView = global.RTCViewPipNative;
14
- if (!cachedView) {
15
- RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
16
- /* @ts-ignore */
17
- global.RTCViewPipNative = RTCViewPipNative;
18
- } else {
19
- RTCViewPipNative = cachedView;
20
- }
21
- } else {
22
- RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
23
- }
8
+ const RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
24
9
 
25
10
  /** Wrapper for the native view
26
11
  * meant to stay private and not exposed */
27
- const RTCViewPip = /*#__PURE__*/React.forwardRef((props, ref) => {
12
+ const RTCViewPip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((props, ref) => {
28
13
  if (Platform.OS !== 'ios') return null;
29
14
  // @ts-ignore
30
15
  return /*#__PURE__*/React.createElement(RTCViewPipNative, {
31
16
  streamURL: props.streamURL,
32
17
  ref: ref
33
18
  });
34
- });
35
- const RTCViewPipIOS = ({
19
+ }));
20
+ const RTCViewPipIOS = /*#__PURE__*/React.memo(({
36
21
  includeLocalParticipantVideo
37
22
  }) => {
38
23
  const call = useCall();
@@ -48,21 +33,7 @@ const RTCViewPipIOS = ({
48
33
  useEffect(() => {
49
34
  shouldDisableIOSLocalVideoOnBackgroundRef.current = !includeLocalParticipantVideo;
50
35
  }, [includeLocalParticipantVideo]);
51
- const [videoStreamToRender, setVideoStreamToRender] = React.useState();
52
36
  const nativeRef = React.useRef(null);
53
- React.useEffect(() => {
54
- if (!participantInSpotlight) {
55
- setVideoStreamToRender(undefined);
56
- return;
57
- }
58
- const {
59
- videoStream,
60
- screenShareStream
61
- } = participantInSpotlight;
62
- const isScreenSharing = hasScreenShare(participantInSpotlight);
63
- const _videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
64
- setVideoStreamToRender(_videoStreamToRender);
65
- }, [participantInSpotlight]);
66
37
  React.useEffect(() => {
67
38
  let callClosedInvokedOnce = false;
68
39
  const onCallClosed = () => {
@@ -92,10 +63,22 @@ const RTCViewPipIOS = ({
92
63
  subscription?.unsubscribe();
93
64
  };
94
65
  }, [call]);
66
+ const streamURL = useMemo(() => {
67
+ if (!participantInSpotlight) {
68
+ return undefined;
69
+ }
70
+ const {
71
+ videoStream,
72
+ screenShareStream
73
+ } = participantInSpotlight;
74
+ const isScreenSharing = hasScreenShare(participantInSpotlight);
75
+ const videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
76
+ return videoStreamToRender?.toURL();
77
+ }, [participantInSpotlight]);
95
78
  return /*#__PURE__*/React.createElement(RTCViewPip, {
96
- streamURL: videoStreamToRender?.toURL(),
79
+ streamURL: streamURL,
97
80
  ref: nativeRef
98
81
  });
99
- };
82
+ });
100
83
  export default RTCViewPipIOS;
101
84
  //# sourceMappingURL=RTCViewPipIOS.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CallingState","hasScreenShare","speakerLayoutSortPreset","useCall","useCallStateHooks","React","useEffect","findNodeHandle","Platform","requireNativeComponent","UIManager","useDebouncedValue","shouldDisableIOSLocalVideoOnBackgroundRef","COMPONENT_NAME","RTCViewPipNative","__DEV__","cachedView","global","RTCViewPip","forwardRef","props","ref","OS","createElement","streamURL","RTCViewPipIOS","includeLocalParticipantVideo","call","useParticipants","_allParticipants","sortBy","allParticipants","participantInSpotlight","filter","participant","isLocalParticipant","current","videoStreamToRender","setVideoStreamToRender","useState","nativeRef","useRef","undefined","videoStream","screenShareStream","isScreenSharing","_videoStreamToRender","callClosedInvokedOnce","onCallClosed","node","dispatchViewManagerCommand","getViewManagerConfig","Commands","unsubFunc","on","subscription","state","callingState$","subscribe","LEFT","IDLE","unsubscribe","toURL"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":"AAAA,SACEA,YAAY,EACZC,cAAc,EACdC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAE5E,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,cAAc,EAEdC,QAAQ,EACRC,sBAAsB,EACtBC,SAAS,QACJ,cAAc;AACrB,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,yCAAyC,QAAQ,gEAAgE;AAE1H,MAAMC,cAAc,GAAG,YAAY;AAMnC;AACA;AACA,IAAIC,gBAAsD;AAE1D,IAAIC,OAAO,EAAE;EACX;EACA,MAAMC,UAAU,GAAGC,MAAM,CAACH,gBAEb;EACb,IAAI,CAACE,UAAU,EAAE;IACfF,gBAAgB,GAAGL,sBAAsB,CAACI,cAAc,CAAC;IACzD;IACAI,MAAM,CAACH,gBAAgB,GAAGA,gBAAgB;EAC5C,CAAC,MAAM;IACLA,gBAAgB,GAAGE,UAAU;EAC/B;AACF,CAAC,MAAM;EACLF,gBAAgB,GAAGL,sBAAsB,CAACI,cAAc,CAAC;AAC3D;;AAEA;AACA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U;IAACM,SAAS,EAAEa,mBAAmB,EAAEyB,KAAK,CAAC,CAAE;IAACzC,GAAG,EAAEmB;EAAU,CAAE,CAAC;AAE3E,CAAC;AAED,eAAef,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["CallingState","hasScreenShare","speakerLayoutSortPreset","useCall","useCallStateHooks","React","useEffect","useMemo","findNodeHandle","Platform","requireNativeComponent","UIManager","useDebouncedValue","shouldDisableIOSLocalVideoOnBackgroundRef","COMPONENT_NAME","RTCViewPipNative","RTCViewPip","memo","forwardRef","props","ref","OS","createElement","streamURL","RTCViewPipIOS","includeLocalParticipantVideo","call","useParticipants","_allParticipants","sortBy","allParticipants","participantInSpotlight","filter","participant","isLocalParticipant","current","nativeRef","useRef","callClosedInvokedOnce","onCallClosed","node","dispatchViewManagerCommand","getViewManagerConfig","Commands","unsubFunc","on","subscription","state","callingState$","subscribe","LEFT","IDLE","unsubscribe","undefined","videoStream","screenShareStream","isScreenSharing","videoStreamToRender","toURL"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":"AAAA,SACEA,YAAY,EACZC,cAAc,EACdC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAE5E,OAAOC,KAAK,IAAIC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACjD,SACEC,cAAc,EAEdC,QAAQ,EACRC,sBAAsB,EACtBC,SAAS,QACJ,cAAc;AACrB,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,yCAAyC,QAAQ,gEAAgE;AAE1H,MAAMC,cAAc,GAAG,YAAY;AAMnC,MAAMC,gBAAsD,GAC1DL,sBAAsB,CAACI,cAAc,CAAC;;AAExC;AACA;AACA,MAAME,UAAU,gBAAGX,KAAK,CAACY,IAAI,cAC3BZ,KAAK,CAACa,UAAU,CAKd,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChB,IAAIX,QAAQ,CAACY,EAAE,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'1.9.4';
2
2
  //# sourceMappingURL=version.js.map
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  type Props = {
3
3
  includeLocalParticipantVideo?: boolean;
4
4
  };
5
- declare const RTCViewPipIOS: ({ includeLocalParticipantVideo }: Props) => React.JSX.Element;
5
+ declare const RTCViewPipIOS: React.MemoExoticComponent<({ includeLocalParticipantVideo }: Props) => React.JSX.Element>;
6
6
  export default RTCViewPipIOS;
7
7
  //# sourceMappingURL=RTCViewPipIOS.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAkDzC,KAAK,KAAK,GAAG;IACX,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,QAAA,MAAM,aAAa,qCAAsC,KAAK,sBA0E7D,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAmClD,KAAK,KAAK,GAAG;IACX,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,QAAA,MAAM,aAAa,+DAAiD,KAAK,uBAqEvE,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.9.2";
1
+ export declare const version = "1.9.4";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -10,4 +10,5 @@ export type ConfigProps = {
10
10
  androidKeepCallAlive?: boolean;
11
11
  enableScreenshare?: boolean;
12
12
  appleTeamId?: string;
13
+ iOSEnableMultitaskingCameraAccess?: boolean;
13
14
  } | undefined;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const config_plugins_1 = require("@expo/config-plugins");
7
- const withPushAppDelegate_1 = __importDefault(require("./withPushAppDelegate"));
7
+ const withAppDelegate_1 = __importDefault(require("./withAppDelegate"));
8
8
  const withAndroidPermissions_1 = __importDefault(require("./withAndroidPermissions"));
9
9
  const withAndroidManifest_1 = __importDefault(require("./withAndroidManifest"));
10
10
  const withiOSInfoPlist_1 = __importDefault(require("./withiOSInfoPlist"));
@@ -17,7 +17,7 @@ const pkg = require('../../package.json');
17
17
  const withStreamVideoReactNativeSDK = (config, props) => {
18
18
  return (0, config_plugins_1.withPlugins)(config, [
19
19
  // ios
20
- () => (0, withPushAppDelegate_1.default)(config, props),
20
+ () => (0, withAppDelegate_1.default)(config, props),
21
21
  () => (0, withiOSInfoPlist_1.default)(config, props),
22
22
  () => (0, withIosScreenCapture_1.default)(config, props),
23
23
  // android
@@ -1,4 +1,4 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ConfigProps } from './common/types';
3
- declare const withPushAppDelegate: ConfigPlugin<ConfigProps>;
4
- export default withPushAppDelegate;
3
+ declare const withAppDelegate: ConfigPlugin<ConfigProps>;
4
+ export default withAppDelegate;
@@ -9,24 +9,28 @@ const addNewLinesToAppDelegate_1 = __importDefault(require("./common/addNewLines
9
9
  const DID_FINISH_LAUNCHING_WITH_OPTIONS = 'application:didFinishLaunchingWithOptions:';
10
10
  const DID_UPDATE_PUSH_CREDENTIALS = 'pushRegistry:didUpdatePushCredentials:forType:';
11
11
  const DID_RECEIVE_INCOMING_PUSH = 'pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:';
12
- const withPushAppDelegate = (configuration, props) => {
12
+ const withAppDelegate = (configuration, props) => {
13
13
  return (0, config_plugins_1.withAppDelegate)(configuration, (config) => {
14
- if (!props?.ringingPushNotifications) {
15
- // user doesnt want to use ringing push notifications, so quit early
14
+ if (!props?.ringingPushNotifications &&
15
+ !props?.iOSEnableMultitaskingCameraAccess) {
16
+ // quit early if no change is necessary
16
17
  return config;
17
18
  }
18
19
  if (['objc', 'objcpp'].includes(config.modResults.language)) {
19
20
  try {
20
21
  // all the imports that are needed
21
- config.modResults.contents = (0, codeMod_1.addObjcImports)(config.modResults.contents, [
22
- '"RNCallKeep.h"',
23
- '<PushKit/PushKit.h>',
24
- '"RNVoipPushNotificationManager.h"',
25
- '"StreamVideoReactNative.h"',
26
- ]);
27
- config.modResults.contents = addDidFinishLaunchingWithOptions(config.modResults.contents, props.ringingPushNotifications);
28
- config.modResults.contents = addDidUpdatePushCredentials(config.modResults.contents);
29
- config.modResults.contents = addDidReceiveIncomingPushCallback(config.modResults.contents);
22
+ if (props?.ringingPushNotifications) {
23
+ config.modResults.contents = (0, codeMod_1.addObjcImports)(config.modResults.contents, [
24
+ '"RNCallKeep.h"',
25
+ '<PushKit/PushKit.h>',
26
+ '"RNVoipPushNotificationManager.h"',
27
+ '"StreamVideoReactNative.h"',
28
+ ]);
29
+ config.modResults.contents = addDidFinishLaunchingWithOptionsRinging(config.modResults.contents, props.ringingPushNotifications);
30
+ config.modResults.contents = addDidUpdatePushCredentials(config.modResults.contents);
31
+ config.modResults.contents = addDidReceiveIncomingPushCallback(config.modResults.contents);
32
+ }
33
+ config.modResults.contents = addDidFinishLaunchingWithOptions(config.modResults.contents, props.iOSEnableMultitaskingCameraAccess);
30
34
  return config;
31
35
  }
32
36
  catch (error) {
@@ -38,7 +42,18 @@ const withPushAppDelegate = (configuration, props) => {
38
42
  }
39
43
  });
40
44
  };
41
- function addDidFinishLaunchingWithOptions(contents, ringingPushNotifications) {
45
+ function addDidFinishLaunchingWithOptions(contents, iOSEnableMultitaskingCameraAccess) {
46
+ if (iOSEnableMultitaskingCameraAccess) {
47
+ contents = (0, codeMod_1.addObjcImports)(contents, ['<WebRTCModuleOptions.h>']);
48
+ const setupMethod = `WebRTCModuleOptions *options = [WebRTCModuleOptions sharedInstance];
49
+ options.enableMultitaskingCameraAccess = YES;`;
50
+ if (!contents.includes('options.enableMultitaskingCameraAccess = YES')) {
51
+ contents = (0, codeMod_1.insertContentsInsideObjcFunctionBlock)(contents, DID_FINISH_LAUNCHING_WITH_OPTIONS, setupMethod, { position: 'tailBeforeLastReturn' });
52
+ }
53
+ }
54
+ return contents;
55
+ }
56
+ function addDidFinishLaunchingWithOptionsRinging(contents, ringingPushNotifications) {
42
57
  // call the setup RNCallKeep
43
58
  const supportsVideoString = ringingPushNotifications.disableVideoIos
44
59
  ? '@NO'
@@ -122,4 +137,4 @@ function addDidReceiveIncomingPushCallback(contents) {
122
137
  }
123
138
  return contents;
124
139
  }
125
- exports.default = withPushAppDelegate;
140
+ exports.default = withAppDelegate;
@@ -151,7 +151,9 @@ import Foundation
151
151
  }
152
152
 
153
153
  @objc func cleanup() {
154
+ sourceView = nil
154
155
  contentViewController?.track = nil
156
+ contentViewController = nil
155
157
  if #available(iOS 15.0, *) {
156
158
  pictureInPictureController?.contentSource = nil
157
159
  }
@@ -35,12 +35,13 @@ class RTCViewPip: UIView {
35
35
  }
36
36
 
37
37
  @objc func setStreamURL(_ streamReactTag: NSString) {
38
+ let tag = String(streamReactTag)
38
39
  webRtcModule?.workerQueue.async {
39
- let stream = self.webRtcModule?.stream(forReactTag: String(streamReactTag))
40
+ let stream = self.webRtcModule?.stream(forReactTag: tag)
40
41
  let videoTracks = stream?.videoTracks ?? []
41
42
  let videoTrack = videoTracks.first
42
43
  if videoTrack == nil {
43
- NSLog("PiP - No video stream for react tag: -\(streamReactTag)")
44
+ NSLog("PiP - No video stream for react tag: -\(tag)")
44
45
  } else {
45
46
  DispatchQueue.main.async {
46
47
  self.pictureInPictureController?.track = videoTrack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -46,8 +46,8 @@
46
46
  "!**/.*"
47
47
  ],
48
48
  "dependencies": {
49
- "@stream-io/video-client": "1.15.1",
50
- "@stream-io/video-react-bindings": "1.4.1",
49
+ "@stream-io/video-client": "1.15.2",
50
+ "@stream-io/video-react-bindings": "1.4.2",
51
51
  "intl-pluralrules": "2.0.1",
52
52
  "lodash.merge": "^4.6.2",
53
53
  "react-native-url-polyfill": "1.3.0",
@@ -5,7 +5,7 @@ import {
5
5
  } from '@stream-io/video-client';
6
6
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
7
7
  import type { MediaStream } from '@stream-io/react-native-webrtc';
8
- import React, { useEffect } from 'react';
8
+ import React, { useEffect, useMemo } from 'react';
9
9
  import {
10
10
  findNodeHandle,
11
11
  HostComponent,
@@ -22,44 +22,29 @@ type RTCViewPipNativeProps = {
22
22
  streamURL?: string;
23
23
  };
24
24
 
25
- // workaround to support hot reloading
26
- // https://medium.com/tribalscale/beyond-the-framework-using-react-native-with-swift-and-kotlin-cfccf4bb9a03
27
- let RTCViewPipNative: HostComponent<RTCViewPipNativeProps>;
28
-
29
- if (__DEV__) {
30
- /* @ts-ignore */
31
- const cachedView = global.RTCViewPipNative as
32
- | HostComponent<RTCViewPipNativeProps>
33
- | undefined;
34
- if (!cachedView) {
35
- RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
36
- /* @ts-ignore */
37
- global.RTCViewPipNative = RTCViewPipNative;
38
- } else {
39
- RTCViewPipNative = cachedView;
40
- }
41
- } else {
42
- RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
43
- }
25
+ const RTCViewPipNative: HostComponent<RTCViewPipNativeProps> =
26
+ requireNativeComponent(COMPONENT_NAME);
44
27
 
45
28
  /** Wrapper for the native view
46
29
  * meant to stay private and not exposed */
47
- const RTCViewPip = React.forwardRef<
48
- React.Ref<any>,
49
- {
50
- streamURL?: string;
51
- }
52
- >((props, ref) => {
53
- if (Platform.OS !== 'ios') return null;
54
- // @ts-ignore
55
- return <RTCViewPipNative streamURL={props.streamURL} ref={ref} />;
56
- });
30
+ const RTCViewPip = React.memo(
31
+ React.forwardRef<
32
+ React.Ref<any>,
33
+ {
34
+ streamURL?: string;
35
+ }
36
+ >((props, ref) => {
37
+ if (Platform.OS !== 'ios') return null;
38
+ // @ts-ignore
39
+ return <RTCViewPipNative streamURL={props.streamURL} ref={ref} />;
40
+ })
41
+ );
57
42
 
58
43
  type Props = {
59
44
  includeLocalParticipantVideo?: boolean;
60
45
  };
61
46
 
62
- const RTCViewPipIOS = ({ includeLocalParticipantVideo }: Props) => {
47
+ const RTCViewPipIOS = React.memo(({ includeLocalParticipantVideo }: Props) => {
63
48
  const call = useCall();
64
49
  const { useParticipants } = useCallStateHooks();
65
50
  const _allParticipants = useParticipants({
@@ -76,27 +61,8 @@ const RTCViewPipIOS = ({ includeLocalParticipantVideo }: Props) => {
76
61
  !includeLocalParticipantVideo;
77
62
  }, [includeLocalParticipantVideo]);
78
63
 
79
- const [videoStreamToRender, setVideoStreamToRender] =
80
- React.useState<MediaStream>();
81
-
82
64
  const nativeRef = React.useRef<any>(null);
83
65
 
84
- React.useEffect(() => {
85
- if (!participantInSpotlight) {
86
- setVideoStreamToRender(undefined);
87
- return;
88
- }
89
- const { videoStream, screenShareStream } = participantInSpotlight;
90
-
91
- const isScreenSharing = hasScreenShare(participantInSpotlight);
92
-
93
- const _videoStreamToRender = (isScreenSharing
94
- ? screenShareStream
95
- : videoStream) as unknown as MediaStream | undefined;
96
-
97
- setVideoStreamToRender(_videoStreamToRender);
98
- }, [participantInSpotlight]);
99
-
100
66
  React.useEffect(() => {
101
67
  let callClosedInvokedOnce = false;
102
68
  const onCallClosed = () => {
@@ -130,9 +96,23 @@ const RTCViewPipIOS = ({ includeLocalParticipantVideo }: Props) => {
130
96
  };
131
97
  }, [call]);
132
98
 
133
- return (
134
- <RTCViewPip streamURL={videoStreamToRender?.toURL()} ref={nativeRef} />
135
- );
136
- };
99
+ const streamURL = useMemo(() => {
100
+ if (!participantInSpotlight) {
101
+ return undefined;
102
+ }
103
+
104
+ const { videoStream, screenShareStream } = participantInSpotlight;
105
+
106
+ const isScreenSharing = hasScreenShare(participantInSpotlight);
107
+
108
+ const videoStreamToRender = (isScreenSharing
109
+ ? screenShareStream
110
+ : videoStream) as unknown as MediaStream | undefined;
111
+
112
+ return videoStreamToRender?.toURL();
113
+ }, [participantInSpotlight]);
114
+
115
+ return <RTCViewPip streamURL={streamURL} ref={nativeRef} />;
116
+ });
137
117
 
138
118
  export default RTCViewPipIOS;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.9.2';
1
+ export const version = '1.9.4';