@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.
Files changed (54) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +10 -0
  3. package/android/src/main/java/com/streamvideo/reactnative/util/PiPHelper.kt +18 -0
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js +22 -2
  5. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  6. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +8 -10
  7. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  8. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +10 -0
  9. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  10. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js +2 -2
  11. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
  12. package/dist/commonjs/icons/BadNetwork.js +25 -0
  13. package/dist/commonjs/icons/BadNetwork.js.map +1 -0
  14. package/dist/commonjs/icons/index.js +11 -0
  15. package/dist/commonjs/icons/index.js.map +1 -1
  16. package/dist/commonjs/providers/StreamCall/AppStateListener.js +3 -2
  17. package/dist/commonjs/providers/StreamCall/AppStateListener.js.map +1 -1
  18. package/dist/commonjs/version.js +1 -1
  19. package/dist/module/components/Call/CallContent/CallContent.js +23 -3
  20. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  21. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +6 -8
  22. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  23. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +12 -2
  24. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  25. package/dist/module/components/Participant/ParticipantView/VideoRenderer.js +3 -3
  26. package/dist/module/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
  27. package/dist/module/icons/BadNetwork.js +17 -0
  28. package/dist/module/icons/BadNetwork.js.map +1 -0
  29. package/dist/module/icons/index.js +1 -0
  30. package/dist/module/icons/index.js.map +1 -1
  31. package/dist/module/providers/StreamCall/AppStateListener.js +3 -2
  32. package/dist/module/providers/StreamCall/AppStateListener.js.map +1 -1
  33. package/dist/module/version.js +1 -1
  34. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  35. package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts +2 -2
  36. package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
  37. package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
  38. package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
  39. package/dist/typescript/icons/BadNetwork.d.ts +9 -0
  40. package/dist/typescript/icons/BadNetwork.d.ts.map +1 -0
  41. package/dist/typescript/icons/index.d.ts +1 -0
  42. package/dist/typescript/icons/index.d.ts.map +1 -1
  43. package/dist/typescript/providers/StreamCall/AppStateListener.d.ts.map +1 -1
  44. package/dist/typescript/version.d.ts +1 -1
  45. package/ios/RTCViewPipManager.swift +17 -4
  46. package/package.json +3 -3
  47. package/src/components/Call/CallContent/CallContent.tsx +40 -4
  48. package/src/components/Call/CallContent/RTCViewPipIOS.tsx +4 -7
  49. package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +14 -1
  50. package/src/components/Participant/ParticipantView/VideoRenderer.tsx +3 -1
  51. package/src/icons/BadNetwork.tsx +18 -0
  52. package/src/icons/index.tsx +1 -0
  53. package/src/providers/StreamCall/AppStateListener.tsx +3 -5
  54. 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/useDebouncedValue';
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(({ includeLocalParticipantVideo }: Props) => {
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 || state === CallingState.IDLE) {
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
- React.useEffect(() => {
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
+ );
@@ -1,3 +1,4 @@
1
+ export * from './BadNetwork';
1
2
  export * from './CameraSwitch';
2
3
  export * from './Mic';
3
4
  export * from './MicOff';
@@ -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
- call?.camera?.state.status === 'enabled' &&
77
- Platform.OS === 'android'
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.18.1';
1
+ export const version = '1.19.1';