@stream-io/video-react-native-sdk 1.10.12 → 1.10.13
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 +11 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +7 -17
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +34 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -0
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +9 -19
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +26 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -0
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +8 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -0
- package/dist/typescript/version.d.ts +1 -1
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +7 -0
- package/ios/RTCViewPip.swift +52 -25
- package/ios/RTCViewPipManager.swift +5 -5
- package/package.json +3 -3
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +15 -38
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +51 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.10.13](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.10.12...@stream-io/video-react-native-sdk-1.10.13) (2025-03-10)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@stream-io/video-client` updated to version `1.18.4`
|
|
10
|
+
* `@stream-io/video-react-bindings` updated to version `1.5.6`
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* ios PiP track not fetched sometimes ([#1709](https://github.com/GetStream/stream-video-js/issues/1709)) ([ec20f97](https://github.com/GetStream/stream-video-js/commit/ec20f97dbb305c50f315bcd1293b9f160cfa1408))
|
|
15
|
+
|
|
5
16
|
## [1.10.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.10.11...@stream-io/video-react-native-sdk-1.10.12) (2025-03-06)
|
|
6
17
|
|
|
7
18
|
|
|
@@ -8,23 +8,11 @@ var _videoClient = require("@stream-io/video-client");
|
|
|
8
8
|
var _videoReactBindings = require("@stream-io/video-react-bindings");
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
|
+
var _RTCViewPipNative = require("./RTCViewPipNative");
|
|
11
12
|
var _useDebouncedValue = require("../../../utils/hooks/useDebouncedValue");
|
|
12
13
|
var _shouldDisableIOSLocalVideoOnBackground = require("../../../utils/internal/shouldDisableIOSLocalVideoOnBackground");
|
|
13
14
|
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
15
|
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
|
-
const COMPONENT_NAME = 'RTCViewPip';
|
|
16
|
-
const RTCViewPipNative = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME);
|
|
17
|
-
|
|
18
|
-
/** Wrapper for the native view
|
|
19
|
-
* meant to stay private and not exposed */
|
|
20
|
-
const RTCViewPip = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
21
|
-
if (_reactNative.Platform.OS !== 'ios') return null;
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(RTCViewPipNative, {
|
|
24
|
-
streamURL: props.streamURL,
|
|
25
|
-
ref: ref
|
|
26
|
-
});
|
|
27
|
-
}));
|
|
28
16
|
const RTCViewPipIOS = /*#__PURE__*/_react.default.memo(({
|
|
29
17
|
includeLocalParticipantVideo
|
|
30
18
|
}) => {
|
|
@@ -58,17 +46,19 @@ const RTCViewPipIOS = /*#__PURE__*/_react.default.memo(({
|
|
|
58
46
|
callClosedInvokedOnce = true;
|
|
59
47
|
const node = (0, _reactNative.findNodeHandle)(nativeRef.current);
|
|
60
48
|
if (node !== null) {
|
|
61
|
-
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
_reactNative.UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed, []);
|
|
49
|
+
(0, _RTCViewPipNative.onNativeCallClosed)(node);
|
|
64
50
|
}
|
|
65
51
|
_shouldDisableIOSLocalVideoOnBackground.shouldDisableIOSLocalVideoOnBackgroundRef.current = true;
|
|
66
52
|
};
|
|
67
53
|
const unsubFunc = call?.on('call.ended', () => {
|
|
54
|
+
(0, _videoClient.getLogger)(['RTCViewPipIOS'])('debug', `onCallClosed due to call.ended event`);
|
|
55
|
+
unsubFunc?.();
|
|
68
56
|
onCallClosed();
|
|
69
57
|
});
|
|
70
58
|
const subscription = call?.state.callingState$.subscribe(state => {
|
|
71
59
|
if (state === _videoClient.CallingState.LEFT || state === _videoClient.CallingState.IDLE) {
|
|
60
|
+
(0, _videoClient.getLogger)(['RTCViewPipIOS'])('debug', `onCallClosed due to callingState: ${state}`);
|
|
61
|
+
subscription?.unsubscribe();
|
|
72
62
|
onCallClosed();
|
|
73
63
|
}
|
|
74
64
|
});
|
|
@@ -90,7 +80,7 @@ const RTCViewPipIOS = /*#__PURE__*/_react.default.memo(({
|
|
|
90
80
|
const videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
|
|
91
81
|
return videoStreamToRender?.toURL();
|
|
92
82
|
}, [participantInSpotlight]);
|
|
93
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_RTCViewPipNative.RTCViewPipNative, {
|
|
94
84
|
streamURL: streamURL,
|
|
95
85
|
ref: nativeRef
|
|
96
86
|
});
|
|
@@ -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","
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_interopRequireWildcard","_reactNative","_RTCViewPipNative","_useDebouncedValue","_shouldDisableIOSLocalVideoOnBackground","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","RTCViewPipIOS","React","memo","includeLocalParticipantVideo","useCall","useParticipants","useCallStateHooks","_allParticipants","sortBy","speakerLayoutSortPreset","allParticipants","useDebouncedValue","dominantSpeaker","dominantSpeaker2","filter","participant","isLocalParticipant","participantInSpotlight","useEffect","shouldDisableIOSLocalVideoOnBackgroundRef","current","nativeRef","useRef","callClosedInvokedOnce","onCallClosed","node","findNodeHandle","onNativeCallClosed","unsubFunc","on","getLogger","subscription","state","callingState$","subscribe","CallingState","LEFT","IDLE","unsubscribe","streamURL","useMemo","undefined","videoStream","screenShareStream","isScreenSharing","hasScreenShare","videoStreamToRender","toURL","createElement","RTCViewPipNative","ref","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,uCAAA,GAAAP,OAAA;AAA2H,SAAAQ,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,SAAAN,wBAAAM,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,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,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;IAE9D,MAAM6B,mBAAmB,GAAIF,eAAe,GACxCD,iBAAiB,GACjBD,WAAkD;IAEtD,OAAOI,mBAAmB,EAAEC,KAAK,CAAC,CAAC;EACrC,CAAC,EAAE,CAAC9B,sBAAsB,CAAC,CAAC;EAE5B,oBAAO3C,MAAA,CAAAY,OAAA,CAAA8D,aAAA,CAACvE,iBAAA,CAAAwE,gBAAgB;IAACV,SAAS,EAAEA,SAAU;IAACW,GAAG,EAAE7B;EAAU,CAAE,CAAC;AACnE,CAAC,CAAC;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEYc,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RTCViewPipNative = void 0;
|
|
7
|
+
exports.onNativeCallClosed = onNativeCallClosed;
|
|
8
|
+
var _videoClient = require("@stream-io/video-client");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const COMPONENT_NAME = 'RTCViewPip';
|
|
13
|
+
const NativeComponent = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME);
|
|
14
|
+
function onNativeCallClosed(reactTag) {
|
|
15
|
+
(0, _videoClient.getLogger)(['RTCViewPipNative'])('debug', 'onNativeCallClosed');
|
|
16
|
+
_reactNative.UIManager.dispatchViewManagerCommand(reactTag,
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
_reactNative.UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed, []);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Wrapper for the native view
|
|
22
|
+
* meant to stay private and not exposed */
|
|
23
|
+
const RTCViewPipNative = exports.RTCViewPipNative = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
24
|
+
if (_reactNative.Platform.OS !== 'ios') return null;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(NativeComponent, {
|
|
26
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
27
|
+
pointerEvents: 'none',
|
|
28
|
+
streamURL: props.streamURL
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
,
|
|
31
|
+
ref: ref
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
34
|
+
//# sourceMappingURL=RTCViewPipNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_react","_interopRequireDefault","_reactNative","e","__esModule","default","COMPONENT_NAME","NativeComponent","requireNativeComponent","onNativeCallClosed","reactTag","getLogger","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","onCallClosed","RTCViewPipNative","exports","React","memo","forwardRef","props","ref","Platform","OS","createElement","style","StyleSheet","absoluteFill","pointerEvents","streamURL"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipNative.tsx"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAMsB,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtB,MAAMG,cAAc,GAAG,YAAY;AAMnC,MAAMC,eAAqD,GACzD,IAAAC,mCAAsB,EAACF,cAAc,CAAC;AAEjC,SAASG,kBAAkBA,CAACC,QAAgB,EAAE;EACnD,IAAAC,sBAAS,EAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,EAAE,oBAAoB,CAAC;EAC9DC,sBAAS,CAACC,0BAA0B,CAClCH,QAAQ;EACR;EACAE,sBAAS,CAACE,oBAAoB,CAACR,cAAc,CAAC,CAACS,QAAQ,CAACC,YAAY,EACpE,EACF,CAAC;AACH;;AAEA;AACA;AACO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,gBAAGE,cAAK,CAACC,IAAI,cACxCD,cAAK,CAACE,UAAU,CAKd,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChB,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EAEtC,oBACEzB,MAAA,CAAAK,OAAA,CAAAqB,aAAA,CAACnB,eAAe;IACdoB,KAAK,EAAEC,uBAAU,CAACC,YAAa;IAC/BC,aAAa,EAAE,MAAO;IACtBC,SAAS,EAAET,KAAK,CAACS;IACjB;IAAA;IACAR,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CAAC,CACH,CAAC","ignoreList":[]}
|
package/dist/commonjs/version.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import { CallingState, hasScreenShare, speakerLayoutSortPreset } from '@stream-io/video-client';
|
|
1
|
+
import { CallingState, getLogger, hasScreenShare, speakerLayoutSortPreset } from '@stream-io/video-client';
|
|
2
2
|
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
3
3
|
import React, { useEffect, useMemo } from 'react';
|
|
4
|
-
import { findNodeHandle
|
|
4
|
+
import { findNodeHandle } from 'react-native';
|
|
5
|
+
import { RTCViewPipNative, onNativeCallClosed } from './RTCViewPipNative';
|
|
5
6
|
import { useDebouncedValue } from '../../../utils/hooks/useDebouncedValue';
|
|
6
7
|
import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../../../utils/internal/shouldDisableIOSLocalVideoOnBackground';
|
|
7
|
-
const COMPONENT_NAME = 'RTCViewPip';
|
|
8
|
-
const RTCViewPipNative = requireNativeComponent(COMPONENT_NAME);
|
|
9
|
-
|
|
10
|
-
/** Wrapper for the native view
|
|
11
|
-
* meant to stay private and not exposed */
|
|
12
|
-
const RTCViewPip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((props, ref) => {
|
|
13
|
-
if (Platform.OS !== 'ios') return null;
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
return /*#__PURE__*/React.createElement(RTCViewPipNative, {
|
|
16
|
-
streamURL: props.streamURL,
|
|
17
|
-
ref: ref
|
|
18
|
-
});
|
|
19
|
-
}));
|
|
20
8
|
const RTCViewPipIOS = /*#__PURE__*/React.memo(({
|
|
21
9
|
includeLocalParticipantVideo
|
|
22
10
|
}) => {
|
|
@@ -50,17 +38,19 @@ const RTCViewPipIOS = /*#__PURE__*/React.memo(({
|
|
|
50
38
|
callClosedInvokedOnce = true;
|
|
51
39
|
const node = findNodeHandle(nativeRef.current);
|
|
52
40
|
if (node !== null) {
|
|
53
|
-
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed, []);
|
|
41
|
+
onNativeCallClosed(node);
|
|
56
42
|
}
|
|
57
43
|
shouldDisableIOSLocalVideoOnBackgroundRef.current = true;
|
|
58
44
|
};
|
|
59
45
|
const unsubFunc = call?.on('call.ended', () => {
|
|
46
|
+
getLogger(['RTCViewPipIOS'])('debug', `onCallClosed due to call.ended event`);
|
|
47
|
+
unsubFunc?.();
|
|
60
48
|
onCallClosed();
|
|
61
49
|
});
|
|
62
50
|
const subscription = call?.state.callingState$.subscribe(state => {
|
|
63
51
|
if (state === CallingState.LEFT || state === CallingState.IDLE) {
|
|
52
|
+
getLogger(['RTCViewPipIOS'])('debug', `onCallClosed due to callingState: ${state}`);
|
|
53
|
+
subscription?.unsubscribe();
|
|
64
54
|
onCallClosed();
|
|
65
55
|
}
|
|
66
56
|
});
|
|
@@ -82,7 +72,7 @@ const RTCViewPipIOS = /*#__PURE__*/React.memo(({
|
|
|
82
72
|
const videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
|
|
83
73
|
return videoStreamToRender?.toURL();
|
|
84
74
|
}, [participantInSpotlight]);
|
|
85
|
-
return /*#__PURE__*/React.createElement(
|
|
75
|
+
return /*#__PURE__*/React.createElement(RTCViewPipNative, {
|
|
86
76
|
streamURL: streamURL,
|
|
87
77
|
ref: nativeRef
|
|
88
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CallingState","hasScreenShare","speakerLayoutSortPreset","useCall","useCallStateHooks","React","useEffect","useMemo","findNodeHandle","
|
|
1
|
+
{"version":3,"names":["CallingState","getLogger","hasScreenShare","speakerLayoutSortPreset","useCall","useCallStateHooks","React","useEffect","useMemo","findNodeHandle","RTCViewPipNative","onNativeCallClosed","useDebouncedValue","shouldDisableIOSLocalVideoOnBackgroundRef","RTCViewPipIOS","memo","includeLocalParticipantVideo","call","useParticipants","_allParticipants","sortBy","allParticipants","dominantSpeaker","dominantSpeaker2","filter","participant","isLocalParticipant","participantInSpotlight","current","nativeRef","useRef","callClosedInvokedOnce","onCallClosed","node","unsubFunc","on","subscription","state","callingState$","subscribe","LEFT","IDLE","unsubscribe","streamURL","undefined","videoStream","screenShareStream","isScreenSharing","videoStreamToRender","toURL","createElement","ref"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipIOS.tsx"],"mappings":"AAAA,SACEA,YAAY,EACZC,SAAS,EACTC,cAAc,EACdC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAE5E,OAAOC,KAAK,IAAIC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACjD,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,oBAAoB;AACzE,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,yCAAyC,QAAQ,gEAAgE;AAM1H,MAAMC,aAAa,gBAAGR,KAAK,CAACS,IAAI,CAAC,CAAC;EAAEC;AAAoC,CAAC,KAAK;EAC5E,MAAMC,IAAI,GAAGb,OAAO,CAAC,CAAC;EACtB,MAAM;IAAEc;EAAgB,CAAC,GAAGb,iBAAi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AAC,CAAC;IACF,MAAMI,YAAY,GAAGnB,IAAI,EAAEoB,KAAK,CAACC,aAAa,CAACC,SAAS,CAAEF,KAAK,IAAK;MAClE,IAAIA,KAAK,KAAKrC,YAAY,CAACwC,IAAI,IAAIH,KAAK,KAAKrC,YAAY,CAACyC,IAAI,EAAE;QAC9DxC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAC1B,OAAO,EACP,qCAAqCoC,KAAK,EAC5C,CAAC;QACDD,YAAY,EAAEM,WAAW,CAAC,CAAC;QAC3BV,YAAY,CAAC,CAAC;MAChB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACXA,YAAY,CAAC,CAAC;MACdE,SAAS,GAAG,CAAC;MACbE,YAAY,EAAEM,WAAW,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACzB,IAAI,CAAC,CAAC;EAEV,MAAM0B,SAAS,GAAGnC,OAAO,CAAC,MAAM;IAC9B,IAAI,CAACmB,sBAAsB,EAAE;MAC3B,OAAOiB,SAAS;IAClB;IAEA,MAAM;MAAEC,WAAW;MAAEC;IAAkB,CAAC,GAAGnB,sBAAsB;IAEjE,MAAMoB,eAAe,GAAG7C,cAAc,CAACyB,sBAAsB,CAAC;IAE9D,MAAMqB,mBAAmB,GAAID,eAAe,GACxCD,iBAAiB,GACjBD,WAAkD;IAEtD,OAAOG,mBAAmB,EAAEC,KAAK,CAAC,CAAC;EACrC,CAAC,EAAE,CAACtB,sBAAsB,CAAC,CAAC;EAE5B,oBAAOrB,KAAA,CAAA4C,aAAA,CAACxC,gBAAgB;IAACiC,SAAS,EAAEA,SAAU;IAACQ,GAAG,EAAEtB;EAAU,CAAE,CAAC;AACnE,CAAC,CAAC;AAEF,eAAef,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getLogger } from '@stream-io/video-client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Platform, requireNativeComponent, UIManager, StyleSheet } from 'react-native';
|
|
4
|
+
const COMPONENT_NAME = 'RTCViewPip';
|
|
5
|
+
const NativeComponent = requireNativeComponent(COMPONENT_NAME);
|
|
6
|
+
export function onNativeCallClosed(reactTag) {
|
|
7
|
+
getLogger(['RTCViewPipNative'])('debug', 'onNativeCallClosed');
|
|
8
|
+
UIManager.dispatchViewManagerCommand(reactTag,
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed, []);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Wrapper for the native view
|
|
14
|
+
* meant to stay private and not exposed */
|
|
15
|
+
export const RTCViewPipNative = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
|
+
if (Platform.OS !== 'ios') return null;
|
|
17
|
+
return /*#__PURE__*/React.createElement(NativeComponent, {
|
|
18
|
+
style: StyleSheet.absoluteFill,
|
|
19
|
+
pointerEvents: 'none',
|
|
20
|
+
streamURL: props.streamURL
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
,
|
|
23
|
+
ref: ref
|
|
24
|
+
});
|
|
25
|
+
}));
|
|
26
|
+
//# sourceMappingURL=RTCViewPipNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getLogger","React","Platform","requireNativeComponent","UIManager","StyleSheet","COMPONENT_NAME","NativeComponent","onNativeCallClosed","reactTag","dispatchViewManagerCommand","getViewManagerConfig","Commands","onCallClosed","RTCViewPipNative","memo","forwardRef","props","ref","OS","createElement","style","absoluteFill","pointerEvents","streamURL"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/RTCViewPipNative.tsx"],"mappings":"AAAA,SAASA,SAAS,QAAQ,yBAAyB;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAEEC,QAAQ,EACRC,sBAAsB,EACtBC,SAAS,EACTC,UAAU,QACL,cAAc;AAErB,MAAMC,cAAc,GAAG,YAAY;AAMnC,MAAMC,eAAqD,GACzDJ,sBAAsB,CAACG,cAAc,CAAC;AAExC,OAAO,SAASE,kBAAkBA,CAACC,QAAgB,EAAE;EACnDT,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,EAAE,oBAAoB,CAAC;EAC9DI,SAAS,CAACM,0BAA0B,CAClCD,QAAQ;EACR;EACAL,SAAS,CAACO,oBAAoB,CAACL,cAAc,CAAC,CAACM,QAAQ,CAACC,YAAY,EACpE,EACF,CAAC;AACH;;AAEA;AACA;AACA,OAAO,MAAMC,gBAAgB,gBAAGb,KAAK,CAACc,IAAI,cACxCd,KAAK,CAACe,UAAU,CAKd,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChB,IAAIhB,QAAQ,CAACiB,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EAEtC,oBACElB,KAAA,CAAAmB,aAAA,CAACb,eAAe;IACdc,KAAK,EAAEhB,UAAU,CAACiB,YAAa;IAC/BC,aAAa,EAAE,MAAO;IACtBC,SAAS,EAAEP,KAAK,CAACO;IACjB;IAAA;IACAN,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CAAC,CACH,CAAC","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.10.
|
|
1
|
+
export const version = '1.10.13';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAMlD,KAAK,KAAK,GAAG;IACX,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,QAAA,MAAM,aAAa,+DAAiD,KAAK,uBAkFvE,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function onNativeCallClosed(reactTag: number): void;
|
|
3
|
+
/** Wrapper for the native view
|
|
4
|
+
* meant to stay private and not exposed */
|
|
5
|
+
export declare const RTCViewPipNative: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
6
|
+
streamURL?: string;
|
|
7
|
+
} & React.RefAttributes<React.Ref<any>>>>;
|
|
8
|
+
//# sourceMappingURL=RTCViewPipNative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,QAQlD;AAED;2CAC2C;AAC3C,eAAO,MAAM,gBAAgB;gBAIX,MAAM;yCAevB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.10.
|
|
1
|
+
export declare const version = "1.10.13";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -104,6 +104,7 @@ import Foundation
|
|
|
104
104
|
_ pictureInPictureController: AVPictureInPictureController,
|
|
105
105
|
failedToStartPictureInPictureWithError error: Error
|
|
106
106
|
) {
|
|
107
|
+
NSLog("PiP - failedToStartPictureInPictureWithError:\(error)")
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
public func pictureInPictureControllerWillStopPictureInPicture(
|
|
@@ -184,4 +185,10 @@ import Foundation
|
|
|
184
185
|
private func didUpdatePictureInPictureActiveState(_ isActive: Bool) {
|
|
185
186
|
trackStateAdapter.isEnabled = isActive
|
|
186
187
|
}
|
|
188
|
+
|
|
189
|
+
func stopPictureInPicture() {
|
|
190
|
+
if (pictureInPictureController?.isPictureInPictureActive ?? false) {
|
|
191
|
+
pictureInPictureController?.stopPictureInPicture()
|
|
192
|
+
}
|
|
193
|
+
}
|
|
187
194
|
}
|
package/ios/RTCViewPip.swift
CHANGED
|
@@ -10,52 +10,76 @@ import Foundation
|
|
|
10
10
|
@objc(RTCViewPip)
|
|
11
11
|
class RTCViewPip: UIView {
|
|
12
12
|
|
|
13
|
-
private
|
|
13
|
+
private var pictureInPictureController = StreamPictureInPictureController()
|
|
14
14
|
private var webRtcModule: WebRTCModule?
|
|
15
15
|
|
|
16
16
|
override init(frame: CGRect) {
|
|
17
17
|
super.init(frame: frame)
|
|
18
|
-
|
|
18
|
+
setupNotificationObserver()
|
|
19
|
+
self.pictureInPictureController?.sourceView = self
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
required init?(coder aDecoder: NSCoder) {
|
|
22
23
|
super.init(coder: aDecoder)
|
|
23
|
-
|
|
24
|
+
setupNotificationObserver()
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
private func
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
private func setupNotificationObserver() {
|
|
28
|
+
NotificationCenter.default.addObserver(
|
|
29
|
+
self,
|
|
30
|
+
selector: #selector(appBecameActive),
|
|
31
|
+
name: UIApplication.didBecomeActiveNotification,
|
|
32
|
+
object: nil
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
deinit {
|
|
37
|
+
NotificationCenter.default.removeObserver(self)
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
func setWebRtcModule(_ module: WebRTCModule) {
|
|
34
41
|
webRtcModule = module
|
|
35
42
|
}
|
|
36
43
|
|
|
37
|
-
@objc
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
@objc public var streamURL: NSString? = nil {
|
|
45
|
+
didSet {
|
|
46
|
+
// https://github.com/react-native-webrtc/react-native-webrtc/blob/8dfc9c394b4bf627c0214255466ebd3b160ca563/ios/RCTWebRTC/RTCVideoViewManager.m#L405-L418
|
|
47
|
+
guard let streamURLString = streamURL as String? else {
|
|
48
|
+
NSLog("PiP - No streamURL set")
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
guard let stream = self.webRtcModule?.stream(forReactTag: streamURLString) else {
|
|
53
|
+
NSLog("PiP - No stream for streamURL: -\(streamURLString)")
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
guard let videoTrack = stream.videoTracks.first else {
|
|
58
|
+
NSLog("PiP - No video track for streamURL: -\(streamURLString)")
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
if (self.pictureInPictureController?.track == videoTrack) {
|
|
62
|
+
NSLog("PiP - Skipping video track for streamURL: -\(streamURLString)")
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
DispatchQueue.main.async {
|
|
67
|
+
NSLog("PiP - Setting video track for streamURL: -\(streamURLString)")
|
|
68
|
+
self.pictureInPictureController?.track = videoTrack
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
71
|
}
|
|
52
72
|
|
|
73
|
+
@objc func appBecameActive() {
|
|
74
|
+
self.pictureInPictureController?.stopPictureInPicture()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
53
78
|
@objc
|
|
54
79
|
func onCallClosed() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
80
|
+
NSLog("PiP - pictureInPictureController cleanup called")
|
|
81
|
+
self.pictureInPictureController?.cleanup()
|
|
82
|
+
self.pictureInPictureController = nil
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
override func didMoveToWindow() {
|
|
@@ -64,7 +88,10 @@ class RTCViewPip: UIView {
|
|
|
64
88
|
if (!isVisible) {
|
|
65
89
|
// view is detached so we cleanup the pip controller
|
|
66
90
|
// taken from: https://github.com/software-mansion/react-native-screens/blob/main/Example/ios/ScreensExample/RNSSampleLifecycleAwareView.m
|
|
67
|
-
|
|
91
|
+
DispatchQueue.main.async {
|
|
92
|
+
NSLog("PiP - onCallClosed called due to view detaching")
|
|
93
|
+
self.onCallClosed()
|
|
94
|
+
}
|
|
68
95
|
}
|
|
69
96
|
}
|
|
70
97
|
}
|
|
@@ -22,13 +22,13 @@ class RTCViewPipManager: RCTViewManager {
|
|
|
22
22
|
|
|
23
23
|
@objc func onCallClosed(_ reactTag: NSNumber) {
|
|
24
24
|
self.bridge!.uiManager.addUIBlock { (_: RCTUIManager?, viewRegistry: [NSNumber: UIView]?) in
|
|
25
|
-
guard let
|
|
26
|
-
|
|
27
|
-
print("Invalid view returned from registry, expecting RTCViewPip")
|
|
28
|
-
}
|
|
25
|
+
guard let pipView = viewRegistry?[reactTag] as? RTCViewPip else {
|
|
26
|
+
NSLog("PiP - onCallClosed cant be called, Invalid view returned from registry, expecting RTCViewPip")
|
|
29
27
|
return
|
|
30
28
|
}
|
|
31
|
-
|
|
29
|
+
DispatchQueue.main.async {
|
|
30
|
+
pipView.onCallClosed()
|
|
31
|
+
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-native-sdk",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.13",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"description": "Stream Video SDK for React Native",
|
|
6
6
|
"author": "https://getstream.io",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"!**/.*"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@stream-io/video-client": "1.18.
|
|
50
|
-
"@stream-io/video-react-bindings": "1.5.
|
|
49
|
+
"@stream-io/video-client": "1.18.4",
|
|
50
|
+
"@stream-io/video-react-bindings": "1.5.6",
|
|
51
51
|
"intl-pluralrules": "2.0.1",
|
|
52
52
|
"lodash.merge": "^4.6.2",
|
|
53
53
|
"react-native-url-polyfill": "1.3.0",
|
|
@@ -1,45 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CallingState,
|
|
3
|
+
getLogger,
|
|
3
4
|
hasScreenShare,
|
|
4
5
|
speakerLayoutSortPreset,
|
|
5
6
|
} from '@stream-io/video-client';
|
|
6
7
|
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
7
8
|
import type { MediaStream } from '@stream-io/react-native-webrtc';
|
|
8
9
|
import React, { useEffect, useMemo } from 'react';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
type HostComponent,
|
|
12
|
-
Platform,
|
|
13
|
-
requireNativeComponent,
|
|
14
|
-
UIManager,
|
|
15
|
-
} from 'react-native';
|
|
10
|
+
import { findNodeHandle } from 'react-native';
|
|
11
|
+
import { RTCViewPipNative, onNativeCallClosed } from './RTCViewPipNative';
|
|
16
12
|
import { useDebouncedValue } from '../../../utils/hooks/useDebouncedValue';
|
|
17
13
|
import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../../../utils/internal/shouldDisableIOSLocalVideoOnBackground';
|
|
18
14
|
|
|
19
|
-
const COMPONENT_NAME = 'RTCViewPip';
|
|
20
|
-
|
|
21
|
-
type RTCViewPipNativeProps = {
|
|
22
|
-
streamURL?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const RTCViewPipNative: HostComponent<RTCViewPipNativeProps> =
|
|
26
|
-
requireNativeComponent(COMPONENT_NAME);
|
|
27
|
-
|
|
28
|
-
/** Wrapper for the native view
|
|
29
|
-
* meant to stay private and not exposed */
|
|
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
|
-
);
|
|
42
|
-
|
|
43
15
|
type Props = {
|
|
44
16
|
includeLocalParticipantVideo?: boolean;
|
|
45
17
|
};
|
|
@@ -80,20 +52,25 @@ const RTCViewPipIOS = React.memo(({ includeLocalParticipantVideo }: Props) => {
|
|
|
80
52
|
callClosedInvokedOnce = true;
|
|
81
53
|
const node = findNodeHandle(nativeRef.current);
|
|
82
54
|
if (node !== null) {
|
|
83
|
-
|
|
84
|
-
node,
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed,
|
|
87
|
-
[]
|
|
88
|
-
);
|
|
55
|
+
onNativeCallClosed(node);
|
|
89
56
|
}
|
|
90
57
|
shouldDisableIOSLocalVideoOnBackgroundRef.current = true;
|
|
91
58
|
};
|
|
92
59
|
const unsubFunc = call?.on('call.ended', () => {
|
|
60
|
+
getLogger(['RTCViewPipIOS'])(
|
|
61
|
+
'debug',
|
|
62
|
+
`onCallClosed due to call.ended event`
|
|
63
|
+
);
|
|
64
|
+
unsubFunc?.();
|
|
93
65
|
onCallClosed();
|
|
94
66
|
});
|
|
95
67
|
const subscription = call?.state.callingState$.subscribe((state) => {
|
|
96
68
|
if (state === CallingState.LEFT || state === CallingState.IDLE) {
|
|
69
|
+
getLogger(['RTCViewPipIOS'])(
|
|
70
|
+
'debug',
|
|
71
|
+
`onCallClosed due to callingState: ${state}`
|
|
72
|
+
);
|
|
73
|
+
subscription?.unsubscribe();
|
|
97
74
|
onCallClosed();
|
|
98
75
|
}
|
|
99
76
|
});
|
|
@@ -120,7 +97,7 @@ const RTCViewPipIOS = React.memo(({ includeLocalParticipantVideo }: Props) => {
|
|
|
120
97
|
return videoStreamToRender?.toURL();
|
|
121
98
|
}, [participantInSpotlight]);
|
|
122
99
|
|
|
123
|
-
return <
|
|
100
|
+
return <RTCViewPipNative streamURL={streamURL} ref={nativeRef} />;
|
|
124
101
|
});
|
|
125
102
|
|
|
126
103
|
export default RTCViewPipIOS;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getLogger } from '@stream-io/video-client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
type HostComponent,
|
|
5
|
+
Platform,
|
|
6
|
+
requireNativeComponent,
|
|
7
|
+
UIManager,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_NAME = 'RTCViewPip';
|
|
12
|
+
|
|
13
|
+
type RTCViewPipNativeProps = {
|
|
14
|
+
streamURL?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const NativeComponent: HostComponent<RTCViewPipNativeProps> =
|
|
18
|
+
requireNativeComponent(COMPONENT_NAME);
|
|
19
|
+
|
|
20
|
+
export function onNativeCallClosed(reactTag: number) {
|
|
21
|
+
getLogger(['RTCViewPipNative'])('debug', 'onNativeCallClosed');
|
|
22
|
+
UIManager.dispatchViewManagerCommand(
|
|
23
|
+
reactTag,
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.onCallClosed,
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Wrapper for the native view
|
|
31
|
+
* meant to stay private and not exposed */
|
|
32
|
+
export const RTCViewPipNative = React.memo(
|
|
33
|
+
React.forwardRef<
|
|
34
|
+
React.Ref<any>,
|
|
35
|
+
{
|
|
36
|
+
streamURL?: string;
|
|
37
|
+
}
|
|
38
|
+
>((props, ref) => {
|
|
39
|
+
if (Platform.OS !== 'ios') return null;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<NativeComponent
|
|
43
|
+
style={StyleSheet.absoluteFill}
|
|
44
|
+
pointerEvents={'none'}
|
|
45
|
+
streamURL={props.streamURL}
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
ref={ref}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
);
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.10.
|
|
1
|
+
export const version = '1.10.13';
|