@stream-io/video-react-native-sdk 0.0.27 → 0.1.0

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 (118) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +19 -10
  3. package/dist/commonjs/components/Call/CallContent/CallContent.js +17 -6
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  5. package/dist/commonjs/components/Call/CallControls/CallControls.js +8 -4
  6. package/dist/commonjs/components/Call/CallControls/CallControls.js.map +1 -1
  7. package/dist/commonjs/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +8 -8
  8. package/dist/commonjs/components/Call/CallControls/ReactionsButton.js.map +1 -0
  9. package/dist/commonjs/components/Call/CallControls/index.js +4 -4
  10. package/dist/commonjs/components/Call/CallControls/index.js.map +1 -1
  11. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
  12. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  13. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +10 -3
  14. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  15. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +19 -9
  16. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  17. package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +14 -4
  18. package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
  19. package/dist/commonjs/components/Call/CallTopView/CallTopView.js +5 -2
  20. package/dist/commonjs/components/Call/CallTopView/CallTopView.js.map +1 -1
  21. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +4 -2
  22. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  23. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +6 -3
  24. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
  25. package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js +4 -18
  26. package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
  27. package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js +6 -3
  28. package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
  29. package/dist/commonjs/constants/index.js.map +1 -1
  30. package/dist/commonjs/utils/StreamVideoRN/index.js +1 -2
  31. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  32. package/dist/commonjs/version.js +1 -1
  33. package/dist/commonjs/version.js.map +1 -1
  34. package/dist/module/components/Call/CallContent/CallContent.js +17 -6
  35. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  36. package/dist/module/components/Call/CallControls/CallControls.js +8 -4
  37. package/dist/module/components/Call/CallControls/CallControls.js.map +1 -1
  38. package/dist/module/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +6 -6
  39. package/dist/module/components/Call/CallControls/ReactionsButton.js.map +1 -0
  40. package/dist/module/components/Call/CallControls/index.js +1 -1
  41. package/dist/module/components/Call/CallControls/index.js.map +1 -1
  42. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
  43. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  44. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +10 -3
  45. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  46. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +19 -9
  47. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  48. package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +14 -4
  49. package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
  50. package/dist/module/components/Call/CallTopView/CallTopView.js +5 -2
  51. package/dist/module/components/Call/CallTopView/CallTopView.js.map +1 -1
  52. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +4 -2
  53. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  54. package/dist/module/components/Participant/FloatingParticipantView/index.js +6 -3
  55. package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
  56. package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js +6 -20
  57. package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
  58. package/dist/module/components/Participant/ParticipantView/ParticipantView.js +6 -3
  59. package/dist/module/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
  60. package/dist/module/constants/index.js.map +1 -1
  61. package/dist/module/utils/StreamVideoRN/index.js +1 -2
  62. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  63. package/dist/module/version.js +1 -1
  64. package/dist/module/version.js.map +1 -1
  65. package/dist/typescript/components/Call/CallContent/CallContent.d.ts +20 -6
  66. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  67. package/dist/typescript/components/Call/CallControls/CallControls.d.ts +6 -5
  68. package/dist/typescript/components/Call/CallControls/CallControls.d.ts.map +1 -1
  69. package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts +20 -0
  70. package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts.map +1 -0
  71. package/dist/typescript/components/Call/CallControls/index.d.ts +1 -1
  72. package/dist/typescript/components/Call/CallControls/index.d.ts.map +1 -1
  73. package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts +4 -5
  74. package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
  75. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts +10 -8
  76. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
  77. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts +8 -6
  78. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
  79. package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts +8 -2
  80. package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
  81. package/dist/typescript/components/Call/CallTopView/CallTopView.d.ts.map +1 -1
  82. package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts +5 -0
  83. package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
  84. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts +3 -3
  85. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
  86. package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts +3 -2
  87. package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts.map +1 -1
  88. package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts +4 -4
  89. package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts.map +1 -1
  90. package/dist/typescript/constants/index.d.ts +2 -2
  91. package/dist/typescript/constants/index.d.ts.map +1 -1
  92. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  93. package/dist/typescript/utils/StreamVideoRN/types.d.ts +1 -11
  94. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  95. package/dist/typescript/version.d.ts +1 -1
  96. package/dist/typescript/version.d.ts.map +1 -1
  97. package/package.json +1 -1
  98. package/src/components/Call/CallContent/CallContent.tsx +59 -28
  99. package/src/components/Call/CallControls/CallControls.tsx +18 -12
  100. package/src/components/Call/CallControls/{ReactionButton.tsx → ReactionsButton.tsx} +13 -6
  101. package/src/components/Call/CallControls/index.tsx +1 -1
  102. package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +14 -14
  103. package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +24 -12
  104. package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +25 -9
  105. package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +33 -16
  106. package/src/components/Call/CallTopView/CallTopView.tsx +4 -2
  107. package/src/components/Call/RingingCallContent/RingingCallContent.tsx +11 -1
  108. package/src/components/Participant/FloatingParticipantView/index.tsx +9 -2
  109. package/src/components/Participant/ParticipantView/ParticipantReaction.tsx +16 -29
  110. package/src/components/Participant/ParticipantView/ParticipantView.tsx +40 -33
  111. package/src/constants/index.ts +2 -2
  112. package/src/utils/StreamVideoRN/index.ts +1 -2
  113. package/src/utils/StreamVideoRN/types.ts +1 -11
  114. package/src/version.ts +1 -1
  115. package/dist/commonjs/components/Call/CallControls/ReactionButton.js.map +0 -1
  116. package/dist/module/components/Call/CallControls/ReactionButton.js.map +0 -1
  117. package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts +0 -15
  118. package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts.map +0 -1
