@stream-io/video-react-native-sdk 2.0.0-beta.0 → 2.0.0-beta.2
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 +95 -0
- package/README.md +15 -0
- package/android/build.gradle +7 -1
- package/android/src/main/java/com/streamvideo/reactnative/audio/AudioDeviceManager.kt +110 -58
- package/android/src/main/java/com/streamvideo/reactnative/audio/CommunicationModeKeepAlive.kt +247 -0
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +16 -5
- package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -1
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +78 -7
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +3 -2
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +4 -3
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js +10 -10
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js +3 -3
- package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js +3 -3
- package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +3 -2
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +7 -14
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +3 -3
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +27 -4
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/commonjs/components/utility/ScreenShareOverlay.js +4 -3
- package/dist/commonjs/components/utility/ScreenShareOverlay.js.map +1 -1
- package/dist/commonjs/i18n/Streami18n.js +77 -0
- package/dist/commonjs/i18n/Streami18n.js.map +1 -0
- package/dist/commonjs/i18n/TranslationContext.js +52 -0
- package/dist/commonjs/i18n/TranslationContext.js.map +1 -0
- package/dist/commonjs/i18n/index.js +85 -0
- package/dist/commonjs/i18n/index.js.map +1 -0
- package/dist/commonjs/i18n/keys.js +2 -0
- package/dist/commonjs/i18n/keys.js.map +1 -0
- package/dist/commonjs/i18n/runtimeDefaults.js +24 -0
- package/dist/commonjs/i18n/runtimeDefaults.js.map +1 -0
- package/dist/commonjs/i18n/types.js +6 -0
- package/dist/commonjs/i18n/types.js.map +1 -0
- package/dist/commonjs/i18n/useStreami18n.js +61 -0
- package/dist/commonjs/i18n/useStreami18n.js.map +1 -0
- package/dist/commonjs/index.js +18 -5
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/encryption/EncryptionManager.js +305 -0
- package/dist/commonjs/modules/encryption/EncryptionManager.js.map +1 -0
- package/dist/commonjs/modules/encryption/eventMapping.js +143 -0
- package/dist/commonjs/modules/encryption/eventMapping.js.map +1 -0
- package/dist/commonjs/modules/encryption/index.js +13 -0
- package/dist/commonjs/modules/encryption/index.js.map +1 -0
- package/dist/commonjs/modules/encryption/parity.js +6 -0
- package/dist/commonjs/modules/encryption/parity.js.map +1 -0
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/commonjs/providers/StreamVideo.js +28 -12
- package/dist/commonjs/providers/StreamVideo.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +46 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +29 -4
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/internal/iosPipTrack.js +41 -0
- package/dist/commonjs/utils/internal/iosPipTrack.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +6 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/internal/ringingCallLifecycle.js +142 -0
- package/dist/commonjs/utils/internal/ringingCallLifecycle.js.map +1 -0
- package/dist/commonjs/utils/push/internal/utils.js +4 -0
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +80 -9
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/Lobby/JoinCallButton.js +3 -2
- package/dist/module/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +4 -3
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyFooter.js +10 -10
- package/dist/module/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js +2 -2
- package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js +2 -2
- package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js +3 -2
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +7 -14
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +2 -2
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +28 -5
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/module/components/utility/ScreenShareOverlay.js +4 -3
- package/dist/module/components/utility/ScreenShareOverlay.js.map +1 -1
- package/dist/module/i18n/Streami18n.js +73 -0
- package/dist/module/i18n/Streami18n.js.map +1 -0
- package/dist/module/i18n/TranslationContext.js +48 -0
- package/dist/module/i18n/TranslationContext.js.map +1 -0
- package/dist/module/i18n/index.js +20 -0
- package/dist/module/i18n/index.js.map +1 -0
- package/dist/module/i18n/keys.js +2 -0
- package/dist/module/i18n/keys.js.map +1 -0
- package/dist/module/i18n/runtimeDefaults.js +20 -0
- package/dist/module/i18n/runtimeDefaults.js.map +1 -0
- package/dist/module/i18n/types.js +4 -0
- package/dist/module/i18n/types.js.map +1 -0
- package/dist/module/i18n/useStreami18n.js +56 -0
- package/dist/module/i18n/useStreami18n.js.map +1 -0
- package/dist/module/index.js +6 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/encryption/EncryptionManager.js +301 -0
- package/dist/module/modules/encryption/EncryptionManager.js.map +1 -0
- package/dist/module/modules/encryption/eventMapping.js +135 -0
- package/dist/module/modules/encryption/eventMapping.js.map +1 -0
- package/dist/module/modules/encryption/index.js +4 -0
- package/dist/module/modules/encryption/index.js.map +1 -0
- package/dist/module/modules/encryption/parity.js +4 -0
- package/dist/module/modules/encryption/parity.js.map +1 -0
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/module/providers/StreamVideo.js +29 -14
- package/dist/module/providers/StreamVideo.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +46 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +29 -4
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/internal/iosPipTrack.js +35 -0
- package/dist/module/utils/internal/iosPipTrack.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +6 -0
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/internal/ringingCallLifecycle.js +134 -0
- package/dist/module/utils/internal/ringingCallLifecycle.js.map +1 -0
- package/dist/module/utils/push/internal/utils.js +4 -0
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- 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 +12 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/JoinCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamEnded.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLobby.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts +11 -0
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
- package/dist/typescript/components/utility/ScreenShareOverlay.d.ts.map +1 -1
- package/dist/typescript/i18n/Streami18n.d.ts +61 -0
- package/dist/typescript/i18n/Streami18n.d.ts.map +1 -0
- package/dist/typescript/i18n/TranslationContext.d.ts +31 -0
- package/dist/typescript/i18n/TranslationContext.d.ts.map +1 -0
- package/dist/typescript/i18n/index.d.ts +17 -0
- package/dist/typescript/i18n/index.d.ts.map +1 -0
- package/dist/typescript/i18n/keys.d.ts +38 -0
- package/dist/typescript/i18n/keys.d.ts.map +1 -0
- package/dist/typescript/i18n/runtimeDefaults.d.ts +18 -0
- package/dist/typescript/i18n/runtimeDefaults.d.ts.map +1 -0
- package/dist/typescript/i18n/types.d.ts +46 -0
- package/dist/typescript/i18n/types.d.ts.map +1 -0
- package/dist/typescript/i18n/useStreami18n.d.ts +20 -0
- package/dist/typescript/i18n/useStreami18n.d.ts.map +1 -0
- package/dist/typescript/index.d.ts +2 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/encryption/EncryptionManager.d.ts +190 -0
- package/dist/typescript/modules/encryption/EncryptionManager.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/eventMapping.d.ts +38 -0
- package/dist/typescript/modules/encryption/eventMapping.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/index.d.ts +2 -0
- package/dist/typescript/modules/encryption/index.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/parity.d.ts +55 -0
- package/dist/typescript/modules/encryption/parity.d.ts.map +1 -0
- package/dist/typescript/providers/NoiseCancellation/NoiseCancellationProvider.d.ts.map +1 -1
- package/dist/typescript/providers/StreamVideo.d.ts +17 -4
- package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +33 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +67 -0
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/internal/iosPipTrack.d.ts +9 -0
- package/dist/typescript/utils/internal/iosPipTrack.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts +27 -0
- package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts.map +1 -0
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/RTCViewPip.swift +33 -8
- package/ios/RTCViewPipManager.mm +1 -0
- package/package.json +17 -13
- package/src/components/Call/CallContent/CallContent.tsx +1 -1
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +92 -10
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +13 -0
- package/src/components/Call/Lobby/JoinCallButton.tsx +5 -2
- package/src/components/Call/Lobby/Lobby.tsx +6 -3
- package/src/components/Call/Lobby/LobbyFooter.tsx +15 -10
- package/src/components/Call/RingingCallContent/CallLeftIndicator.tsx +2 -2
- package/src/components/Call/RingingCallContent/CallPreparingIndicator.tsx +2 -2
- package/src/components/Call/RingingCallContent/IncomingCall.tsx +2 -2
- package/src/components/Call/RingingCallContent/OutgoingCall.tsx +7 -14
- package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +5 -8
- package/src/components/Livestream/LivestreamPlayer/LivestreamEnded.tsx +11 -3
- package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +2 -2
- package/src/components/Livestream/ViewerLivestream/ViewerLobby.tsx +23 -10
- package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +15 -6
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +58 -5
- package/src/components/utility/ScreenShareOverlay.tsx +7 -3
- package/src/i18n/Streami18n.ts +71 -0
- package/src/i18n/TranslationContext.tsx +55 -0
- package/src/i18n/index.ts +22 -0
- package/src/i18n/keys.ts +42 -0
- package/src/i18n/runtimeDefaults.ts +17 -0
- package/src/i18n/types.ts +78 -0
- package/src/i18n/useStreami18n.ts +66 -0
- package/src/index.ts +6 -1
- package/src/modules/call-manager/native-module.d.ts +14 -0
- package/src/modules/encryption/EncryptionManager.ts +360 -0
- package/src/modules/encryption/eventMapping.ts +151 -0
- package/src/modules/encryption/index.ts +1 -0
- package/src/modules/encryption/parity.ts +83 -0
- package/src/providers/NoiseCancellation/NoiseCancellationProvider.tsx +8 -4
- package/src/providers/StreamVideo.tsx +39 -28
- package/src/utils/StreamVideoRN/index.ts +51 -1
- package/src/utils/StreamVideoRN/types.ts +68 -0
- package/src/utils/internal/callingx/callingx.ts +37 -2
- package/src/utils/internal/iosPipTrack.ts +39 -0
- package/src/utils/internal/registerSDKGlobals.ts +2 -0
- package/src/utils/internal/ringingCallLifecycle.ts +148 -0
- package/src/utils/push/internal/utils.ts +4 -0
- package/src/version.ts +1 -1
- package/dist/commonjs/translations/en.json +0 -32
- package/dist/commonjs/translations/index.js +0 -12
- package/dist/commonjs/translations/index.js.map +0 -1
- package/dist/module/translations/en.json +0 -32
- package/dist/module/translations/index.js +0 -7
- package/dist/module/translations/index.js.map +0 -1
- package/dist/typescript/translations/index.d.ts +0 -35
- package/dist/typescript/translations/index.d.ts.map +0 -1
- package/src/translations/en.json +0 -32
- package/src/translations/index.ts +0 -3
|
@@ -4,28 +4,43 @@ import { StreamVideoProvider } from '@stream-io/video-react-bindings';
|
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import NetInfo from '@react-native-community/netinfo';
|
|
6
6
|
import { usePushRegisterEffect } from '../hooks';
|
|
7
|
-
import {
|
|
7
|
+
import { TranslationProvider, useStreami18n } from '../i18n';
|
|
8
8
|
import { StreamTheme } from '../contexts/ThemeContext';
|
|
9
9
|
import { ScreenshotIosContextProvider } from '../contexts/internal/ScreenshotIosContext';
|
|
10
10
|
import BusyTonePlayer from './BusyTonePlayer';
|
|
11
|
-
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
|
+
* StreamVideo is the root provider of the SDK: it provides the client to the component tree and
|
|
14
|
+
* mounts the SDK's translation context.
|
|
15
|
+
*
|
|
16
|
+
* The i18n runtime lives here rather than in `@stream-io/video-react-bindings` because the
|
|
17
|
+
* translation key catalog is generated from *this* package's `t()` call sites.
|
|
18
|
+
*
|
|
19
|
+
* There used to be a `translationsOverrides = translations` default parameter here, which was a
|
|
20
|
+
* bug: an integrator passing their own dictionaries *replaced* the SDK's bundled strings instead
|
|
21
|
+
* of merging with them, leaving every untranslated key rendering as a raw dotted path.
|
|
22
|
+
* `useStreami18n` layers integrator dictionaries over the SDK's own defaults, so a partial
|
|
23
|
+
* dictionary is now safe.
|
|
13
24
|
*
|
|
14
25
|
* @param props
|
|
15
26
|
* @returns
|
|
16
27
|
*
|
|
17
28
|
* @category Client State
|
|
18
29
|
*/
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
30
|
export const StreamVideo = props => {
|
|
21
31
|
const {
|
|
22
32
|
client,
|
|
23
33
|
children,
|
|
24
|
-
translationsOverrides = translations,
|
|
25
34
|
i18nInstance,
|
|
26
35
|
language,
|
|
36
|
+
translations,
|
|
27
37
|
style
|
|
28
38
|
} = props;
|
|
39
|
+
const translationContext = useStreami18n({
|
|
40
|
+
i18nInstance,
|
|
41
|
+
language,
|
|
42
|
+
translations
|
|
43
|
+
});
|
|
29
44
|
|
|
30
45
|
/**
|
|
31
46
|
* Effect to inform the coordinator about the online status of the app
|
|
@@ -48,17 +63,17 @@ export const StreamVideo = props => {
|
|
|
48
63
|
});
|
|
49
64
|
});
|
|
50
65
|
}, [client]);
|
|
51
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/_jsx(StreamVideoProvider, {
|
|
52
67
|
client: client,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
})
|
|
68
|
+
children: /*#__PURE__*/_jsxs(TranslationProvider, {
|
|
69
|
+
value: translationContext,
|
|
70
|
+
children: [/*#__PURE__*/_jsx(PushRegister, {}), /*#__PURE__*/_jsx(BusyTonePlayer, {}), /*#__PURE__*/_jsx(StreamTheme, {
|
|
71
|
+
style: style,
|
|
72
|
+
children: /*#__PURE__*/_jsx(ScreenshotIosContextProvider, {
|
|
73
|
+
children: children
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
62
77
|
});
|
|
63
78
|
};
|
|
64
79
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StreamVideoProvider","React","useEffect","NetInfo","usePushRegisterEffect","
|
|
1
|
+
{"version":3,"names":["StreamVideoProvider","React","useEffect","NetInfo","usePushRegisterEffect","TranslationProvider","useStreami18n","StreamTheme","ScreenshotIosContextProvider","BusyTonePlayer","jsx","_jsx","jsxs","_jsxs","StreamVideo","props","client","children","i18nInstance","language","translations","style","translationContext","prevIsOnline","addEventListener","state","isConnected","isInternetReachable","isOnline","type","streamClient","updateNetworkConnectionStatus","value","PushRegister"],"sourceRoot":"../../../src","sources":["providers/StreamVideo.tsx"],"mappings":";;AAAA,SAEEA,mBAAmB,QACd,iCAAiC;AACxC,OAAOC,KAAK,IAA4BC,SAAS,QAAQ,OAAO;AAChE,OAAOC,OAAO,MAAM,iCAAiC;AACrD,SAASC,qBAAqB,QAAQ,UAAU;AAChD,SACEC,mBAAmB,EACnBC,aAAa,QAER,SAAS;AAChB,SAA2BC,WAAW,QAAQ,0BAA0B;AAExE,SAASC,4BAA4B,QAAQ,2CAA2C;AACxF,OAAOC,cAAc,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAIC,KAA0C,IAAK;EACzE,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAEC,YAAY;IAAEC,QAAQ;IAAEC,YAAY;IAAEC;EAAM,CAAC,GACrEN,KAAK;EAEP,MAAMO,kBAAkB,GAAGhB,aAAa,CAAC;IACvCY,YAAY;IACZC,QAAQ;IACRC;EACF,CAAC,CAAC;;EAEF;AACF;AACA;EACElB,SAAS,CAAC,MAAM;IACd,IAAIqB,YAAY,GAAG,IAAI;IACvB,OAAOpB,OAAO,CAACqB,gBAAgB,CAAEC,KAAK,IAAK;MACzC,MAAM;QAAEC,WAAW;QAAEC;MAAoB,CAAC,GAAGF,KAAK;MAClD,MAAMG,QAAQ,GAAGF,WAAW,KAAK,IAAI,IAAIC,mBAAmB,KAAK,KAAK;MACtE,IAAIC,QAAQ,KAAKL,YAAY,EAAE;QAC7B;MACF;MACAA,YAAY,GAAGK,QAAQ;MACvB,MAAMC,IAAI,GAAGD,QAAQ,GAAG,QAAQ,GAAG,SAAS;MAC5CZ,MAAM,CAACc,YAAY,CAACC,6BAA6B,CAAC;QAAEF;MAAK,CAAC,CAAC;IAC7D,CAAC,CAAC;EACJ,CAAC,EAAE,CAACb,MAAM,CAAC,CAAC;EAEZ,oBACEL,IAAA,CAACX,mBAAmB;IAACgB,MAAM,EAAEA,MAAO;IAAAC,QAAA,eAClCJ,KAAA,CAACR,mBAAmB;MAAC2B,KAAK,EAAEV,kBAAmB;MAAAL,QAAA,gBAC7CN,IAAA,CAACsB,YAAY,IAAE,CAAC,eAChBtB,IAAA,CAACF,cAAc,IAAE,CAAC,eAClBE,IAAA,CAACJ,WAAW;QAACc,KAAK,EAAEA,KAAM;QAAAJ,QAAA,eACxBN,IAAA,CAACH,4BAA4B;UAAAS,QAAA,EAC1BA;QAAQ,CACmB;MAAC,CACpB,CAAC;IAAA,CACK;EAAC,CACH,CAAC;AAE1B,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMgB,YAAY,GAAGA,CAAA,KAAM;EACzB7B,qBAAqB,CAAC,CAAC;EACvB,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { setRingingCallLifecycleHooks as storeRingingCallLifecycleHooks } from '../internal/ringingCallLifecycle';
|
|
3
4
|
import pushLogoutCallbacks from '../internal/pushLogoutCallback';
|
|
4
5
|
import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
|
|
5
6
|
import { setupAndroidPushEvents } from '../push/setupAndroidPushEvents';
|
|
@@ -107,6 +108,28 @@ export class StreamVideoRN {
|
|
|
107
108
|
setupIosVoipPushEvents(pushConfig);
|
|
108
109
|
setupAndroidPushEvents(pushConfig);
|
|
109
110
|
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Register hooks that run around a ringing call's join, for every ringing path:
|
|
114
|
+
* accepted from the CallKit/Telecom UI, accepted inside the app, and outgoing.
|
|
115
|
+
*
|
|
116
|
+
* Call this at your application's entry point, alongside
|
|
117
|
+
* {@link StreamVideoRN.setPushConfig} and **outside** the React tree. A call
|
|
118
|
+
* accepted from a push notification can be created and joined before any
|
|
119
|
+
* component mounts, so hooks registered from inside React would be missed on
|
|
120
|
+
* exactly the path that most needs them.
|
|
121
|
+
*
|
|
122
|
+
* Calling it again replaces the previously registered hooks.
|
|
123
|
+
*
|
|
124
|
+
* @example // in index.js
|
|
125
|
+
* StreamVideoRN.setRingingCallLifecycleHooks({
|
|
126
|
+
* onBeforeCallJoin: (call) => attachE2EEIfConfigured(call),
|
|
127
|
+
* onAfterCallLeave: (call) => disposeE2EEManager(call),
|
|
128
|
+
* });
|
|
129
|
+
*/
|
|
130
|
+
static setRingingCallLifecycleHooks = hooks => {
|
|
131
|
+
storeRingingCallLifecycleHooks(hooks);
|
|
132
|
+
};
|
|
110
133
|
static getConfig() {
|
|
111
134
|
return this.config;
|
|
112
135
|
}
|
|
@@ -127,6 +150,29 @@ export class StreamVideoRN {
|
|
|
127
150
|
pushLogoutCallbacks.current = [];
|
|
128
151
|
}
|
|
129
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Android only. Opt out of the Android 11+ communication-mode keep-alive.
|
|
155
|
+
*
|
|
156
|
+
* By default the SDK plays a silent voice-communication track for the duration of a
|
|
157
|
+
* communicator-role call, so Android does not reset `MODE_IN_COMMUNICATION` ~6s after it is
|
|
158
|
+
* set (which breaks audio routing and echo cancellation).
|
|
159
|
+
* See {@link https://issuetracker.google.com/issues/209493718}
|
|
160
|
+
*
|
|
161
|
+
* Call this at app start, alongside {@link setPushConfig} — the native audio manager
|
|
162
|
+
* rejects the change once it has been activated for a call. No-op on iOS and on
|
|
163
|
+
* Android below API 30.
|
|
164
|
+
*/
|
|
165
|
+
static setDisableCommunicationModeWorkaround(disabled) {
|
|
166
|
+
if (Platform.OS !== 'android') {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
NativeModules.StreamInCallManager?.setDisableCommunicationModeWorkaround(disabled);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
videoLoggerSystem.getLogger('StreamVideoRN').warn('setDisableCommunicationModeWorkaround failed', error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
130
176
|
/**
|
|
131
177
|
* Play native busy tone for call rejection
|
|
132
178
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pushLogoutCallbacks","setupIosVoipPushEvents","setupAndroidPushEvents","setupCallingExpEvents","extractCallingExpOptions","getCallingxLib","NativeModules","Platform","videoLoggerSystem","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getLogger","info","JSON","stringify","options","setup","Error","getConfig","onPushLogout","callbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","
|
|
1
|
+
{"version":3,"names":["setRingingCallLifecycleHooks","storeRingingCallLifecycleHooks","pushLogoutCallbacks","setupIosVoipPushEvents","setupAndroidPushEvents","setupCallingExpEvents","extractCallingExpOptions","getCallingxLib","NativeModules","Platform","videoLoggerSystem","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getLogger","info","JSON","stringify","options","setup","Error","hooks","getConfig","onPushLogout","callbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","setDisableCommunicationModeWorkaround","disabled","OS","StreamInCallManager","error","warn","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;AACA,SAASA,4BAA4B,IAAIC,8BAA8B,QAAQ,kCAAkC;AACjH,OAAOC,mBAAmB,MAAM,gCAAgC;AAChE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SACEC,wBAAwB,EACxBC,cAAc,QACT,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;;AAKA;AACA,SAASC,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B,IACE,OAAOH,MAAM,CAACE,GAAG,CAAC,KAAK,QAAQ,IAC/BF,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACL,MAAM,CAACE,GAAG,CAAC,CAAC,IAC3B,OAAOH,MAAM,CAACG,GAAG,CAAC,KAAK,QAAQ,IAC/BH,MAAM,CAACG,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACN,MAAM,CAACG,GA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AAS,EAAE;MAC7B;IACF;IACA,IAAI;MACFjD,aAAa,CAACkD,mBAAmB,EAAEH,qCAAqC,CACtEC,QACF,CAAC;IACH,CAAC,CAAC,OAAOG,KAAK,EAAE;MACdjD,iBAAiB,CACd2B,SAAS,CAAC,eAAe,CAAC,CAC1BuB,IAAI,CAAC,8CAA8C,EAAED,KAAK,CAAC;IAChE;EACF;;EAEA;AACF;AACA;EACE,aAAaE,YAAYA,CAAA,EAAG;IAC1B,OAAOrD,aAAa,CAACsD,sBAAsB,CAACD,YAAY,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;EACE,aAAaE,YAAYA,CAAA,EAAG;IAC1B,OAAOvD,aAAa,CAACsD,sBAAsB,CAACC,YAAY,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;AACA;EACE,aAAaC,6BAA6BA,CAAA,EAAqB;IAC7D,IAAIvD,QAAQ,CAACgD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAId,KAAK,CACb,qEACF,CAAC;IACH,OAAOnC,aAAa,CAACsD,sBAAsB,CAACG,sBAAsB,CAAC,CAAC;EACtE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,4BAA4BA,CAAA,EAAqB;IAC5D,IAAIzD,QAAQ,CAACgD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAId,KAAK,CACb,oEACF,CAAC;IACH,OAAOnC,aAAa,CAACsD,sBAAsB,CAACK,qBAAqB,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,wBAAwBA,CAAA,EAAqB;IACxD,IAAI3D,QAAQ,CAACgD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAId,KAAK,CACb,gEACF,CAAC;IACH,OAAOnC,aAAa,CAACsD,sBAAsB,CAACO,iBAAiB,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
|
|
@@ -38,11 +38,14 @@ export function getCallDisplayName(callMembers, participants, currentUserId) {
|
|
|
38
38
|
*/
|
|
39
39
|
function getCallingxCallArgs(call) {
|
|
40
40
|
const callDisplayName = call.state.custom?.display_name || getCallDisplayName(call.state.members, call.state.participants, call.currentUserId);
|
|
41
|
+
const createdByHandle = call.state.createdBy?.id ?? callDisplayName;
|
|
41
42
|
return [call.cid,
|
|
42
43
|
// unique id for call
|
|
43
|
-
call.
|
|
44
|
-
//
|
|
45
|
-
|
|
44
|
+
// handle for the native call UI. On iOS it is shown in CallKit Recents and used for
|
|
45
|
+
// call-back, so we send the caller's user id (matches the Swift SDK). On Android the
|
|
46
|
+
// self-managed Telecom address is never displayed and callingx wraps it as
|
|
47
|
+
// `<packageName>:<handle>`, so we send the call id (matches the Android SDK).
|
|
48
|
+
Platform.OS === 'android' ? call.id : createdByHandle, callDisplayName,
|
|
46
49
|
// display name for display in call screen
|
|
47
50
|
call.state.settings?.video?.enabled ?? false // is video call?
|
|
48
51
|
];
|
|
@@ -72,7 +75,7 @@ export async function registerOutgoingCall(call) {
|
|
|
72
75
|
* 2. Displays the incoming call in the callingx library
|
|
73
76
|
* 3. Optionally for non-ringing calls also when ongoing calls are enabled.
|
|
74
77
|
*/
|
|
75
|
-
export async function joinCallingxCall(call, activeCalls) {
|
|
78
|
+
export async function joinCallingxCall(call, activeCalls, isCancelled) {
|
|
76
79
|
if (!CallingxModule || !CallingxModule.isSetup || call.isOwnTracksLoopbackAllowed) {
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
@@ -93,16 +96,38 @@ export async function joinCallingxCall(call, activeCalls) {
|
|
|
93
96
|
logger.error(`failed to leave active call ${activeCall.cid}`, e);
|
|
94
97
|
});
|
|
95
98
|
}
|
|
99
|
+
// Leaving the other calls above can take arbitrarily long, and this join may
|
|
100
|
+
// have been cancelled meanwhile. Registering now would create a native call
|
|
101
|
+
// nobody owns. The caller decides, not the call's state: a `Call` reused for
|
|
102
|
+
// a fresh ring is still `LEFT` here, because `setup()` runs after this.
|
|
103
|
+
if (isCancelled?.()) {
|
|
104
|
+
logger.debug(`joinCallingxCall: skipping registration for ${call.cid}: join cancelled while waiting for other calls`);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
96
107
|
logger.debug(`joinCallingxCall: Joining call ${call.cid} isIncoming: ${isIncomingCall} isOutgoing: ${isOutcomingCall}`);
|
|
97
108
|
const callArgs = getCallingxCallArgs(call);
|
|
98
109
|
if (isIncomingCall) {
|
|
99
110
|
await CallingxModule.displayIncomingCall(...callArgs);
|
|
111
|
+
// never answer a call that was hung up while the OS was displaying it -
|
|
112
|
+
// the cleanup below ends the registration instead
|
|
113
|
+
if (isCancelled?.()) return;
|
|
100
114
|
await CallingxModule.answerIncomingCall(call.cid);
|
|
101
115
|
} else {
|
|
102
116
|
await CallingxModule.startCall(...callArgs);
|
|
103
117
|
}
|
|
104
118
|
} catch (error) {
|
|
105
119
|
logger.error(`startCallingxCall: Error starting call in callingx: ${call.cid} isIncoming: ${isIncomingCall} isOutgoing: ${isOutcomingCall}`, error);
|
|
120
|
+
} finally {
|
|
121
|
+
// The registration above can outlive the join that asked for it: `leave()`
|
|
122
|
+
// may land while native is still bringing the call up, and by the time the
|
|
123
|
+
// caller aborts, the call exists natively with nobody to end it. Ringing
|
|
124
|
+
// calls have a lifecycle owner that would clean up; ordinary ones do not.
|
|
125
|
+
// Nothing was registered when the check above already skipped it, and
|
|
126
|
+
// `endCallingxCall` no-ops for an untracked cid, so this is safe either way.
|
|
127
|
+
if (isCancelled?.()) {
|
|
128
|
+
logger.debug(`joinCallingxCall: ending ${call.cid}: join was cancelled while registering`);
|
|
129
|
+
await endCallingxCall(call, 'canceled');
|
|
130
|
+
}
|
|
106
131
|
}
|
|
107
132
|
}
|
|
108
133
|
export async function endCallingxCall(call, reason) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","getCallingxLibIfAvailable","CallingState","videoLoggerSystem","CallingxModule","getCallDisplayName","callMembers","participants","currentUserId","names","length","flatMap","member","user","id","name","participant","userId","find","sort","join","getCallingxCallArgs","call","callDisplayName","state","custom","display_name","members","
|
|
1
|
+
{"version":3,"names":["Platform","getCallingxLibIfAvailable","CallingState","videoLoggerSystem","CallingxModule","getCallDisplayName","callMembers","participants","currentUserId","names","length","flatMap","member","user","id","name","participant","userId","find","sort","join","getCallingxCallArgs","call","callDisplayName","state","custom","display_name","members","createdByHandle","createdBy","cid","OS","settings","video","enabled","registerOutgoingCall","isSetup","isOwnTracksLoopbackAllowed","isOutcomingCall","ringing","isCreatedByMe","logger","getLogger","debug","startCall","error","joinCallingxCall","activeCalls","isCancelled","isIncomingCall","isOngoingCall","c","isOngoingCallsEnabled","activeCallsToLeave","filter","callingState","LEFT","activeCall","leave","reason","catch","e","callArgs","displayIncomingCall","answerIncomingCall","endCallingxCall","isCallTracked","endCallWithReason","wireAudioEngineSubscription","unwireAudioEngineSubscription"],"sourceRoot":"../../../../../src","sources":["utils/internal/callingx/callingx.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,yBAAyB,QAAQ,0BAA0B;AAMpE,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,yBAAyB;AAEzE,MAAMC,cAAc,GAAGH,yBAAyB,CAAC,CAAC;;AAElD;AACA;AACA;AACA,OAAO,SAASI,kBAAkBA,CAChCC,WAAyC,EACzCC,YAAkD,EAClDC,aAAiC,EACzB;EACR,IAAI,CAACF,WAAW,IAAI,CAACC,YAAY,IAAI,CAACC,aAAa,EAAE;IACnD,OAAO,MAAM;EACf;EAEA,IAAIC,KAAe,GAAG,EAAE;EAExB,IAAIH,WAAW,CAACI,MAAM,GAAG,CAAC,EAAE;IAC1B;IACAD,KAAK,GAAGH,WAAW,CAACK,OAAO,CAAEC,MAAM,IACjCA,MAAM,CAACC,IAAI,CAACC,EAAE,KAAKN,aAAa,IAAII,MAAM,CAACC,IAAI,CAACE,IAAI,GAChD,CAACH,MAAM,CAACC,IAAI,CAACE,IAAI,CAAC,GAClB,EACN,CAAC;EACH,CAAC,MAAM,IAAIR,YAAY,CAACG,MAAM,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,MAAM,CAACI,KAAK,CACV,+DAA+D,EAC/DA,KACF,CAAC;EACH;AACF;AAEA,OAAO,SAASwB,6BAA6BA,CAAA,EAAG;EAC9C,IAAI,CAACjE,cAAc,IAAI,CAACA,cAAc,CAACgC,OAAO,IAAIpC,QAAQ,CAAC+B,EAAE,KAAK,KAAK,EAAE;IACvE;EACF;EACA,MAAMU,MAAM,GAAGtC,iBAAiB,CAACuC,SAAS,CAAC,UAAU,CAAC;EAEtD,IAAI;IACFD,MAAM,CAACE,KAAK,CAAC,0DAA0D,CAAC;IACxEvC,cAAc,CAACiE,6BAA6B,CAAC,CAAC;EAChD,CAAC,CAAC,OAAOxB,KAAK,EAAE;IACdJ,MAAM,CAACI,KAAK,CACV,qEAAqE,EACrEA,KACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { DebounceType } from '@stream-io/video-client';
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
/**
|
|
6
|
+
* The track currently rendered by the native iOS Picture in Picture window,
|
|
7
|
+
* per Call instance. While set, the window's bounds are the demand of that
|
|
8
|
+
* track and the inline views of the same track stop requesting their layout.
|
|
9
|
+
*/
|
|
10
|
+
const tracks = new WeakMap();
|
|
11
|
+
export const getIosPipTrack$ = call => {
|
|
12
|
+
let track$ = tracks.get(call);
|
|
13
|
+
if (!track$) {
|
|
14
|
+
track$ = new BehaviorSubject(undefined);
|
|
15
|
+
tracks.set(call, track$);
|
|
16
|
+
}
|
|
17
|
+
return track$;
|
|
18
|
+
};
|
|
19
|
+
export const setIosPipTrack = (call, track) => {
|
|
20
|
+
const track$ = getIosPipTrack$(call);
|
|
21
|
+
const previous = track$.getValue();
|
|
22
|
+
if (previous) {
|
|
23
|
+
// Clear before opening the gate: mounted inline views replay their layout
|
|
24
|
+
// synchronously on the gate change and overwrite this. If none is mounted,
|
|
25
|
+
// the cleared demand stands.
|
|
26
|
+
call.state.updateParticipantTracks(previous.trackType, {
|
|
27
|
+
[previous.sessionId]: {
|
|
28
|
+
dimension: undefined
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
call.trackSubscriptionManager.apply(DebounceType.MEDIUM);
|
|
32
|
+
}
|
|
33
|
+
track$.next(track);
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=iosPipTrack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DebounceType","BehaviorSubject","tracks","WeakMap","getIosPipTrack$","call","track$","get","undefined","set","setIosPipTrack","track","previous","getValue","state","updateParticipantTracks","trackType","sessionId","dimension","trackSubscriptionManager","apply","MEDIUM","next"],"sourceRoot":"../../../../src","sources":["utils/internal/iosPipTrack.ts"],"mappings":";;AAAA,SAEEA,YAAY,QAEP,yBAAyB;AAChC,SAASC,eAAe,QAAQ,MAAM;AAItC;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAG,IAAIC,OAAO,CAA8C,CAAC;AAEzE,OAAO,MAAMC,eAAe,GAAIC,IAAU,IAAK;EAC7C,IAAIC,MAAM,GAAGJ,MAAM,CAACK,GAAG,CAACF,IAAI,CAAC;EAC7B,IAAI,CAACC,MAAM,EAAE;IACXA,MAAM,GAAG,IAAIL,eAAe,CAAuBO,SAAS,CAAC;IAC7DN,MAAM,CAACO,GAAG,CAACJ,IAAI,EAAEC,MAAM,CAAC;EAC1B;EACA,OAAOA,MAAM;AACf,CAAC;AAED,OAAO,MAAMI,cAAc,GAAGA,CAACL,IAAU,EAAEM,KAA2B,KAAK;EACzE,MAAML,MAAM,GAAGF,eAAe,CAACC,IAAI,CAAC;EACpC,MAAMO,QAAQ,GAAGN,MAAM,CAACO,QAAQ,CAAC,CAAC;EAClC,IAAID,QAAQ,EAAE;IACZ;IACA;IACA;IACAP,IAAI,CAACS,KAAK,CAACC,uBAAuB,CAACH,QAAQ,CAACI,SAAS,EAAE;MACrD,CAACJ,QAAQ,CAACK,SAAS,GAAG;QAAEC,SAAS,EAAEV;MAAU;IAC/C,CAAC,CAAC;IACFH,IAAI,CAACc,wBAAwB,CAACC,KAAK,CAACpB,YAAY,CAACqB,MAAM,CAAC;EAC1D;EACAf,MAAM,CAACgB,IAAI,CAACX,KAAK,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import { AudioEngineMuteMode, audioDeviceModuleEvents } from '@stream-io/react-n
|
|
|
6
6
|
import { getCallingxLibIfAvailable } from '../push/libs/callingx';
|
|
7
7
|
import { endCallingxCall, registerOutgoingCall, joinCallingxCall, wireAudioEngineSubscription, unwireAudioEngineSubscription } from './callingx/callingx';
|
|
8
8
|
import { registerCallMediaEngine } from './registerMediaEngine';
|
|
9
|
+
import { beforeJoin, onJoinFailed, onLeave } from './ringingCallLifecycle';
|
|
9
10
|
import { callManager as publicCallManager } from '../../modules/call-manager';
|
|
10
11
|
const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
|
|
11
12
|
const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative;
|
|
@@ -74,6 +75,11 @@ const streamRNVideoSDKGlobals = {
|
|
|
74
75
|
wireAudioEngineSubscription: wireAudioEngineSubscription,
|
|
75
76
|
unwireAudioEngineSubscription: unwireAudioEngineSubscription
|
|
76
77
|
},
|
|
78
|
+
ringingCallLifecycle: {
|
|
79
|
+
beforeJoin,
|
|
80
|
+
onJoinFailed,
|
|
81
|
+
onLeave
|
|
82
|
+
},
|
|
77
83
|
callManager: {
|
|
78
84
|
setup: ({
|
|
79
85
|
defaultDevice,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["videoLoggerSystem","NativeModules","PermissionsAndroid","Platform","AudioEngineMuteMode","audioDeviceModuleEvents","getCallingxLibIfAvailable","endCallingxCall","registerOutgoingCall","joinCallingxCall","wireAudioEngineSubscription","unwireAudioEngineSubscription","registerCallMediaEngine","callManager","publicCallManager","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","safeNativeCall","label","fn","error","getLogger","warn","shouldBypassForCallKit","isRingingTypeCall","OS","bypass","isSetup","isOngoingCallsEnabled","isAndroidTelecomManaged","cid","isTelecomBacked","isCallTracked","streamRNVideoSDKGlobals","callingX","joinCall","endCall","setup","defaultDevice","isTelecomManaged","isCallKitManaged","setTelecomManagedMode","setDefaultAudioDeviceEndpointType","start","config","getStoredConfig","deviceOverride","audioRole","deviceEndpointType","undefined","setAudioRole","stereoOutput","setEnableStereoAudioOutput","stop","shouldStopCallManager","setRecordingAlwaysPreparedMode","setMutedRecordingPrepared","enabled","setMuteMode","VoiceProcessing","permissions","check","permission","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","nativeEvents","speechActivity","subscribe","cb","subscription","addSpeechActivityListener","data","isSoundDetected","event","remove","registerSDKGlobals","globalThis","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":";;AAAA,SAEEA,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC1E,SACEC,mBAAmB,EACnBC,uBAAuB,QAClB,gCAAgC;AACvC,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SACEC,eAAe,EACfC,oBAAoB,EACpBC,gBAAgB,EAChBC,2BAA2B,EAC3BC,6BAA6B,QACxB,qBAAqB;AAC5B,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,4BAA4B;AAE7E,MAAMC,+BAA+B,
|
|
1
|
+
{"version":3,"names":["videoLoggerSystem","NativeModules","PermissionsAndroid","Platform","AudioEngineMuteMode","audioDeviceModuleEvents","getCallingxLibIfAvailable","endCallingxCall","registerOutgoingCall","joinCallingxCall","wireAudioEngineSubscription","unwireAudioEngineSubscription","registerCallMediaEngine","beforeJoin","onJoinFailed","onLeave","callManager","publicCallManager","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","safeNativeCall","label","fn","error","getLogger","warn","shouldBypassForCallKit","isRingingTypeCall","OS","bypass","isSetup","isOngoingCallsEnabled","isAndroidTelecomManaged","cid","isTelecomBacked","isCallTracked","streamRNVideoSDKGlobals","callingX","joinCall","endCall","ringingCallLifecycle","setup","defaultDevice","isTelecomManaged","isCallKitManaged","setTelecomManagedMode","setDefaultAudioDeviceEndpointType","start","config","getStoredConfig","deviceOverride","audioRole","deviceEndpointType","undefined","setAudioRole","stereoOutput","setEnableStereoAudioOutput","stop","shouldStopCallManager","setRecordingAlwaysPreparedMode","setMutedRecordingPrepared","enabled","setMuteMode","VoiceProcessing","permissions","check","permission","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","nativeEvents","speechActivity","subscribe","cb","subscription","addSpeechActivityListener","data","isSoundDetected","event","remove","registerSDKGlobals","globalThis","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":";;AAAA,SAEEA,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC1E,SACEC,mBAAmB,EACnBC,uBAAuB,QAClB,gCAAgC;AACvC,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SACEC,eAAe,EACfC,oBAAoB,EACpBC,gBAAgB,EAChBC,2BAA2B,EAC3BC,6BAA6B,QACxB,qBAAqB;AAC5B,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAASC,UAAU,EAAEC,YAAY,EAAEC,OAAO,QAAQ,wBAAwB;AAC1E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,4BAA4B;AAE7E,MAAMC,+BAA+B,GAAGjB,aAAa,CAACkB,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGnB,aAAa,CAACoB,sBAElD;AAED,MAAMC,cAAc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AAE;QACzB;MACF;MACA,IAAIiC,OAAO,EAAE;QACX;QACA;QACA9C,+BAA+B,CAAC+C,WAAW,CACzC7D,mBAAmB,CAAC8D,eACtB,CAAC;MACH;MACAhD,+BAA+B,CAAC4C,8BAA8B,CAACE,OAAO,CAAC;IACzE;EACF,CAAC;EACDG,WAAW,EAAE;IACXC,KAAK,EAAE,MAAOC,UAAU,IAAK;MAC3B,IAAIlE,QAAQ,CAAC4B,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMuC,uBAAuB,GAC3BD,UAAU,KAAK,QAAQ,GACnBnE,kBAAkB,CAACqE,WAAW,CAACC,MAAM,GACrCtE,kBAAkB,CAACqE,WAAW,CAACE,YAAY;QACjD,OAAOvE,kBAAkB,CAACkE,KAAK,CAACE,uBAAuB,CAAC;MAC1D;;MAEA;MACA,OAAOI,OAAO,CACZ,MAAMtD,4BAA4B,CAACuD,eAAe,GAAGN,UAAU,CACjE,CAAC;IACH;EACF,CAAC;EACDO,YAAY,EAAE;IACZC,cAAc,EAAE;MACdC,SAASA,CAACC,EAAE,EAAE;QACZ,MAAMC,YAAY,GAAG3E,uBAAuB,CAAC4E,yBAAyB,CACnEC,IAAI,IAAK;UACRH,EAAE,CAAC;YAAEI,eAAe,EAAED,IAAI,CAACE,KAAK,KAAK;UAAU,CAAC,CAAC;QACnD,CACF,CAAC;QACD,OAAO,MAAMJ,YAAY,CAACK,MAAM,CAAC,CAAC;MACpC;IACF;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,UAAU,CAACC,gBAAgB,EAAE;IAChCD,UAAU,CAACC,gBAAgB,GAAGjD,uBAAuB;EACvD;EAEA3B,uBAAuB,CAAC,CAAC;AAC3B","ignoreList":[]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
4
|
+
const logger = videoLoggerSystem.getLogger('ringingCallLifecycle');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How long `onBeforeCallJoin` may take before the join gives up on it.
|
|
8
|
+
*
|
|
9
|
+
* The hook runs inside the CallKit accept, which iOS gives a hard deadline of
|
|
10
|
+
* roughly 30s before killing the app. Failing well short of that leaves room to
|
|
11
|
+
* report the failure and end the native call cleanly, and a hook that legitimately
|
|
12
|
+
* needs longer than this does not belong on the accept path at all.
|
|
13
|
+
*/
|
|
14
|
+
const ON_BEFORE_CALL_JOIN_TIMEOUT_MS = 5_000;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The registered hooks.
|
|
18
|
+
*
|
|
19
|
+
* Held here rather than on `StreamVideoRN.config` so the push internals and the
|
|
20
|
+
* globals bridge can both reach them without importing the `StreamVideoRN`
|
|
21
|
+
* class, which would close an import cycle through the push setup modules.
|
|
22
|
+
*/
|
|
23
|
+
let hooks;
|
|
24
|
+
export const setRingingCallLifecycleHooks = next => {
|
|
25
|
+
hooks = next;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How to release what a call's setup hook installed.
|
|
30
|
+
*
|
|
31
|
+
* Kept per call rather than in a single current-call slot: an abandoned call's
|
|
32
|
+
* hook can still finish after the next call has joined, and it has to release
|
|
33
|
+
* its own manager rather than whatever is current. An entry exists only for a
|
|
34
|
+
* call whose setup hook actually ran.
|
|
35
|
+
*/
|
|
36
|
+
const cleanups = new WeakMap();
|
|
37
|
+
|
|
38
|
+
/** Invokes the release hook, swallowing whatever it throws. */
|
|
39
|
+
const fireRelease = call => {
|
|
40
|
+
const hook = hooks?.onAfterCallLeave;
|
|
41
|
+
if (!hook) return;
|
|
42
|
+
try {
|
|
43
|
+
Promise.resolve(hook(call)).catch(e => {
|
|
44
|
+
logger.warn(`onAfterCallLeave failed for callCid: ${call.cid}`, e);
|
|
45
|
+
});
|
|
46
|
+
} catch (e) {
|
|
47
|
+
logger.warn(`onAfterCallLeave threw for callCid: ${call.cid}`, e);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** Releases what the setup hook installed, at most once. */
|
|
52
|
+
const requestRelease = call => {
|
|
53
|
+
const cleanup = cleanups.get(call);
|
|
54
|
+
if (!cleanup) return;
|
|
55
|
+
// Dropped before it runs: that is what makes a failed join followed by a
|
|
56
|
+
// leave release exactly once.
|
|
57
|
+
cleanups.delete(call);
|
|
58
|
+
cleanup();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Runs the app's pre-join setup, bounded by the deadline.
|
|
63
|
+
*
|
|
64
|
+
* Rejecting fails the join closed - joining without whatever this installs would
|
|
65
|
+
* publish unencrypted media on a call the user believes is private.
|
|
66
|
+
*/
|
|
67
|
+
export const beforeJoin = call => {
|
|
68
|
+
const hook = hooks?.onBeforeCallJoin;
|
|
69
|
+
if (!hook) return Promise.resolve();
|
|
70
|
+
|
|
71
|
+
// Invoked synchronously - a caller expects its hook to start now - but a
|
|
72
|
+
// synchronous throw becomes a rejection so it cannot escape the bookkeeping.
|
|
73
|
+
let started;
|
|
74
|
+
try {
|
|
75
|
+
started = Promise.resolve(hook(call));
|
|
76
|
+
} catch (error) {
|
|
77
|
+
started = Promise.reject(error);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Cleanup tracks the hook's own promise, never the bounded wait below. The
|
|
81
|
+
// deadline ends this join's wait but cannot cancel the app's work, so a
|
|
82
|
+
// manager the hook creates late still has an owner waiting to release it.
|
|
83
|
+
const settled = started.catch(() => {});
|
|
84
|
+
cleanups.set(call, () => void settled.then(() => fireRelease(call)));
|
|
85
|
+
let timeout;
|
|
86
|
+
const expiry = new Promise((_, reject) => {
|
|
87
|
+
timeout = setTimeout(() => reject(new Error(`onBeforeCallJoin did not settle within ${ON_BEFORE_CALL_JOIN_TIMEOUT_MS}ms`)), ON_BEFORE_CALL_JOIN_TIMEOUT_MS);
|
|
88
|
+
});
|
|
89
|
+
return Promise.race([started, expiry]).finally(() => clearTimeout(timeout));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The join failed and will not be retried on this call.
|
|
94
|
+
*
|
|
95
|
+
* Ends the ringing flow rather than leaving the call sitting in `RINGING`: one
|
|
96
|
+
* `Call` is one call flow, so the accept button must not be able to offer this
|
|
97
|
+
* instance again. Never rejects, so the original join error survives.
|
|
98
|
+
*/
|
|
99
|
+
export const onJoinFailed = async call => {
|
|
100
|
+
if (call.state.callingState !== CallingState.LEFT) {
|
|
101
|
+
try {
|
|
102
|
+
// Takes the call out of the client's list, which unmounts the ringing UI.
|
|
103
|
+
// `reject: false`: the join failed locally, so this is not the callee
|
|
104
|
+
// declining, and the native call has already been ended with 'error'.
|
|
105
|
+
await call.leave({
|
|
106
|
+
reject: false
|
|
107
|
+
});
|
|
108
|
+
} catch (error) {
|
|
109
|
+
logger.warn(`failed to leave after a failed join: ${call.cid}`, error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// The leave above notifies {@link onLeave}, which consumes the cleanup. This
|
|
113
|
+
// covers what it could not: a call already left, or a leave that itself failed.
|
|
114
|
+
requestRelease(call);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The call has ended.
|
|
119
|
+
*
|
|
120
|
+
* Releases what the setup hook installed, once the hook has actually settled -
|
|
121
|
+
* a hook still running may yet install something, and releasing before it
|
|
122
|
+
* finishes would strand that.
|
|
123
|
+
*/
|
|
124
|
+
export const onLeave = call => {
|
|
125
|
+
// A release-only registration has nothing to pair with, so its hook belongs to
|
|
126
|
+
// the call ending rather than to a join: it is owed for every ringing call
|
|
127
|
+
// that ends, including one declined without ever joining.
|
|
128
|
+
if (!hooks?.onBeforeCallJoin) {
|
|
129
|
+
fireRelease(call);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
requestRelease(call);
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=ringingCallLifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CallingState","videoLoggerSystem","logger","getLogger","ON_BEFORE_CALL_JOIN_TIMEOUT_MS","hooks","setRingingCallLifecycleHooks","next","cleanups","WeakMap","fireRelease","call","hook","onAfterCallLeave","Promise","resolve","catch","e","warn","cid","requestRelease","cleanup","get","delete","beforeJoin","onBeforeCallJoin","started","error","reject","settled","set","then","timeout","expiry","_","setTimeout","Error","race","finally","clearTimeout","onJoinFailed","state","callingState","LEFT","leave","onLeave"],"sourceRoot":"../../../../src","sources":["utils/internal/ringingCallLifecycle.ts"],"mappings":";;AAAA,SACEA,YAAY,EACZC,iBAAiB,QAEZ,yBAAyB;AAGhC,MAAMC,MAAM,GAAGD,iBAAiB,CAACE,SAAS,CAAC,sBAAsB,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,8BAA8B,GAAG,KAAK;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,KAA4C;AAEhD,OAAO,MAAMC,4BAA4B,GACvCC,IAA+B,IAC5B;EACHF,KAAK,GAAGE,IAAI;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,IAAIC,OAAO,CAAmB,CAAC;;AAEhD;AACA,MAAMC,WAAW,GAAIC,IAAU,IAAW;EACxC,MAAMC,IAAI,GAAGP,KAAK,EAAEQ,gBAAgB;EACpC,IAAI,CAACD,IAAI,EAAE;EACX,IAAI;IACFE,OAAO,CAACC,OAAO,CAACH,IAAI,CAACD,IAAI,CAAC,CAAC,CAACK,KAAK,CAAEC,CAAC,IAAK;MACvCf,MAAM,CAACgB,IAAI,CAAC,wCAAwCP,IAAI,CAACQ,GAAG,EAAE,EAAEF,CAAC,CAAC;IACpE,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOA,CAAC,EAAE;IACVf,MAAM,CAACgB,IAAI,CAAC,uCAAuCP,I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C,CAAC,CAACK,OAAO,CAAC,MAAMC,YAAY,CAACP,OAAO,CAAC,CAAC;AAC7E,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,YAAY,GAAG,MAAO7B,IAAU,IAAoB;EAC/D,IAAIA,IAAI,CAAC8B,KAAK,CAACC,YAAY,KAAK1C,YAAY,CAAC2C,IAAI,EAAE;IACjD,IAAI;MACF;MACA;MACA;MACA,MAAMhC,IAAI,CAACiC,KAAK,CAAC;QAAEhB,MAAM,EAAE;MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,OAAOD,KAAK,EAAE;MACdzB,MAAM,CAACgB,IAAI,CAAC,wCAAwCP,IAAI,CAACQ,GAAG,EAAE,EAAEQ,KAAK,CAAC;IACxE;EACF;EACA;EACA;EACAP,cAAc,CAACT,IAAI,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMkC,OAAO,GAAIlC,IAAU,IAAW;EAC3C;EACA;EACA;EACA,IAAI,CAACN,KAAK,EAAEoB,gBAAgB,EAAE;IAC5Bf,WAAW,CAACC,IAAI,CAAC;IACjB;EACF;EACAS,cAAc,CAACT,IAAI,CAAC;AACtB,CAAC","ignoreList":[]}
|
|
@@ -83,6 +83,10 @@ export const processCallFromPushInBackground = async (pushConfig, call_cid, acti
|
|
|
83
83
|
await callFromPush.join();
|
|
84
84
|
} catch (e) {
|
|
85
85
|
logger.warn('processCallFromPushInBackground: failed to join call from push notification', e);
|
|
86
|
+
// Cleanup is not repeated here: `join()`'s own failure boundary already
|
|
87
|
+
// released whatever the pre-join hook installed, and a second call would
|
|
88
|
+
// invoke a release-only registration twice.
|
|
89
|
+
onIOSActionCanBeFulfilled(true);
|
|
86
90
|
}
|
|
87
91
|
} else if (action === 'decline') {
|
|
88
92
|
const alreadyLeft = callFromPush.state.callingState === CallingState.LEFT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CallingState","videoLoggerSystem","pushUnsubscriptionCallbacks","AppState","logger","getLogger","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","endCallReason","endedAt","debug","cid","processCallFromPushInBackground","pushConfig","call_cid","action","onIOSActionCanBeFulfilled","videoClient","createStreamVideoClient","Error","e","error","onRingingCall","publishOptions","updatePublishOptions","callingState","RINGING","IDLE","join","warn","alreadyLeft","LEFT","canReject","isCurrentUserMember","members","some","member","user_id","currentUserId","reject","leave","reason","clearPushWSEventSubscriptions","unsubscriptionCallbacks","get","forEach","cb","delete","canAddPushWSSubscriptionsRef","current","canListenToWS","currentState","shouldCallBeClosed","call","pushData"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":";;AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAEhC,SAASC,2BAA2B,QAAQ,aAAa;AACzD,SAASC,QAAQ,QAAQ,cAAc;AAKvC,MAAMC,MAAM,GAAGH,iBAAiB,CAACI,SAAS,CAAC,UAAU,CAAC;AAGtD;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,YAAkB,EAClBC,aAAiC,EACjCC,WAA+B,KAC5B;EACH,MAAMC,WAAW,GAAGH,YAAY,CAACI,KAAK,CAACC,OAAO;EAC9C,MAAMC,WAAW,GAAGH,WAAW,EAAEG,WAAW;EAC5C,MAAMC,WAAW,GAAGJ,WAAW,EAAEI,WAAW;EAC5C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,aAA4B,GAAG,SAAS;EAE5C,IAAIT,YAAY,CAACI,KAAK,CAACM,OAAO,EAAE;IAC9BF,WAAW,GAAG,IAAI;IAClBC,aAAa,GAAG,QAAQ;EAC1B,CAAC,MAAM,IAAIR,aAAa,IAAIK,WAAW,EAAE;IACvC,IAAIA,WAAW,CAACL,aAAa,CAAC,EAAE;MAC9B;MACAO,WAAW,GAAG,IAAI;MAClBC,aAAa,GAAG,UAAU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EAAE;IACvB,IAAIF,UAAU,CAACU,cAAc,EAAE;MAC7BxB,YAAY,CAACyB,oBAAoB,CAACX,UAAU,CAACU,cAAc,CAAC;IAC9D;IACA3B,MAAM,CAACc,KAAK,CACV,qDAAqDX,YAAY,CAACY,GAAG,EACvE,CAAC;IACD,MAAMc,YAAY,GAAG1B,YAAY,CAACI,KAAK,CAACsB,YAAY;IACpD,IACEA,YAAY,KAAKjC,YAAY,CAACkC,OAAO,IACrCD,YAAY,KAAKjC,YAAY,CAACmC,IAAI,EAClC;MACA/B,MAAM,CAACc,KAAK,CACV,6FAA6FX,YAAY,CAACY,GAAG,EAC/G,CAAC;MACDK,yBAAyB,CAAC,IAAI,CAAC;MAC/B;IACF;IACA,IAAI;MACFA,yBAAyB,CAAC,KAAK,CAAC;MAChC,MAAMjB,YAAY,CAAC6B,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,OAAOR,CAAC,EAAE;MACVxB,MAAM,CAACiC,IAAI,CACT,6EAA6E,EAC7ET,CACF,CAAC;
|
|
1
|
+
{"version":3,"names":["CallingState","videoLoggerSystem","pushUnsubscriptionCallbacks","AppState","logger","getLogger","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","endCallReason","endedAt","debug","cid","processCallFromPushInBackground","pushConfig","call_cid","action","onIOSActionCanBeFulfilled","videoClient","createStreamVideoClient","Error","e","error","onRingingCall","publishOptions","updatePublishOptions","callingState","RINGING","IDLE","join","warn","alreadyLeft","LEFT","canReject","isCurrentUserMember","members","some","member","user_id","currentUserId","reject","leave","reason","clearPushWSEventSubscriptions","unsubscriptionCallbacks","get","forEach","cb","delete","canAddPushWSSubscriptionsRef","current","canListenToWS","currentState","shouldCallBeClosed","call","pushData"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":";;AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAEhC,SAASC,2BAA2B,QAAQ,aAAa;AACz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uBAAuB,CAACE,OAAO,CAAEC,EAAE,IAAKA,EAAE,CAAC,CAAC,CAAC;IAC7CpD,2BAA2B,CAACqD,MAAM,CAACjC,QAAQ,CAAC;EAC9C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMkC,4BAA0D,GAAG;EACxEC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAC3BF,4BAA4B,CAACC,OAAO,IAAItD,QAAQ,CAACwD,YAAY,KAAK,QAAQ;AAE5E,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,IAAU,EACVC,QAA4C,KACzC;EACH,MAAMtD,aAAa,GAAGsD,QAAQ,EAAEtD,aAAuB;EACvD,MAAMC,WAAW,GAAGqD,QAAQ,EAAErD,WAAqB;EAEnD,MAAM;IAAEM,WAAW;IAAEC;EAAc,CAAC,GAAGV,iBAAiB,CACtDuD,IAAI,EACJrD,aAAa,EACbC,WACF,CAAC;EACD,OAAO;IAAEM,WAAW;IAAEC;EAAc,CAAC;AACvC,CAAC","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -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":"AAeA,OAAO,KAAmD,MAAM,OAAO,CAAC;AA8BxE,KAAK,KAAK,GAAG;IACX,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAsB,KAAK,uBAsPnD,CAAC"}
|
|
@@ -2,12 +2,24 @@ import React from 'react';
|
|
|
2
2
|
export type PiPChangeEvent = {
|
|
3
3
|
active: boolean;
|
|
4
4
|
};
|
|
5
|
+
export type PiPBoundsChangeEvent = {
|
|
6
|
+
/** the laid out width of the native window, in logical points */
|
|
7
|
+
width: number;
|
|
8
|
+
/** the laid out height of the native window, in logical points */
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
5
11
|
type RTCViewPipNativeProps = {
|
|
6
12
|
streamURL?: string;
|
|
7
13
|
mirror?: boolean;
|
|
8
14
|
onPiPChange?: (event: {
|
|
9
15
|
nativeEvent: PiPChangeEvent;
|
|
10
16
|
}) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Reports the actual laid out bounds of the native Picture in Picture window.
|
|
19
|
+
*/
|
|
20
|
+
onPiPBoundsChange?: (event: {
|
|
21
|
+
nativeEvent: PiPBoundsChangeEvent;
|
|
22
|
+
}) => void;
|
|
11
23
|
/** The participant's name for the avatar placeholder when video is disabled */
|
|
12
24
|
participantName?: string;
|
|
13
25
|
/** The URL string for the participant's profile image */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAKF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,QAMlD;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,QAaf;AAED;2CAC2C;AAC3C,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,oBAAoB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3E,+EAA+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