@stream-io/video-react-native-sdk 1.9.1 → 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 +14 -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/providers/StreamCall/AppStateListener.js +7 -1
- package/dist/commonjs/providers/StreamCall/AppStateListener.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/providers/StreamCall/AppStateListener.js +7 -1
- package/dist/module/providers/StreamCall/AppStateListener.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/providers/StreamCall/AppStateListener.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/providers/StreamCall/AppStateListener.tsx +7 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
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)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **rn-sdk:** fixes the camera status on app restore from background ([#1641](https://github.com/GetStream/stream-video-js/issues/1641)) ([0ff2506](https://github.com/GetStream/stream-video-js/commit/0ff2506de4d3db30a86ab27ee8dcfaa2fe8f0ddc))
|
|
18
|
+
|
|
5
19
|
## [1.9.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.0...@stream-io/video-react-native-sdk-1.9.1) (2025-01-16)
|
|
6
20
|
|
|
7
21
|
### Dependency Updates
|
|
@@ -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,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,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,C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C,EAAE,CAACpD,IAAI,CAAC,CAAC;EAEV,MAAMe,SAAS,GAAG,IAAAsC,cAAO,EAAC,MAAM;IAC9B,IAAI,CAAC3B,sBAAsB,EAAE;MAC3B,OAAO4B,SAAS;IAClB;IAEA,MAAM;MAAEC,WAAW;MAAEC;IAAkB,CAAC,GAAG9B,sBAAsB;IAEjE,MAAM+B,eAAe,GAAG,IAAAC,2BAAc,EAAChC,sBAAsB,CAAC;IAE9D,MAAMiC,mBAAmB,GAAIF,eAAe,GACxCD,iBAAiB,GACjBD,WAAkD;IAEtD,OAAOI,mBAAmB,EAAEC,KAAK,CAAC,CAAC;EACrC,CAAC,EAAE,CAAClC,sBAAsB,CAAC,CAAC;EAE5B,oBAAOhD,MAAA,CAAAW,OAAA,CAAAyB,aAAA,CAACR,UAAU;IAACS,SAAS,EAAEA,SAAU;IAACJ,GAAG,EAAEsB;EAAU,CAAE,CAAC;AAC7D,CAAC,CAAC;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAzE,OAAA,GAEY2B,aAAa","ignoreList":[]}
|
|
@@ -19,6 +19,7 @@ const isAndroid8OrAbove = _reactNative.Platform.OS === 'android' && _reactNative
|
|
|
19
19
|
const AppStateListener = () => {
|
|
20
20
|
const call = (0, _videoReactBindings.useCall)();
|
|
21
21
|
const appState = (0, _react.useRef)(_reactNative.AppState.currentState);
|
|
22
|
+
const cameraDisabledByAppState = (0, _react.useRef)(false);
|
|
22
23
|
|
|
23
24
|
// on mount: set initial PiP mode and listen to PiP events
|
|
24
25
|
(0, _react.useEffect)(() => {
|
|
@@ -48,7 +49,10 @@ const AppStateListener = () => {
|
|
|
48
49
|
call?.camera?.enable();
|
|
49
50
|
});
|
|
50
51
|
} else {
|
|
51
|
-
|
|
52
|
+
if (cameraDisabledByAppState.current) {
|
|
53
|
+
call?.camera?.resume();
|
|
54
|
+
cameraDisabledByAppState.current = false;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
appState.current = nextAppState;
|
|
54
58
|
} else if (appState.current === 'active' && nextAppState.match(/background/)) {
|
|
@@ -57,6 +61,7 @@ const AppStateListener = () => {
|
|
|
57
61
|
// in PiP mode, we don't want to disable the camera
|
|
58
62
|
const disableCameraIfNeeded = () => {
|
|
59
63
|
if (call?.camera?.state.status === 'enabled') {
|
|
64
|
+
cameraDisabledByAppState.current = true;
|
|
60
65
|
call?.camera?.disable();
|
|
61
66
|
}
|
|
62
67
|
};
|
|
@@ -84,6 +89,7 @@ const AppStateListener = () => {
|
|
|
84
89
|
// shouldDisableIOSLocalVideoOnBackgroundRef is false, if local video is enabled on PiP
|
|
85
90
|
if (_shouldDisableIOSLocalVideoOnBackground.shouldDisableIOSLocalVideoOnBackgroundRef.current) {
|
|
86
91
|
if (call?.camera?.state.status === 'enabled') {
|
|
92
|
+
cameraDisabledByAppState.current = true;
|
|
87
93
|
call?.camera?.disable();
|
|
88
94
|
}
|
|
89
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_reactNative","_shouldDisableIOSLocalVideoOnBackground","_rxSubjects","_videoClient","PIP_CHANGE_EVENT","isAndroid8OrAbove","Platform","OS","Version","AppStateListener","call","useCall","appState","useRef","AppState","currentState","useEffect","disablePiP","RxUtils","getCurrentValue","disablePiPMode$","isInPiPModeAndroid$","next","eventEmitter","NativeEventEmitter","NativeModules","StreamVideoReactNative","subscriptionPiPChange","addListener","isInPiPMode","remove","subscription","addEventListener","nextAppState","current","match","camera","state","status","disable","then","enable","resume","disableCameraIfNeeded","isInPiP","shouldDisableIOSLocalVideoOnBackgroundRef","exports"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AppStateListener.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAMA,IAAAG,uCAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AAEA,MAAMM,gBAAgB,GAAG,yCAAyC;AAElE,MAAMC,iBAAiB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACE,OAAO,IAAI,EAAE;;AAE7E;AACA;AACA;AACO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,IAAI,GAAG,IAAAC,2BAAO,EAAC,CAAC;EACtB,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAACC,qBAAQ,CAACC,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_reactNative","_shouldDisableIOSLocalVideoOnBackground","_rxSubjects","_videoClient","PIP_CHANGE_EVENT","isAndroid8OrAbove","Platform","OS","Version","AppStateListener","call","useCall","appState","useRef","AppState","currentState","cameraDisabledByAppState","useEffect","disablePiP","RxUtils","getCurrentValue","disablePiPMode$","isInPiPModeAndroid$","next","eventEmitter","NativeEventEmitter","NativeModules","StreamVideoReactNative","subscriptionPiPChange","addListener","isInPiPMode","remove","subscription","addEventListener","nextAppState","current","match","camera","state","status","disable","then","enable","resume","disableCameraIfNeeded","isInPiP","shouldDisableIOSLocalVideoOnBackgroundRef","exports"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AppStateListener.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAMA,IAAAG,uCAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AAEA,MAAMM,gBAAgB,GAAG,yCAAyC;AAElE,MAAMC,iBAAiB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACE,OAAO,IAAI,EAAE;;AAE7E;AACA;AACA;AACO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,IAAI,GAAG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AAK,CAACC,MAAM,KAAK,SAAS,EAAE;cAC5CvB,wBAAwB,CAACmB,OAAO,GAAG,IAAI;cACvCzB,IAAI,EAAE2B,MAAM,EAAEG,OAAO,CAAC,CAAC;YACzB;UACF;QACF;QACA5B,QAAQ,CAACuB,OAAO,GAAGD,YAAY;MACjC;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXF,YAAY,CAACD,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACrB,IAAI,CAAC,CAAC;EAEV,OAAO,IAAI;AACb,CAAC;AAACqC,OAAA,CAAAtC,gBAAA,GAAAA,gBAAA","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,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,KAAK,KAAK,EAAE,OAAO,IAAI;EACtC;EACA,oBAAOhB,KAAA,CAAAiB,aAAA,CAACP,gBAAgB;IAACQ,SAAS,EAAEJ,KAAK,CAACI,SAAU;IAACH,GAAG,EAAEA;EAAI,CAAE,CAAC;AACnE,CAAC,CACH,CAAC;AAMD,MAAMI,aAAa,gBAAGnB,KAAK,CAACY,IAAI,CAAC,CAAC;EAAEQ;AAAoC,CAAC,KAAK;EAC5E,MAAMC,IAAI,GAAGvB,OAAO,CAAC,CAAC;EACtB,MAAM;IAAEwB;EAAgB,CAA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/C,YAAY,CAACkD,IAAI,IAAIH,KAAK,KAAK/C,YAAY,CAACmD,IAAI,EAAE;QAC9DZ,YAAY,CAAC,CAAC;MAChB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACXA,YAAY,CAAC,CAAC;MACdK,SAAS,GAAG,CAAC;MACbE,YAAY,EAAEM,WAAW,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAAC1B,IAAI,CAAC,CAAC;EAEV,MAAMH,SAAS,GAAGhB,OAAO,CAAC,MAAM;IAC9B,IAAI,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":[]}
|
|
@@ -13,6 +13,7 @@ const isAndroid8OrAbove = Platform.OS === 'android' && Platform.Version >= 26;
|
|
|
13
13
|
export const AppStateListener = () => {
|
|
14
14
|
const call = useCall();
|
|
15
15
|
const appState = useRef(AppState.currentState);
|
|
16
|
+
const cameraDisabledByAppState = useRef(false);
|
|
16
17
|
|
|
17
18
|
// on mount: set initial PiP mode and listen to PiP events
|
|
18
19
|
useEffect(() => {
|
|
@@ -42,7 +43,10 @@ export const AppStateListener = () => {
|
|
|
42
43
|
call?.camera?.enable();
|
|
43
44
|
});
|
|
44
45
|
} else {
|
|
45
|
-
|
|
46
|
+
if (cameraDisabledByAppState.current) {
|
|
47
|
+
call?.camera?.resume();
|
|
48
|
+
cameraDisabledByAppState.current = false;
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
appState.current = nextAppState;
|
|
48
52
|
} else if (appState.current === 'active' && nextAppState.match(/background/)) {
|
|
@@ -51,6 +55,7 @@ export const AppStateListener = () => {
|
|
|
51
55
|
// in PiP mode, we don't want to disable the camera
|
|
52
56
|
const disableCameraIfNeeded = () => {
|
|
53
57
|
if (call?.camera?.state.status === 'enabled') {
|
|
58
|
+
cameraDisabledByAppState.current = true;
|
|
54
59
|
call?.camera?.disable();
|
|
55
60
|
}
|
|
56
61
|
};
|
|
@@ -78,6 +83,7 @@ export const AppStateListener = () => {
|
|
|
78
83
|
// shouldDisableIOSLocalVideoOnBackgroundRef is false, if local video is enabled on PiP
|
|
79
84
|
if (shouldDisableIOSLocalVideoOnBackgroundRef.current) {
|
|
80
85
|
if (call?.camera?.state.status === 'enabled') {
|
|
86
|
+
cameraDisabledByAppState.current = true;
|
|
81
87
|
call?.camera?.disable();
|
|
82
88
|
}
|
|
83
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCall","useEffect","useRef","AppState","NativeEventEmitter","NativeModules","Platform","shouldDisableIOSLocalVideoOnBackgroundRef","disablePiPMode$","isInPiPModeAndroid$","RxUtils","PIP_CHANGE_EVENT","isAndroid8OrAbove","OS","Version","AppStateListener","call","appState","currentState","disablePiP","getCurrentValue","next","eventEmitter","StreamVideoReactNative","subscriptionPiPChange","addListener","isInPiPMode","remove","subscription","addEventListener","nextAppState","current","match","camera","state","status","disable","then","enable","resume","disableCameraIfNeeded","isInPiP"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AppStateListener.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iCAAiC;AACzD,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QACH,cAAc;AACrB,SAASC,yCAAyC,QAAQ,6DAA6D;AACvH,SACEC,eAAe,EACfC,mBAAmB,QACd,iCAAiC;AACxC,SAASC,OAAO,QAAQ,yBAAyB;AAEjD,MAAMC,gBAAgB,GAAG,yCAAyC;AAElE,MAAMC,iBAAiB,GAAGN,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIP,QAAQ,CAACQ,OAAO,IAAI,EAAE;;AAE7E;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,IAAI,GAAGhB,OAAO,CAAC,CAAC;EACtB,MAAMiB,QAAQ,GAAGf,MAAM,CAACC,QAAQ,CAACe,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"names":["useCall","useEffect","useRef","AppState","NativeEventEmitter","NativeModules","Platform","shouldDisableIOSLocalVideoOnBackgroundRef","disablePiPMode$","isInPiPModeAndroid$","RxUtils","PIP_CHANGE_EVENT","isAndroid8OrAbove","OS","Version","AppStateListener","call","appState","currentState","cameraDisabledByAppState","disablePiP","getCurrentValue","next","eventEmitter","StreamVideoReactNative","subscriptionPiPChange","addListener","isInPiPMode","remove","subscription","addEventListener","nextAppState","current","match","camera","state","status","disable","then","enable","resume","disableCameraIfNeeded","isInPiP"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AppStateListener.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iCAAiC;AACzD,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QACH,cAAc;AACrB,SAASC,yCAAyC,QAAQ,6DAA6D;AACvH,SACEC,eAAe,EACfC,mBAAmB,QACd,iCAAiC;AACxC,SAASC,OAAO,QAAQ,yBAAyB;AAEjD,MAAMC,gBAAgB,GAAG,yCAAyC;AAElE,MAAMC,iBAAiB,GAAGN,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIP,QAAQ,CAACQ,OAAO,IAAI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E;YACrD,IAAIhB,IAAI,EAAEkB,MAAM,EAAEC,KAAK,CAACC,MAAM,KAAK,SAAS,EAAE;cAC5CjB,wBAAwB,CAACa,OAAO,GAAG,IAAI;cACvChB,IAAI,EAAEkB,MAAM,EAAEG,OAAO,CAAC,CAAC;YACzB;UACF;QACF;QACApB,QAAQ,CAACe,OAAO,GAAGD,YAAY;MACjC;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXF,YAAY,CAACD,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACZ,IAAI,CAAC,CAAC;EAEV,OAAO,IAAI;AACb,CAAC","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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppStateListener.d.ts","sourceRoot":"","sources":["../../../../src/providers/StreamCall/AppStateListener.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"AppStateListener.d.ts","sourceRoot":"","sources":["../../../../src/providers/StreamCall/AppStateListener.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,YA4G5B,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;
|
|
@@ -23,6 +23,7 @@ const isAndroid8OrAbove = Platform.OS === 'android' && Platform.Version >= 26;
|
|
|
23
23
|
export const AppStateListener = () => {
|
|
24
24
|
const call = useCall();
|
|
25
25
|
const appState = useRef(AppState.currentState);
|
|
26
|
+
const cameraDisabledByAppState = useRef<boolean>(false);
|
|
26
27
|
|
|
27
28
|
// on mount: set initial PiP mode and listen to PiP events
|
|
28
29
|
useEffect(() => {
|
|
@@ -67,7 +68,10 @@ export const AppStateListener = () => {
|
|
|
67
68
|
call?.camera?.enable();
|
|
68
69
|
});
|
|
69
70
|
} else {
|
|
70
|
-
|
|
71
|
+
if (cameraDisabledByAppState.current) {
|
|
72
|
+
call?.camera?.resume();
|
|
73
|
+
cameraDisabledByAppState.current = false;
|
|
74
|
+
}
|
|
71
75
|
}
|
|
72
76
|
appState.current = nextAppState;
|
|
73
77
|
} else if (
|
|
@@ -79,6 +83,7 @@ export const AppStateListener = () => {
|
|
|
79
83
|
// in PiP mode, we don't want to disable the camera
|
|
80
84
|
const disableCameraIfNeeded = () => {
|
|
81
85
|
if (call?.camera?.state.status === 'enabled') {
|
|
86
|
+
cameraDisabledByAppState.current = true;
|
|
82
87
|
call?.camera?.disable();
|
|
83
88
|
}
|
|
84
89
|
};
|
|
@@ -108,6 +113,7 @@ export const AppStateListener = () => {
|
|
|
108
113
|
// shouldDisableIOSLocalVideoOnBackgroundRef is false, if local video is enabled on PiP
|
|
109
114
|
if (shouldDisableIOSLocalVideoOnBackgroundRef.current) {
|
|
110
115
|
if (call?.camera?.state.status === 'enabled') {
|
|
116
|
+
cameraDisabledByAppState.current = true;
|
|
111
117
|
call?.camera?.disable();
|
|
112
118
|
}
|
|
113
119
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.9.
|
|
1
|
+
export const version = '1.9.3';
|