@@ -21,6 +21,7 @@ import {
21
21
  ParticipantViewComponentProps,
22
22
  ParticipantViewProps,
23
23
  } from '../../Participant/ParticipantView';
24
+ import { CallContentProps } from '../CallContent';
24
25
 
25
26
  type FlatListProps = React.ComponentProps<
26
27
  typeof FlatList<StreamVideoParticipant | StreamVideoLocalParticipant>
@@ -42,21 +43,27 @@ export type CallParticipantsListComponentProps =
42
43
  /**
43
44
  * Props of the CallParticipantsList component
44
45
  */
45
- export type CallParticipantsListProps = CallParticipantsListComponentProps & {
46
- /**
47
- * The list of participants to display in the list
48
- */
49
- participants: (StreamVideoParticipant | StreamVideoLocalParticipant)[];
50
- /**
51
- * The number of columns to display in the list of participants while in vertical or horizontal scrolling mode. This property is only used when there are more than 2 participants.
52
- * @default 2
53
- */
54
- numberOfColumns?: number;
55
- /**
56
- * If true, the list will be displayed in horizontal scrolling mode
57
- */
58
- horizontal?: boolean;
59
- };
46
+ export type CallParticipantsListProps = CallParticipantsListComponentProps &
47
+ Pick<CallContentProps, 'supportedReactions'> & {
48
+ /**
49
+ * The list of participants to display in the list
50
+ */
51
+ participants: (StreamVideoParticipant | StreamVideoLocalParticipant)[];
52
+ /**
53
+ * The number of columns to display in the list of participants while in vertical or horizontal scrolling mode. This property is only used when there are more than 2 participants.
54
+ * @default 2
55
+ */
56
+ numberOfColumns?: number;
57
+ /**
58
+ * If true, the list will be displayed in horizontal scrolling mode
59
+ */
60
+ horizontal?: boolean;
61
+ /**
62
+ * Check if phone is in landscape mode.
63
+ * This will apply the landscape mode styles to the component.
64
+ */
65
+ landscape?: boolean;
66
+ };
60
67
 
