@stream-io/video-react-native-sdk 1.18.1 → 1.19.1
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 +22 -0
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +10 -0
- package/android/src/main/java/com/streamvideo/reactnative/util/PiPHelper.kt +18 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +22 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +8 -10
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +10 -0
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js +2 -2
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/commonjs/icons/BadNetwork.js +25 -0
- package/dist/commonjs/icons/BadNetwork.js.map +1 -0
- package/dist/commonjs/icons/index.js +11 -0
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/AppStateListener.js +3 -2
- package/dist/commonjs/providers/StreamCall/AppStateListener.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +23 -3
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +6 -8
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +12 -2
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js +3 -3
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/module/icons/BadNetwork.js +17 -0
- package/dist/module/icons/BadNetwork.js.map +1 -0
- package/dist/module/icons/index.js +1 -0
- package/dist/module/icons/index.js.map +1 -1
- package/dist/module/providers/StreamCall/AppStateListener.js +3 -2
- package/dist/module/providers/StreamCall/AppStateListener.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts +2 -2
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
- package/dist/typescript/icons/BadNetwork.d.ts +9 -0
- package/dist/typescript/icons/BadNetwork.d.ts.map +1 -0
- package/dist/typescript/icons/index.d.ts +1 -0
- package/dist/typescript/icons/index.d.ts.map +1 -1
- package/dist/typescript/providers/StreamCall/AppStateListener.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/RTCViewPipManager.swift +17 -4
- package/package.json +3 -3
- package/src/components/Call/CallContent/CallContent.tsx +40 -4
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +4 -7
- package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +14 -1
- package/src/components/Participant/ParticipantView/VideoRenderer.tsx +3 -1
- package/src/icons/BadNetwork.tsx +18 -0
- package/src/icons/index.tsx +1 -0
- package/src/providers/StreamCall/AppStateListener.tsx +3 -5
- package/src/version.ts +1 -1
|
@@ -9,14 +9,15 @@ import type { MediaStream } from '@stream-io/react-native-webrtc';
|
|
|
9
9
|
import React, { useEffect, useMemo } from 'react';
|
|
10
10
|
import { findNodeHandle } from 'react-native';
|
|
11
11
|
import { onNativeCallClosed, RTCViewPipNative } from './RTCViewPipNative';
|
|
12
|
-
import { useDebouncedValue } from '../../../utils/hooks
|
|
12
|
+
import { useDebouncedValue } from '../../../utils/hooks';
|
|
13
13
|
import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../../../utils/internal/shouldDisableIOSLocalVideoOnBackground';
|
|
14
14
|
|
|
15
15
|
type Props = {
|
|
16
16
|
includeLocalParticipantVideo?: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const RTCViewPipIOS = React.memo((
|
|
19
|
+
export const RTCViewPipIOS = React.memo((props: Props) => {
|
|
20
|
+
const { includeLocalParticipantVideo } = props;
|
|
20
21
|
const call = useCall();
|
|
21
22
|
const { useParticipants } = useCallStateHooks();
|
|
22
23
|
const _allParticipants = useParticipants({
|
|
@@ -61,16 +62,14 @@ const RTCViewPipIOS = React.memo(({ includeLocalParticipantVideo }: Props) => {
|
|
|
61
62
|
'debug',
|
|
62
63
|
`onCallClosed due to call.ended event`,
|
|
63
64
|
);
|
|
64
|
-
unsubFunc?.();
|
|
65
65
|
onCallClosed();
|
|
66
66
|
});
|
|
67
67
|
const subscription = call?.state.callingState$.subscribe((state) => {
|
|
68
|
-
if (state === CallingState.LEFT
|
|
68
|
+
if (state === CallingState.LEFT) {
|
|
69
69
|
getLogger(['RTCViewPipIOS'])(
|
|
70
70
|
'debug',
|
|
71
71
|
`onCallClosed due to callingState: ${state}`,
|
|
72
72
|
);
|
|
73
|
-
subscription?.unsubscribe();
|
|
74
73
|
onCallClosed();
|
|
75
74
|
}
|
|
76
75
|
});
|
|
@@ -101,5 +100,3 @@ const RTCViewPipIOS = React.memo(({ includeLocalParticipantVideo }: Props) => {
|
|
|
101
100
|
});
|
|
102
101
|
|
|
103
102
|
RTCViewPipIOS.displayName = 'RTCViewPipIOS';
|
|
104
|
-
|
|
105
|
-
export default RTCViewPipIOS;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import {
|
|
4
|
+
BadNetwork,
|
|
4
5
|
MicOff,
|
|
5
6
|
PinVertical,
|
|
6
7
|
ScreenShareIndicator,
|
|
@@ -10,7 +11,7 @@ import { useCall, useI18n } from '@stream-io/video-react-bindings';
|
|
|
10
11
|
import { ComponentTestIds } from '../../../constants/TestIds';
|
|
11
12
|
import { type ParticipantViewProps } from './ParticipantView';
|
|
12
13
|
import { Z_INDEX } from '../../../constants';
|
|
13
|
-
import { hasAudio, hasVideo } from '@stream-io/video-client';
|
|
14
|
+
import { hasAudio, hasPausedTrack, hasVideo } from '@stream-io/video-client';
|
|
14
15
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
15
16
|
import SpeechIndicator from './SpeechIndicator';
|
|
16
17
|
|
|
@@ -54,6 +55,7 @@ export const ParticipantLabel = ({
|
|
|
54
55
|
const isPinningEnabled = pin?.isLocalPin;
|
|
55
56
|
const isAudioMuted = !hasAudio(participant);
|
|
56
57
|
const isVideoMuted = !hasVideo(participant);
|
|
58
|
+
const isTrackPaused = trackType && hasPausedTrack(participant, trackType);
|
|
57
59
|
|
|
58
60
|
const unPinParticipantHandler = () => {
|
|
59
61
|
call?.unpin(sessionId);
|
|
@@ -124,6 +126,13 @@ export const ParticipantLabel = ({
|
|
|
124
126
|
<VideoSlash color={colors.iconPrimary} size={iconSizes.sm} />
|
|
125
127
|
</View>
|
|
126
128
|
)}
|
|
129
|
+
{isTrackPaused && (
|
|
130
|
+
<View
|
|
131
|
+
style={[styles.trackPausedIconContainer, videoMutedIconContainer]}
|
|
132
|
+
>
|
|
133
|
+
<BadNetwork color={colors.iconPrimary} size={iconSizes.sm} />
|
|
134
|
+
</View>
|
|
135
|
+
)}
|
|
127
136
|
{isPinningEnabled && (
|
|
128
137
|
<Pressable
|
|
129
138
|
style={[styles.pinIconContainer, pinIconContainer]}
|
|
@@ -182,6 +191,10 @@ const useStyles = () => {
|
|
|
182
191
|
marginLeft: theme.variants.spacingSizes.xs,
|
|
183
192
|
justifyContent: 'center',
|
|
184
193
|
},
|
|
194
|
+
trackPausedIconContainer: {
|
|
195
|
+
marginLeft: theme.variants.spacingSizes.xs,
|
|
196
|
+
justifyContent: 'center',
|
|
197
|
+
},
|
|
185
198
|
pinIconContainer: {
|
|
186
199
|
marginLeft: theme.variants.spacingSizes.xs,
|
|
187
200
|
justifyContent: 'center',
|
|
@@ -5,6 +5,7 @@ import { RTCView } from '@stream-io/react-native-webrtc';
|
|
|
5
5
|
import type { ParticipantViewProps } from './ParticipantView';
|
|
6
6
|
import {
|
|
7
7
|
CallingState,
|
|
8
|
+
hasPausedTrack,
|
|
8
9
|
hasScreenShare,
|
|
9
10
|
hasVideo,
|
|
10
11
|
SfuModels,
|
|
@@ -96,9 +97,10 @@ export const VideoRenderer = ({
|
|
|
96
97
|
!!videoStreamToRender &&
|
|
97
98
|
isVisible &&
|
|
98
99
|
isPublishingVideoTrack &&
|
|
100
|
+
!hasPausedTrack(participant, trackType) &&
|
|
99
101
|
isParticipantVideoEnabled(participant.sessionId);
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
useEffect(() => {
|
|
102
104
|
if (
|
|
103
105
|
Platform.OS === 'ios' &&
|
|
104
106
|
registerIosScreenshot &&
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path, Svg } from 'react-native-svg';
|
|
3
|
+
import { type ColorValue } from 'react-native/types';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
color: ColorValue;
|
|
7
|
+
size: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const BadNetwork = ({ color, size }: Props) => (
|
|
11
|
+
<Svg viewBox="0 0 24 24" width={size} height={size}>
|
|
12
|
+
<Path d="M24 0H0v24h24z" fill="none" />
|
|
13
|
+
<Path
|
|
14
|
+
d="M8.1 5c.17 0 .32.09.41.23l.07.15 5.18 11.65c.16.29.26.61.26.96 0 1.11-.9 2.01-2.01 2.01-.96 0-1.77-.68-1.96-1.59l-.01-.03L7.6 5.5c0-.28.22-.5.5-.5M23 9l-2 2a12.66 12.66 0 0 0-10.53-3.62L9.28 4.7c4.83-.86 9.98.57 13.72 4.3M3 11 1 9a15.4 15.4 0 0 1 5.59-3.57l.53 2.82C5.62 8.87 4.22 9.78 3 11m4 4-2-2c.8-.8 1.7-1.42 2.66-1.89l.55 2.92c-.42.27-.83.59-1.21.97m12-2-2 2a7.1 7.1 0 0 0-4.03-2l-1.28-2.88c2.63-.08 5.3.87 7.31 2.88"
|
|
15
|
+
fill={color}
|
|
16
|
+
/>
|
|
17
|
+
</Svg>
|
|
18
|
+
);
|
package/src/icons/index.tsx
CHANGED
|
@@ -72,11 +72,9 @@ export const AppStateListener = () => {
|
|
|
72
72
|
const subscription = AppState.addEventListener('change', (nextAppState) => {
|
|
73
73
|
const logger = getLogger(['AppStateListener']);
|
|
74
74
|
if (appState.current.match(/background/) && nextAppState === 'active') {
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
) {
|
|
79
|
-
// when device is locked and resumed, the status isnt made disabled but stays enabled
|
|
75
|
+
if (call?.camera?.state.status === 'enabled') {
|
|
76
|
+
// Android: when device is locked and resumed, the status isnt made disabled but stays enabled
|
|
77
|
+
// iOS PiP: when local track was replaced by remote track, the local track shown is blank
|
|
80
78
|
// as a workaround we stop the track and enable again if its already in enabled state
|
|
81
79
|
call?.camera?.disable(true).then(() => {
|
|
82
80
|
call?.camera?.enable();
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.19.1';
|