@stream-io/video-react-native-sdk 1.9.2 → 1.9.3
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 +7 -0
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +18 -35
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +19 -36
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/common/types.d.ts +1 -0
- package/expo-config-plugin/dist/index.js +2 -2
- package/expo-config-plugin/dist/{withPushAppDelegate.d.ts → withAppDelegate.d.ts} +2 -2
- package/expo-config-plugin/dist/{withPushAppDelegate.js → withAppDelegate.js} +29 -14
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +2 -0
- package/ios/RTCViewPip.swift +3 -2
- package/package.json +1 -1
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +34 -54
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [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)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 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)
|
|
11
|
+
|
|
5
12
|
## [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
13
|
|
|
7
14
|
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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:
|
|
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","
|
|
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,O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IAAA4B,QAAA,GAAAC,OAAA,CAAAzE,OAAA,GAEY2B,aAAa","ignoreList":[]}
|
package/dist/commonjs/version.js
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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","
|
|
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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I,CAACwB,sBAAsB,EAAE;MAC3B,OAAOsB,SAAS;IAClB;IAEA,MAAM;MAAEC,WAAW;MAAEC;IAAkB,CAAC,GAAGxB,sBAAsB;IAEjE,MAAMyB,eAAe,GAAGvD,cAAc,CAAC8B,sBAAsB,CAAC;IAE9D,MAAM0B,mBAAmB,GAAID,eAAe,GACxCD,iBAAiB,GACjBD,WAAkD;IAEtD,OAAOG,mBAAmB,EAAEC,KAAK,CAAC,CAAC;EACrC,CAAC,EAAE,CAAC3B,sBAAsB,CAAC,CAAC;EAE5B,oBAAO1B,KAAA,CAAAiB,aAAA,CAACN,UAAU;IAACO,SAAS,EAAEA,SAAU;IAACH,GAAG,EAAEgB;EAAU,CAAE,CAAC;AAC7D,CAAC,CAAC;AAEF,eAAeZ,aAAa","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.9.
|
|
1
|
+
export const version = '1.9.3';
|
|
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,
|
|
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.
|
|
1
|
+
export declare const version = "1.9.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -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
|
|
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,
|
|
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
|
|
4
|
-
export default
|
|
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
|
|
12
|
+
const withAppDelegate = (configuration, props) => {
|
|
13
13
|
return (0, config_plugins_1.withAppDelegate)(configuration, (config) => {
|
|
14
|
-
if (!props?.ringingPushNotifications
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,
|
|
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 =
|
|
140
|
+
exports.default = withAppDelegate;
|
package/ios/RTCViewPip.swift
CHANGED
|
@@ -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:
|
|
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: -\(
|
|
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
|
@@ -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
|
-
|
|
26
|
-
|
|
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.
|
|
48
|
-
React.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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.
|
|
1
|
+
export const version = '1.9.3';
|