61
68
  /**
62
69
  * This component displays a list of participants in a FlatList.
@@ -74,6 +81,8 @@ export const CallParticipantsList = ({
74
81
  ParticipantReaction,
75
82
  ParticipantVideoFallback,
76
83
  VideoRenderer,
84
+ supportedReactions,
85
+ landscape,
77
86
  }: CallParticipantsListProps) => {
78
87
  const [containerLayout, setContainerLayout] = useState({
79
88
  width: 0,
@@ -162,8 +171,11 @@ export const CallParticipantsList = ({
162
171
  if (horizontal) {
163
172
  return [styles.participantWrapperHorizontal, style];
164
173
  }
174
+ if (landscape) {
175
+ return [styles.landScapeStyle, style];
176
+ }
165
177
  return style;
166
- }, [itemWidth, itemHeight, horizontal]);
178
+ }, [itemWidth, itemHeight, horizontal, landscape]);
167
179
 
168
180
  const participantProps: ParticipantViewComponentProps = {
169
181
  ParticipantLabel,
@@ -186,6 +198,7 @@ export const CallParticipantsList = ({
186
198
  style={itemContainerStyle}
187
199
  trackType="videoTrack"
188
200
  isVisible={isVisible}
201
+ supportedReactions={supportedReactions}
189
202
  {...participantProps}
190
203
  />
191
204
  )}
@@ -211,6 +224,7 @@ export const CallParticipantsList = ({
211
224
  style={styles.flexed}
212
225
  trackType="videoTrack"
213
226
  key={keyExtractor(participant, index)}
227
+ supportedReactions={supportedReactions}
214
228
  {...participantProps}
215
229
  />
216
230
  )
@@ -247,6 +261,9 @@ const styles = StyleSheet.create({
247
261
  marginHorizontal: 8,
248
262
  borderRadius: 10,
249
263
  },
264
+ landScapeStyle: {
265
+ borderRadius: 10,
266
+ },
250
267
  });
251
268
 
252
269
  /**
@@ -50,6 +50,7 @@ export const CallTopView = ({
50
50
  ParticipantsInfoBadge = DefaultParticipantsInfoBadge,
51
51
  }: CallTopViewProps) => {
52
52
  const [callTopViewHeight, setCallTopViewHeight] = useState<number>(0);
53
+ const [callTopViewWidth, setCallTopViewWidth] = useState<number>(0);
53
54
  const {
54
55
  theme: {
55
56
  colors,
@@ -64,16 +65,17 @@ export const CallTopView = ({
64
65
  const isCallReconnecting = callingState === CallingState.RECONNECTING;
65
66
 
66
67
  const onLayout: React.ComponentProps<typeof View>['onLayout'] = (event) => {
67
- const { height } = event.nativeEvent.layout;
68
+ const { height, width } = event.nativeEvent.layout;
68
69
  if (setCallTopViewHeight) {
69
70
  setCallTopViewHeight(height);
71
+ setCallTopViewWidth(width);
70
72
  }
71
73
  };
72
74
 
73
75
  return (
74
76
  <View style={[styleProp, callTopView.container]}>
75
77
  {/* Component for the background of the CallTopView. Since it has a Linear Gradient, an SVG is used to render it. */}
76
- <TopViewBackground height={callTopViewHeight} width={'100%'} />
78
+ <TopViewBackground height={callTopViewHeight} width={callTopViewWidth} />
77
79
  <View style={[styles.content, callTopView.content]} onLayout={onLayout}>
78
80
  <View style={styles.leftElement}>
79
81
  {onBackPressed && (
@@ -42,6 +42,11 @@ export type RingingCallContentProps = {
42
42
  * Prop to customize the JoiningCallIndicator component in the RingingCallContent. It is shown when the call is accepted and is waiting to be joined.
43
43
  */
44
44
  JoiningCallIndicator?: React.ComponentType | null;
45
+ /**
46
+ * Check if device is in landscape mode.
47
+ * This will apply the landscape mode styles to the component.
48
+ */
49
+ landscape?: boolean;
45
50
  };
46
51
 
47
52
  const RingingCallPanel = ({
@@ -50,6 +55,7 @@ const RingingCallPanel = ({
50
55
  CallContent = DefaultCallContent,
51
56
  JoiningCallIndicator = DefaultJoiningCallIndicator,
52
57
  CallTopView,
58
+ landscape,
53
59
  }: RingingCallContentProps) => {
54
60
  const call = useCall();
55
61
  const isCallCreatedByMe = call?.isCreatedByMe;
@@ -63,7 +69,11 @@ const RingingCallPanel = ({
63
69
  ? OutgoingCall && <OutgoingCall CallTopView={CallTopView} />
64
70
  : IncomingCall && <IncomingCall CallTopView={CallTopView} />;
65
71
  case CallingState.JOINED:
66
- return CallContent && <CallContent CallTopView={CallTopView} />;
72
+ return (
73
+ CallContent && (
74
+ <CallContent CallTopView={CallTopView} landscape={landscape} />
75
+ )
76
+ );
67
77
  case CallingState.JOINING:
68
78
  return JoiningCallIndicator && <JoiningCallIndicator />;
69
79
  default:
@@ -10,7 +10,10 @@ import { FLOATING_VIDEO_VIEW_STYLE, Z_INDEX } from '../../../constants';
10
10
  import { ComponentTestIds } from '../../../constants/TestIds';
11
11
  import { VideoSlash } from '../../../icons';
12
12
  import FloatingView from './FloatingView';
13
- import { CallParticipantsListProps } from '../../Call';
13
+ import {
14
+ CallContentProps,
15
+ CallParticipantsListComponentProps,
16
+ } from '../../Call';
14
17
  import { FloatingViewAlignment } from './FloatingView/common';
15
18
  import {
16
19
  ParticipantView as DefaultParticipantView,
@@ -29,7 +32,8 @@ export type FloatingParticipantViewAlignment =
29
32
  * Props to be passed for the LocalVideoView component.
30
33
  */
31
34
  export type FloatingParticipantViewProps = ParticipantViewComponentProps &
32
- Pick<CallParticipantsListProps, 'ParticipantView'> & {
35
+ Pick<CallParticipantsListComponentProps, 'ParticipantView'> &
36
+ Pick<CallContentProps, 'supportedReactions'> & {
33
37
  /**
34
38
  * Determines where the floating participant video will be placed.
35
39
  */
@@ -85,6 +89,7 @@ export const FloatingParticipantView = ({
85
89
  ParticipantNetworkQualityIndicator,
86
90
  ParticipantReaction,
87
91
  VideoRenderer,
92
+ supportedReactions,
88
93
  }: FloatingParticipantViewProps) => {
89
94
  const {
90
95
  theme: { colors, floatingParticipantsView },
@@ -160,6 +165,7 @@ export const FloatingParticipantView = ({
160
165
  // video z order must be one above the one used in grid view
161
166
  // (which uses the default: 0)
162
167
  videoZOrder={1}
168
+ supportedReactions={supportedReactions}
163
169
  {...participantViewProps}
164
170
  />
165
171
  )}
@@ -188,6 +194,7 @@ const styles = StyleSheet.create({
188
194
  shadowOpacity: 0.23,
189
195
  shadowRadius: 2.62,
190
196
  elevation: 4,
197
+ borderWidth: 0,
191
198
  },
192
199
  videoFallback: {
193
200
  ...StyleSheet.absoluteFillObject,
@@ -1,10 +1,10 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { StyleSheet, Text, View } from 'react-native';
3
3
  import { useCall } from '@stream-io/video-react-bindings';
4
- import { StreamVideoRN } from '../../../utils';
5
- import { Z_INDEX } from '../../../constants';
4
+ import { Z_INDEX, defaultEmojiReactions } from '../../../constants';
6
5
  import { ParticipantViewProps } from './ParticipantView';
7
6
  import { useTheme } from '../../../contexts/ThemeContext';
7
+ import { CallContentProps } from '../../Call';
8
8
 
9
9
  /**
10
10
  * Props for the ParticipantReaction component.
@@ -12,23 +12,24 @@ import { useTheme } from '../../../contexts/ThemeContext';
12
12
  export type ParticipantReactionProps = Pick<
13
13
  ParticipantViewProps,
14
14
  'participant'
15
- > & {
16
- /**
17
- * The duration after which the reaction should disappear.
18
- *
19
- * @default 5500
20
- */
21
- hideAfterTimeoutInMs?: number;
22
- };
15
+ > &
16
+ Pick<CallContentProps, 'supportedReactions'> & {
17
+ /**
18
+ * The duration after which the reaction should disappear.
19
+ *
20
+ * @default 5500
21
+ */
22
+ hideAfterTimeoutInMs?: number;
23
+ };
23
24
 
24
25
  /**
25
26
  * This component is used to display the current participant reaction.
26
27
  */
27
28
  export const ParticipantReaction = ({
28
29
  participant,
30
+ supportedReactions = defaultEmojiReactions,
29
31
  hideAfterTimeoutInMs = 5500,
30
32
  }: ParticipantReactionProps) => {
31
- const { supportedReactions } = StreamVideoRN.getConfig();
32
33
  const { reaction, sessionId } = participant;
33
34
  const call = useCall();
34
35
  const {
@@ -38,14 +39,11 @@ export const ParticipantReaction = ({
38
39
  participantReaction,
39
40
  },
40
41
  } = useTheme();
41
- const [isShowing, setIsShowing] = useState<boolean>(false);
42
42
 
43
43
  useEffect(() => {
44
44
  let timeoutId: NodeJS.Timeout;
45
45
  if (call) {
46
- setIsShowing(true);
47
46
  timeoutId = setTimeout(() => {
48
- setIsShowing(false);
49
47
  call.resetReaction(sessionId);
50
48
  }, hideAfterTimeoutInMs);
51
49
  }
@@ -61,19 +59,6 @@ export const ParticipantReaction = ({
61
59
  supportedReaction.emoji_code === reaction.emoji_code,
62
60
  );
63
61
 
64
- let component;
65
- if (isShowing) {
66
- if (typeof currentReaction?.icon !== 'string') {
67
- component = currentReaction?.icon;
68
- } else {
69
- component = (
70
- <Text style={[participantReaction.reaction, typefaces.heading6]}>
71
- {currentReaction.icon}
72
- </Text>
73
- );
74
- }
75
- }
76
-
77
62
  return (
78
63
  <View
79
64
  style={[
@@ -85,7 +70,9 @@ export const ParticipantReaction = ({
85
70
  participantReaction.container,
86
71
  ]}
87
72
  >
88
- {component}
73
+ <Text style={[participantReaction.reaction, typefaces.heading6]}>
74
+ {currentReaction?.icon}
75
+ </Text>
89
76
  </View>
90
77
  );
91
78
  };
@@ -25,8 +25,7 @@ import {
25
25
  VideoRendererProps,
26
26
  } from './VideoRenderer';
27
27
  import { useTheme } from '../../../contexts/ThemeContext';
28
-
29
- export type ParticipantVideoType = VideoTrackType;
28
+ import { CallContentProps } from '../../Call';
30
29
 
31
30
  export type ParticipantViewComponentProps = {
32
31
  /**
@@ -54,35 +53,36 @@ export type ParticipantViewComponentProps = {
54
53
  /**
55
54
  * Props to be passed for the Participant component.
56
55
  */
57
- export type ParticipantViewProps = ParticipantViewComponentProps & {
58
- /**
59
- * The participant that will be displayed.
60
- */
61
- participant: StreamVideoParticipant;
62
- /**
63
- * The zOrder for the video that will be displayed.
64
- * For example, a video call
65
- * application usually needs a maximum of two zOrder values: 0 for the
66
- * remote video(s) which appear in the background, and 1 for the local
67
- * video(s) which appear above the remote video(s).
68
- * @default 0
69
- */
70
- videoZOrder?: number;
71
- /**
72
- * The video track that is to be displayed.
73
- */
74
- trackType?: ParticipantVideoType;
75
- /**
76
- * Custom style to be merged with the participant view.
77
- */
78
- style?: StyleProp<ViewStyle>;
79
- /**
80
- * When set to false, the video stream will not be shown even if it is available.
81
- *
82
- * @default true
83
- */
84
- isVisible?: boolean;
85
- };
56
+ export type ParticipantViewProps = ParticipantViewComponentProps &
57
+ Pick<CallContentProps, 'supportedReactions'> & {
58
+ /**
59
+ * The participant that will be displayed.
60
+ */
61
+ participant: StreamVideoParticipant;
62
+ /**
63
+ * The zOrder for the video that will be displayed.
64
+ * For example, a video call
65
+ * application usually needs a maximum of two zOrder values: 0 for the
66
+ * remote video(s) which appear in the background, and 1 for the local
67
+ * video(s) which appear above the remote video(s).
68
+ * @default 0
69
+ */
70
+ videoZOrder?: number;
71
+ /**
72
+ * The video track that is to be displayed.
73
+ */
74
+ trackType?: VideoTrackType;
75
+ /**
76
+ * Custom style to be merged with the participant view.
77
+ */
78
+ style?: StyleProp<ViewStyle>;
79
+ /**
80
+ * When set to false, the video stream will not be shown even if it is available.
81
+ *
82
+ * @default true
83
+ */
84
+ isVisible?: boolean;
85
+ };
86
86
 
87
87
  /**
88
88
  * A component that renders the participants' video track or screenShare track
@@ -100,6 +100,7 @@ export const ParticipantView = ({
100
100
  ParticipantNetworkQualityIndicator = DefaultParticipantNetworkQualityIndicator,
101
101
  ParticipantVideoFallback = DefaultParticipantVideoFallback,
102
102
  videoZOrder = 0,
103
+ supportedReactions,
103
104
  }: ParticipantViewProps) => {
104
105
  const {
105
106
  theme: { colors, participantView },
@@ -124,7 +125,12 @@ export const ParticipantView = ({
124
125
  : `participant-${userId}-is-not-speaking`
125
126
  }
126
127
  >
127
- {ParticipantReaction && <ParticipantReaction participant={participant} />}
128
+ {ParticipantReaction && (
129
+ <ParticipantReaction
130
+ participant={participant}
131
+ supportedReactions={supportedReactions}
132
+ />
133
+ )}
128
134
  {VideoRenderer && (
129
135
  <VideoRenderer
130
136
  isVisible={isVisible}
@@ -151,7 +157,8 @@ const styles = StyleSheet.create({
151
157
  justifyContent: 'space-between',
152
158
  padding: 4,
153
159
  overflow: 'hidden',
154
- margin: 2,
160
+ borderWidth: 2,
161
+ borderColor: 'transparent',
155
162
  },
156
163
  footerContainer: {
157
164
  flexDirection: 'row',
@@ -1,4 +1,4 @@
1
- import { StreamVideoConfig } from '../utils/StreamVideoRN/types';
1
+ import { StreamReactionType } from '../components';
2
2
 
3
3
  export const FLOATING_VIDEO_VIEW_STYLE = {
4
4
  height: 140,
@@ -8,7 +8,7 @@ export const FLOATING_VIDEO_VIEW_STYLE = {
8
8
 
9
9
  export const LOBBY_VIDEO_VIEW_HEIGHT = 280;
10
10
 
11
- export const defaultEmojiReactions: StreamVideoConfig['supportedReactions'] = [
11
+ export const defaultEmojiReactions: StreamReactionType[] = [
12
12
  {
13
13
  type: 'reaction',
14
14
  emoji_code: ':like:',
@@ -1,10 +1,8 @@
1
1
  import { AndroidImportance } from '@notifee/react-native';
2
- import { defaultEmojiReactions } from '../../constants';
3
2
  import { setupFirebaseHandlerAndroid } from '../push/android';
4
3
  import { StreamVideoConfig } from './types';
5
4
 
6
5
  const DEFAULT_STREAM_VIDEO_CONFIG: StreamVideoConfig = {
7
- supportedReactions: defaultEmojiReactions,
8
6
  foregroundService: {
9
7
  android: {
10
8
  channel: {
@@ -24,6 +22,7 @@ const DEFAULT_STREAM_VIDEO_CONFIG: StreamVideoConfig = {
24
22
 
25
23
  export class StreamVideoRN {
26
24
  private static config = DEFAULT_STREAM_VIDEO_CONFIG;
25
+
27
26
  /**
28
27
  * Update the global config for StreamVideoRN except for push config.
29
28
  * To set push config use `StreamVideoRN.setPushConfig` instead.
@@ -1,17 +1,7 @@
1
- import { StreamReaction, StreamVideoClient } from '@stream-io/video-client';
1
+ import { StreamVideoClient } from '@stream-io/video-client';
2
2
  import { AndroidChannel } from '@notifee/react-native';
3
3
 
4
- type StreamReactionType = Required<StreamReaction> & {
5
- icon: string | JSX.Element;
6
- };
7
-
8
4
  export type StreamVideoConfig = {
9
- /**
10
- * Reactions that are to be supported in the app.
11
- *
12
- * Note: This is an array of reactions that is rendered in the Reaction list.
13
- */
14
- supportedReactions: StreamReactionType[];
15
5
  /**
16
6
  * The configuration to be used for push notifications.
17
7
  * If undefined, push notifications will not be enabled for the app
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.0.27';
1
+ export const version = '0.1.0';
@@ -1 +0,0 @@
1
- {"version":3,"names":["_videoReactBindings","require","_react","_interopRequireWildcard","_CallControlsButton","_videoClient","_TestIds","_icons","_ReactionsPicker","_utils","_ThemeContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ReactionButton","_ref","onPressHandler","showReactionsPicker","setShowReactionsPicker","useState","reactionsButtonLayoutRectangle","setReactionsButtonLayoutRectangle","theme","colors","useTheme","onReactionsButtonLayout","event","layout","nativeEvent","prev","width","height","x","y","reactionButtonHandler","createElement","Fragment","Restricted","requiredGrants","OwnCapability","CREATE_REACTION","CallControlsButton","testID","ButtonTestIds","REACTION","onPress","onLayout","Reaction","color","static_black","ReactionsPicker","reactions","StreamVideoRN","getConfig","supportedReactions","onRequestedClose","exports"],"sourceRoot":"../../../../../src","sources":["components/Call/CallControls/ReactionButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAEA,IAAAS,aAAA,GAAAT,OAAA;AAA0D,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAA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AAAoC,aAAA,CAAC9C,gBAAA,CAAA6D,eAAe;IACdC,SAAS,EAAEC,oBAAa,CAACC,SAAS,CAAC,CAAC,CAACC,kBAAmB;IACxDlC,8BAA8B,EAAEA,8BAA+B;IAC/DmC,gBAAgB,EAAEA,CAAA,KAAM;MACtBrC,sBAAsB,CAAC,KAAK,CAAC;IAC/B;EAAE,CACH,CAEH,CAAC;AAEP,CAAC;AAACsC,OAAA,CAAA1C,cAAA,GAAAA,cAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["Restricted","React","useState","CallControlsButton","OwnCapability","ButtonTestIds","Reaction","ReactionsPicker","StreamVideoRN","useTheme","ReactionButton","_ref","onPressHandler","showReactionsPicker","setShowReactionsPicker","reactionsButtonLayoutRectangle","setReactionsButtonLayoutRectangle","theme","colors","onReactionsButtonLayout","event","layout","nativeEvent","prev","width","height","x","y","reactionButtonHandler","createElement","Fragment","requiredGrants","CREATE_REACTION","testID","REACTION","onPress","onLayout","color","static_black","reactions","getConfig","supportedReactions","onRequestedClose"],"sourceRoot":"../../../../../src","sources":["components/Call/CallControls/ReactionButton.tsx"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iCAAiC;AAC5D,OAAOC,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,aAAa,QAAQ,gBAAgB;AAE9C,SAASC,QAAQ,QAAQ,gCAAgC;;AAEzD;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGC,IAAA,IAA6C;EAAA,IAA5C;IAAEC;EAAoC,CAAC,GAAAD,IAAA;EACpE,MAAM,CAACE,mBAAmB,EAAEC,sBAAsB,CAAC,GACjDZ,QAAQ,CAAU,KAAK,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e;IACdgC,SAAS,EAAE/B,aAAa,CAACgC,SAAS,CAAC,CAAC,CAACC,kBAAmB;IACxD1B,8BAA8B,EAAEA,8BAA+B;IAC/D2B,gBAAgB,EAAEA,CAAA,KAAM;MACtB5B,sBAAsB,CAAC,KAAK,CAAC;IAC/B;EAAE,CACH,CAEH,CAAC;AAEP,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Props for the Reaction button
3
- */
4
- export type ReactionButtonProps = {
5
- /**
6
- * Handler to be called when the reaction button is pressed.
7
- */
8
- onPressHandler?: () => void;
9
- };
10
- /**
11
- * Button to display the list of Reactions supported in the call.
12
- * On press, it opens a view that can be used to send Reaction.
13
- */
14
- export declare const ReactionButton: ({ onPressHandler }: ReactionButtonProps) => JSX.Element;
15
- //# sourceMappingURL=ReactionButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactionButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallControls/ReactionButton.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,uBAAwB,mBAAmB,gBAuDrE,CAAC"}