@stream-io/video-react-native-sdk 0.6.2 → 0.6.3

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 (196) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/commonjs/components/Call/CallContent/CallContent.js +3 -0
  3. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  4. package/dist/commonjs/components/Call/CallControls/{ScreenShareButton.js → ScreenShareToggleButton.js} +44 -43
  5. package/dist/commonjs/components/Call/CallControls/ScreenShareToggleButton.js.map +1 -0
  6. package/dist/commonjs/components/Call/CallControls/index.js +4 -4
  7. package/dist/commonjs/components/Call/CallControls/index.js.map +1 -1
  8. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +3 -2
  9. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  10. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js +59 -6
  11. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js.map +1 -1
  12. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js +7 -3
  13. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -1
  14. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +13 -9
  15. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  16. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.js +126 -0
  17. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.js.map +1 -0
  18. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +4 -2
  19. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -1
  20. package/dist/commonjs/components/Livestream/LivestreamControls/index.js +44 -11
  21. package/dist/commonjs/components/Livestream/LivestreamControls/index.js.map +1 -1
  22. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js +45 -6
  23. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -1
  24. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +4 -2
  25. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -1
  26. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +4 -2
  27. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -1
  28. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js +11 -0
  29. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js.map +1 -1
  30. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +24 -23
  31. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
  32. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +4 -3
  33. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
  34. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js +33 -9
  35. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
  36. package/dist/commonjs/components/utility/ScreenShareOverlay.js +92 -0
  37. package/dist/commonjs/components/utility/ScreenShareOverlay.js.map +1 -0
  38. package/dist/commonjs/components/utility/index.js +11 -0
  39. package/dist/commonjs/components/utility/index.js.map +1 -1
  40. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +5 -3
  41. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  42. package/dist/commonjs/icons/StopScreenShare.js +26 -0
  43. package/dist/commonjs/icons/StopScreenShare.js.map +1 -0
  44. package/dist/commonjs/icons/index.js +11 -0
  45. package/dist/commonjs/icons/index.js.map +1 -1
  46. package/dist/commonjs/theme/theme.js +13 -4
  47. package/dist/commonjs/theme/theme.js.map +1 -1
  48. package/dist/commonjs/translations/en.json +2 -0
  49. package/dist/commonjs/utils/StreamVideoRN/index.js +2 -1
  50. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  51. package/dist/commonjs/utils/internal/pushLogoutCallback.js.map +1 -1
  52. package/dist/commonjs/utils/push/android.js +6 -4
  53. package/dist/commonjs/utils/push/android.js.map +1 -1
  54. package/dist/commonjs/utils/push/ios.js +6 -4
  55. package/dist/commonjs/utils/push/ios.js.map +1 -1
  56. package/dist/commonjs/version.js +1 -1
  57. package/dist/module/components/Call/CallContent/CallContent.js +3 -0
  58. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  59. package/dist/module/components/Call/CallControls/{ScreenShareButton.js → ScreenShareToggleButton.js} +41 -40
  60. package/dist/module/components/Call/CallControls/ScreenShareToggleButton.js.map +1 -0
  61. package/dist/module/components/Call/CallControls/index.js +1 -1
  62. package/dist/module/components/Call/CallControls/index.js.map +1 -1
  63. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +3 -2
  64. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  65. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js +60 -7
  66. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js.map +1 -1
  67. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js +7 -3
  68. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -1
  69. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +13 -9
  70. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  71. package/dist/module/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.js +117 -0
  72. package/dist/module/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.js.map +1 -0
  73. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +4 -2
  74. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -1
  75. package/dist/module/components/Livestream/LivestreamControls/index.js +4 -1
  76. package/dist/module/components/Livestream/LivestreamControls/index.js.map +1 -1
  77. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js +43 -5
  78. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -1
  79. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +4 -2
  80. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -1
  81. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +4 -2
  82. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -1
  83. package/dist/module/components/Livestream/LivestreamTopView/index.js +1 -0
  84. package/dist/module/components/Livestream/LivestreamTopView/index.js.map +1 -1
  85. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +24 -24
  86. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
  87. package/dist/module/components/Participant/FloatingParticipantView/index.js +4 -3
  88. package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
  89. package/dist/module/components/Participant/ParticipantView/VideoRenderer.js +33 -9
  90. package/dist/module/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
  91. package/dist/module/components/utility/ScreenShareOverlay.js +85 -0
  92. package/dist/module/components/utility/ScreenShareOverlay.js.map +1 -0
  93. package/dist/module/components/utility/index.js +1 -0
  94. package/dist/module/components/utility/index.js.map +1 -1
  95. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +5 -3
  96. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  97. package/dist/module/icons/StopScreenShare.js +16 -0
  98. package/dist/module/icons/StopScreenShare.js.map +1 -0
  99. package/dist/module/icons/index.js +1 -0
  100. package/dist/module/icons/index.js.map +1 -1
  101. package/dist/module/theme/theme.js +13 -4
  102. package/dist/module/theme/theme.js.map +1 -1
  103. package/dist/module/translations/en.json +2 -0
  104. package/dist/module/utils/StreamVideoRN/index.js +2 -1
  105. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  106. package/dist/module/utils/internal/pushLogoutCallback.js.map +1 -1
  107. package/dist/module/utils/push/android.js +6 -4
  108. package/dist/module/utils/push/android.js.map +1 -1
  109. package/dist/module/utils/push/ios.js +6 -4
  110. package/dist/module/utils/push/ios.js.map +1 -1
  111. package/dist/module/version.js +1 -1
  112. package/dist/typescript/components/Call/CallContent/CallContent.d.ts +6 -1
  113. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  114. package/dist/typescript/components/Call/CallControls/{ScreenShareButton.d.ts → ScreenShareToggleButton.d.ts} +3 -3
  115. package/dist/typescript/components/Call/CallControls/ScreenShareToggleButton.d.ts.map +1 -0
  116. package/dist/typescript/components/Call/CallControls/index.d.ts +1 -1
  117. package/dist/typescript/components/Call/CallControls/index.d.ts.map +1 -1
  118. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts +2 -2
  119. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
  120. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts +16 -1
  121. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts.map +1 -1
  122. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts +7 -1
  123. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts.map +1 -1
  124. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts +7 -3
  125. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -1
  126. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.d.ts +7 -0
  127. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.d.ts.map +1 -0
  128. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts +3 -1
  129. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts.map +1 -1
  130. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts +4 -1
  131. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts.map +1 -1
  132. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts +6 -1
  133. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts.map +1 -1
  134. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts +3 -1
  135. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts.map +1 -1
  136. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts +3 -1
  137. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts.map +1 -1
  138. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts +1 -0
  139. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts.map +1 -1
  140. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -1
  141. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts +8 -3
  142. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
  143. package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
  144. package/dist/typescript/components/utility/ScreenShareOverlay.d.ts +10 -0
  145. package/dist/typescript/components/utility/ScreenShareOverlay.d.ts.map +1 -0
  146. package/dist/typescript/components/utility/index.d.ts +1 -0
  147. package/dist/typescript/components/utility/index.d.ts.map +1 -1
  148. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  149. package/dist/typescript/icons/StopScreenShare.d.ts +8 -0
  150. package/dist/typescript/icons/StopScreenShare.d.ts.map +1 -0
  151. package/dist/typescript/icons/index.d.ts +1 -0
  152. package/dist/typescript/icons/index.d.ts.map +1 -1
  153. package/dist/typescript/theme/theme.d.ts +12 -3
  154. package/dist/typescript/theme/theme.d.ts.map +1 -1
  155. package/dist/typescript/translations/index.d.ts +2 -0
  156. package/dist/typescript/translations/index.d.ts.map +1 -1
  157. package/dist/typescript/utils/StreamVideoRN/index.d.ts +1 -1
  158. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  159. package/dist/typescript/utils/internal/pushLogoutCallback.d.ts +2 -2
  160. package/dist/typescript/utils/internal/pushLogoutCallback.d.ts.map +1 -1
  161. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  162. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  163. package/dist/typescript/version.d.ts +1 -1
  164. package/package.json +1 -1
  165. package/src/components/Call/CallContent/CallContent.tsx +10 -0
  166. package/src/components/Call/CallControls/{ScreenShareButton.tsx → ScreenShareToggleButton.tsx} +59 -41
  167. package/src/components/Call/CallControls/index.tsx +1 -1
  168. package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +32 -24
  169. package/src/components/Livestream/HostLivestream/HostLivestream.tsx +92 -6
  170. package/src/components/Livestream/LivestreamControls/HostLivestreamControls.tsx +10 -1
  171. package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +18 -10
  172. package/src/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.tsx +161 -0
  173. package/src/components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx +4 -1
  174. package/src/components/Livestream/LivestreamControls/index.ts +4 -1
  175. package/src/components/Livestream/LivestreamLayout/LivestreamLayout.tsx +66 -6
  176. package/src/components/Livestream/LivestreamTopView/HostLivestreamTopView.tsx +4 -1
  177. package/src/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.tsx +4 -1
  178. package/src/components/Livestream/LivestreamTopView/index.ts +1 -0
  179. package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +39 -38
  180. package/src/components/Participant/FloatingParticipantView/index.tsx +15 -5
  181. package/src/components/Participant/ParticipantView/VideoRenderer.tsx +54 -8
  182. package/src/components/utility/ScreenShareOverlay.tsx +106 -0
  183. package/src/components/utility/index.ts +1 -0
  184. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +5 -3
  185. package/src/icons/StopScreenShare.tsx +22 -0
  186. package/src/icons/index.tsx +1 -0
  187. package/src/theme/theme.ts +24 -6
  188. package/src/translations/en.json +2 -0
  189. package/src/utils/StreamVideoRN/index.ts +4 -1
  190. package/src/utils/internal/pushLogoutCallback.ts +2 -2
  191. package/src/utils/push/android.ts +6 -4
  192. package/src/utils/push/ios.ts +6 -4
  193. package/src/version.ts +1 -1
  194. package/dist/commonjs/components/Call/CallControls/ScreenShareButton.js.map +0 -1
  195. package/dist/module/components/Call/CallControls/ScreenShareButton.js.map +0 -1
  196. package/dist/typescript/components/Call/CallControls/ScreenShareButton.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
 
3
- import { StyleSheet, SafeAreaView, View } from 'react-native';
3
+ import { StyleSheet, View } from 'react-native';
4
4
  import InCallManager from 'react-native-incall-manager';
5
5
  import { useTheme } from '../../../contexts';
6
6
  import {
@@ -21,7 +21,10 @@ import {
21
21
  FloatingParticipantView as DefaultFloatingParticipantView,
22
22
  FloatingParticipantViewProps,
23
23
  } from '../../Participant';
24
- import { Z_INDEX } from '../../../constants';
24
+ import { SfuModels, StreamVideoParticipant } from '@stream-io/video-client';
25
+
26
+ const hasVideoTrack = (p?: StreamVideoParticipant) =>
27
+ p?.publishedTracks.includes(SfuModels.TrackType.VIDEO);
25
28
 
26
29
  /**
27
30
  * Props for the ViewerLivestream component.
@@ -62,11 +65,16 @@ export const ViewerLivestream = ({
62
65
  onLeaveStreamHandler,
63
66
  }: ViewerLivestreamProps) => {
64
67
  const {
65
- theme: { colors, viewerLivestream },
68
+ theme: { viewerLivestream },
66
69
  } = useTheme();
67
70
  const { useHasOngoingScreenShare, useParticipants } = useCallStateHooks();
68
71
  const hasOngoingScreenShare = useHasOngoingScreenShare();
69
72
  const [currentSpeaker] = useParticipants();
73
+ const floatingParticipant =
74
+ hasOngoingScreenShare && hasVideoTrack(currentSpeaker) && currentSpeaker;
75
+
76
+ const [topViewHeight, setTopViewHeight] = React.useState<number>();
77
+ const [controlsHeight, setControlsHeight] = React.useState<number>();
70
78
 
71
79
  // Automatically route audio to speaker devices as relevant for watching videos.
72
80
  useEffect(() => {
@@ -78,40 +86,40 @@ export const ViewerLivestream = ({
78
86
  LiveIndicator,
79
87
  FollowerCount,
80
88
  DurationBadge,
89
+ onLayout: (event) => {
90
+ setTopViewHeight(event.nativeEvent.layout.height);
91
+ },
81
92
  };
82
93
 
83
94
  return (
84
- <SafeAreaView
85
- style={[
86
- styles.container,
87
- { backgroundColor: colors.static_grey },
88
- viewerLivestream.container,
89
- ]}
90
- >
91
- <View style={[styles.view, viewerLivestream.view]}>
92
- {ViewerLivestreamTopView && (
93
- <ViewerLivestreamTopView {...topViewProps} />
94
- )}
95
- <View
96
- style={[
97
- styles.floatingParticipantView,
98
- viewerLivestream.floatingParticipantView,
99
- ]}
100
- >
101
- {hasOngoingScreenShare && FloatingParticipantView && (
102
- <FloatingParticipantView participant={currentSpeaker} />
103
- )}
104
- </View>
105
-
106
- {ViewerLivestreamControls && (
107
- <ViewerLivestreamControls
108
- ViewerLeaveStreamButton={ViewerLeaveStreamButton}
109
- onLeaveStreamHandler={onLeaveStreamHandler}
95
+ <View style={[styles.container, viewerLivestream.container]}>
96
+ {ViewerLivestreamTopView && <ViewerLivestreamTopView {...topViewProps} />}
97
+ {FloatingParticipantView &&
98
+ floatingParticipant &&
99
+ topViewHeight &&
100
+ controlsHeight && (
101
+ <FloatingParticipantView
102
+ participant={floatingParticipant}
103
+ draggableContainerStyle={[
104
+ StyleSheet.absoluteFill,
105
+ {
106
+ top: topViewHeight,
107
+ bottom: controlsHeight,
108
+ },
109
+ ]}
110
110
  />
111
111
  )}
112
- </View>
113
112
  {LivestreamLayout && <LivestreamLayout />}
114
- </SafeAreaView>
113
+ {ViewerLivestreamControls && (
114
+ <ViewerLivestreamControls
115
+ ViewerLeaveStreamButton={ViewerLeaveStreamButton}
116
+ onLeaveStreamHandler={onLeaveStreamHandler}
117
+ onLayout={(event) => {
118
+ setControlsHeight(event.nativeEvent.layout.height);
119
+ }}
120
+ />
121
+ )}
122
+ </View>
115
123
  );
116
124
  };
117
125
 
@@ -119,11 +127,4 @@ const styles = StyleSheet.create({
119
127
  container: {
120
128
  flex: 1,
121
129
  },
122
- floatingParticipantView: {
123
- flex: 1,
124
- },
125
- view: {
126
- ...StyleSheet.absoluteFillObject,
127
- zIndex: Z_INDEX.IN_FRONT,
128
- },
129
130
  });
@@ -45,9 +45,14 @@ export type FloatingParticipantViewProps = ParticipantViewComponentProps &
45
45
  */
46
46
  participant?: StreamVideoParticipant;
47
47
  /**
48
- * Custom style to be merged with the floating participant view.
48
+ * Custom style to be merged with the container of the participant view.
49
49
  */
50
- style?: StyleProp<ViewStyle>;
50
+ participantViewStyle?: StyleProp<ViewStyle>;
51
+ /**
52
+ * Custom style to be merged with the absolute container of the floating participant view.
53
+ * This is the container that holds the participant view and the whole of its draggable area.
54
+ */
55
+ draggableContainerStyle?: StyleProp<ViewStyle>;
51
56
  /**
52
57
  * Handler used to handle actions on click of the participant view in FloatingParticipantView.
53
58
  * Eg: Can be used to handle participant switch on click.
@@ -86,7 +91,8 @@ export const FloatingParticipantView = ({
86
91
  alignment = 'top-right',
87
92
  onPressHandler,
88
93
  participant,
89
- style,
94
+ participantViewStyle,
95
+ draggableContainerStyle,
90
96
  ParticipantView = DefaultParticipantView,
91
97
  ParticipantNetworkQualityIndicator,
92
98
  ParticipantReaction,
@@ -129,7 +135,11 @@ export const FloatingParticipantView = ({
129
135
  return (
130
136
  <View
131
137
  testID={ComponentTestIds.LOCAL_PARTICIPANT}
132
- style={[styles.container, floatingParticipantsView.container]}
138
+ style={[
139
+ styles.container,
140
+ draggableContainerStyle,
141
+ floatingParticipantsView.container,
142
+ ]}
133
143
  // "box-none" disallows the container view to be not take up touches
134
144
  // and allows only the floating view (its child view) to take up the touches
135
145
  pointerEvents="box-none"
@@ -159,7 +169,7 @@ export const FloatingParticipantView = ({
159
169
  trackType="videoTrack"
160
170
  style={[
161
171
  styles.participantViewContainer,
162
- style,
172
+ participantViewStyle,
163
173
  {
164
174
  shadowColor: colors.static_black,
165
175
  },
@@ -72,11 +72,13 @@ export const VideoRenderer = ({
72
72
  : SfuModels.TrackType.VIDEO,
73
73
  );
74
74
  const hasJoinedCall = callingState === CallingState.JOINED;
75
- const canShowVideo = !!videoStream && isVisible && isPublishingVideoTrack;
76
75
  const videoStreamToRender = (isScreenSharing
77
76
  ? screenShareStream
78
77
  : videoStream) as unknown as MediaStream | undefined;
79
78
 
79
+ const canShowVideo =
80
+ !!videoStreamToRender && isVisible && isPublishingVideoTrack;
81
+
80
82
  const mirror =
81
83
  isLocalParticipant && !isScreenSharing && direction === 'front';
82
84
 
@@ -85,11 +87,14 @@ export const VideoRenderer = ({
85
87
  * Additionally makes sure that when this view becomes visible again, the layout to subscribe is known
86
88
  */
87
89
  useEffect(() => {
88
- if (!call) {
90
+ if (!call || isLocalParticipant) {
89
91
  return;
90
92
  }
91
- if (!isVisible) {
92
- if (viewportVisibilityState?.videoTrack !== VisibilityState.VISIBLE) {
93
+ if (isVisible) {
94
+ if (
95
+ trackType === 'videoTrack' &&
96
+ viewportVisibilityState?.videoTrack !== VisibilityState.VISIBLE
97
+ ) {
93
98
  call.state.updateParticipant(sessionId, (p) => ({
94
99
  ...p,
95
100
  viewportVisibilityState: {
@@ -98,8 +103,23 @@ export const VideoRenderer = ({
98
103
  },
99
104
  }));
100
105
  }
106
+ if (
107
+ trackType === 'screenShareTrack' &&
108
+ viewportVisibilityState?.screenShareTrack !== VisibilityState.VISIBLE
109
+ ) {
110
+ call.state.updateParticipant(sessionId, (p) => ({
111
+ ...p,
112
+ viewportVisibilityState: {
113
+ ...(p.viewportVisibilityState ?? DEFAULT_VIEWPORT_VISIBILITY_STATE),
114
+ screenShareTrack: VisibilityState.VISIBLE,
115
+ },
116
+ }));
117
+ }
101
118
  } else {
102
- if (viewportVisibilityState?.videoTrack !== VisibilityState.INVISIBLE) {
119
+ if (
120
+ trackType === 'videoTrack' &&
121
+ viewportVisibilityState?.videoTrack !== VisibilityState.INVISIBLE
122
+ ) {
103
123
  call.state.updateParticipant(sessionId, (p) => ({
104
124
  ...p,
105
125
  viewportVisibilityState: {
@@ -108,13 +128,32 @@ export const VideoRenderer = ({
108
128
  },
109
129
  }));
110
130
  }
131
+ if (
132
+ trackType === 'screenShareTrack' &&
133
+ viewportVisibilityState?.screenShareTrack !== VisibilityState.INVISIBLE
134
+ ) {
135
+ call.state.updateParticipant(sessionId, (p) => ({
136
+ ...p,
137
+ viewportVisibilityState: {
138
+ ...(p.viewportVisibilityState ?? DEFAULT_VIEWPORT_VISIBILITY_STATE),
139
+ screenShareTrack: VisibilityState.INVISIBLE,
140
+ },
141
+ }));
142
+ }
111
143
  if (subscribedVideoLayoutRef.current) {
112
144
  // when video is enabled again, we want to use the last subscribed dimension to resubscribe
113
145
  pendingVideoLayoutRef.current = subscribedVideoLayoutRef.current;
114
146
  subscribedVideoLayoutRef.current = undefined;
115
147
  }
116
148
  }
117
- }, [sessionId, viewportVisibilityState, isVisible, call]);
149
+ }, [
150
+ sessionId,
151
+ viewportVisibilityState,
152
+ isVisible,
153
+ call,
154
+ trackType,
155
+ isLocalParticipant,
156
+ ]);
118
157
 
119
158
  useEffect(() => {
120
159
  if (!hasJoinedCall && subscribedVideoLayoutRef.current) {
@@ -131,10 +170,13 @@ export const VideoRenderer = ({
131
170
  * 3. when call was rejoined
132
171
  */
133
172
  useEffect(() => {
173
+ if (!call || isLocalParticipant) {
174
+ return;
175
+ }
134
176
  // NOTE: We only want to update the subscription if the pendingVideoLayoutRef is set
135
177
  const updateIsNeeded = pendingVideoLayoutRef.current;
136
178
 
137
- if (!updateIsNeeded || !call || !isPublishingVideoTrack || !hasJoinedCall) {
179
+ if (!updateIsNeeded || !isPublishingVideoTrack || !hasJoinedCall) {
138
180
  return;
139
181
  }
140
182
 
@@ -157,6 +199,7 @@ export const VideoRenderer = ({
157
199
  isVisible,
158
200
  sessionId,
159
201
  hasJoinedCall,
202
+ isLocalParticipant,
160
203
  ]);
161
204
 
162
205
  useEffect(() => {
@@ -169,6 +212,9 @@ export const VideoRenderer = ({
169
212
  const onLayout: React.ComponentProps<typeof RTCView>['onLayout'] = (
170
213
  event,
171
214
  ) => {
215
+ if (!call || isLocalParticipant) {
216
+ return;
217
+ }
172
218
  const dimension = {
173
219
  width: Math.trunc(event.nativeEvent.layout.width),
174
220
  height: Math.trunc(event.nativeEvent.layout.height),
@@ -177,7 +223,7 @@ export const VideoRenderer = ({
177
223
  // NOTE: If the participant hasn't published a video track yet,
178
224
  // or the view is not viewable, we store the dimensions and handle it
179
225
  // when the track is published or the video is enabled.
180
- if (!call || !isPublishingVideoTrack || !isVisible || !hasJoinedCall) {
226
+ if (!isPublishingVideoTrack || !isVisible || !hasJoinedCall) {
181
227
  pendingVideoLayoutRef.current = dimension;
182
228
  return;
183
229
  }
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import { Pressable, StyleSheet, Text, View } from 'react-native';
3
+ import { StopScreenShare } from '../../icons';
4
+ import { useTheme } from '../../contexts';
5
+ import { useCall, useI18n } from '@stream-io/video-react-bindings';
6
+ import { SfuModels } from '@stream-io/video-client';
7
+
8
+ /**
9
+ * Props for the ScreenShareOverlay component
10
+ */
11
+ export type ScreenShareOverlayProps = {};
12
+
13
+ /**
14
+ * The component that displays the screen sharing overlay, when the screen is shared.
15
+ */
16
+ export const ScreenShareOverlay = ({}: ScreenShareOverlayProps) => {
17
+ const call = useCall();
18
+ const { t } = useI18n();
19
+ const {
20
+ theme: {
21
+ colors,
22
+ typefaces,
23
+ variants: { iconSizes },
24
+ screenshareOverlay,
25
+ },
26
+ } = useTheme();
27
+
28
+ const onStopScreenshareHandler = async () => {
29
+ await call?.stopPublish(SfuModels.TrackType.SCREEN_SHARE);
30
+ };
31
+
32
+ return (
33
+ <View
34
+ style={[
35
+ styles.container,
36
+ { backgroundColor: colors.static_grey },
37
+ screenshareOverlay.container,
38
+ ]}
39
+ >
40
+ <Text
41
+ style={[
42
+ styles.text,
43
+ typefaces.subtitleBold,
44
+ { color: colors.static_white },
45
+ screenshareOverlay.text,
46
+ ]}
47
+ >
48
+ {t('You are sharing your screen with everyone')}
49
+ </Text>
50
+ <Pressable
51
+ onPress={onStopScreenshareHandler}
52
+ style={({ pressed }) => {
53
+ return [
54
+ styles.button,
55
+ {
56
+ backgroundColor: colors.dark_gray,
57
+ opacity: pressed ? 0.2 : 1,
58
+ },
59
+ screenshareOverlay.button,
60
+ ];
61
+ }}
62
+ >
63
+ <View
64
+ style={[
65
+ styles.buttonIcon,
66
+ { height: iconSizes.xs, width: iconSizes.xs },
67
+ screenshareOverlay.buttonIcon,
68
+ ]}
69
+ >
70
+ <StopScreenShare color={colors.static_white} />
71
+ </View>
72
+ <Text
73
+ style={[
74
+ styles.buttonText,
75
+ { color: colors.static_white },
76
+ screenshareOverlay.buttonText,
77
+ ]}
78
+ >
79
+ {t('Stop Screen Sharing')}
80
+ </Text>
81
+ </Pressable>
82
+ </View>
83
+ );
84
+ };
85
+
86
+ const styles = StyleSheet.create({
87
+ container: {
88
+ flex: 1,
89
+ alignItems: 'center',
90
+ justifyContent: 'center',
91
+ },
92
+ text: {},
93
+ button: {
94
+ marginTop: 16,
95
+ padding: 8,
96
+ borderRadius: 8,
97
+ flexDirection: 'row',
98
+ justifyContent: 'center',
99
+ alignItems: 'center',
100
+ },
101
+ buttonIcon: {},
102
+ buttonText: {
103
+ marginLeft: 8,
104
+ includeFontPadding: false,
105
+ },
106
+ });
@@ -1 +1,2 @@
1
1
  export * from './Avatar';
2
+ export * from './ScreenShareOverlay';
@@ -56,10 +56,12 @@ export const useIosVoipPushEventsSetupEffect = () => {
56
56
  console.warn('Failed to send voip token to stream', err);
57
57
  });
58
58
  // set the logout callback
59
- setPushLogoutCallback(() => {
60
- client.removeDevice(token).catch((err) => {
59
+ setPushLogoutCallback(async () => {
60
+ try {
61
+ client.removeDevice(token);
62
+ } catch (err) {
61
63
  console.warn('Failed to remove voip token from stream', err);
62
- });
64
+ }
63
65
  });
64
66
  };
65
67
  // fired when PushKit give us the latest token
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import Svg, { Path } from 'react-native-svg';
3
+ import { ColorValue } from 'react-native/types';
4
+
5
+ type Props = {
6
+ color: ColorValue;
7
+ };
8
+
9
+ export const StopScreenShare = ({ color }: Props) => {
10
+ return (
11
+ <Svg viewBox="0 0 25 25">
12
+ <Path
13
+ fill={color}
14
+ d="M21.478 19.1H3.47803V5H21.478V19.1ZM21.478 3H3.47803C2.37803 3 1.47803 3.9 1.47803 5V19C1.47803 20.1 2.37803 21 3.47803 21H21.478C22.578 21 23.478 20.1 23.478 19V5C23.478 3.9 22.578 3 21.478 3Z"
15
+ />
16
+ <Path
17
+ fill={color}
18
+ d="M15.068 8L12.478 10.59L9.88803 8L8.47803 9.41L11.068 12L8.47803 14.59L9.88803 16L12.478 13.41L15.068 16L16.478 14.59L13.888 12L16.478 9.41L15.068 8Z"
19
+ />
20
+ </Svg>
21
+ );
22
+ };
@@ -18,5 +18,6 @@ export * from './TopViewBackground';
18
18
  export * from './Eye';
19
19
  export * from './ShieldBadge';
20
20
  export * from './StartStreamIcon';
21
+ export * from './StopScreenShare';
21
22
  export * from './EndStreamIcon';
22
23
  export * from './LeaveStreamIcon';
@@ -57,7 +57,7 @@ export type Theme = {
57
57
  container: ViewStyle;
58
58
  svgContainer: ViewStyle;
59
59
  };
60
- screenShareButton: {
60
+ screenShareToggleButton: {
61
61
  container: ViewStyle;
62
62
  svgContainer: ViewStyle;
63
63
  };
@@ -208,8 +208,6 @@ export type Theme = {
208
208
  };
209
209
  viewerLivestream: {
210
210
  container: ViewStyle;
211
- floatingParticipantView: ViewStyle;
212
- view: ViewStyle;
213
211
  };
214
212
  livestreamLayout: {
215
213
  container: ViewStyle;
@@ -273,6 +271,17 @@ export type Theme = {
273
271
  container: ViewStyle;
274
272
  icon: ViewStyle;
275
273
  };
274
+ livestreamScreenShareToggleButton: {
275
+ container: ViewStyle;
276
+ icon: ViewStyle;
277
+ };
278
+ screenshareOverlay: {
279
+ container: ViewStyle;
280
+ text: TextStyle;
281
+ button: ViewStyle;
282
+ buttonIcon: ViewStyle;
283
+ buttonText: TextStyle;
284
+ };
276
285
  };
277
286
 
278
287
  export const defaultTheme: Theme = {
@@ -367,7 +376,7 @@ export const defaultTheme: Theme = {
367
376
  container: {},
368
377
  svgContainer: {},
369
378
  },
370
- screenShareButton: {
379
+ screenShareToggleButton: {
371
380
  container: {},
372
381
  svgContainer: {},
373
382
  },
@@ -513,8 +522,6 @@ export const defaultTheme: Theme = {
513
522
  },
514
523
  viewerLivestream: {
515
524
  container: {},
516
- floatingParticipantView: {},
517
- view: {},
518
525
  },
519
526
  livestreamLayout: {
520
527
  container: {},
@@ -571,4 +578,15 @@ export const defaultTheme: Theme = {
571
578
  container: {},
572
579
  icon: {},
573
580
  },
581
+ livestreamScreenShareToggleButton: {
582
+ container: {},
583
+ icon: {},
584
+ },
585
+ screenshareOverlay: {
586
+ container: {},
587
+ text: {},
588
+ button: {},
589
+ buttonIcon: {},
590
+ buttonText: {},
591
+ },
574
592
  };
@@ -15,6 +15,8 @@
15
15
  "Setup your audio and video": "Setup your audio and video",
16
16
  "Setup your audio": "Setup your audio",
17
17
  "You are first to Join the call.": "You are first to Join the call.",
18
+ "You are sharing your screen with everyone": "You are sharing your screen with everyone",
19
+ "Stop Screen Sharing": "Stop Screen Sharing",
18
20
  "Participants ({{ numberOfParticipants }})": "Participants ({{ numberOfParticipants }})",
19
21
  "{{ userName }} is sharing their screen": "{{ userName }} is sharing their screen",
20
22
  "You are sharing your screen": "You are sharing your screen",
@@ -91,8 +91,11 @@ export class StreamVideoRN {
91
91
  */
92
92
  static onPushLogout() {
93
93
  if (pushLogoutCallbacks.current) {
94
- pushLogoutCallbacks.current.forEach((callback) => callback());
94
+ return Promise.all(
95
+ pushLogoutCallbacks.current.map((callback) => callback()),
96
+ ).then(() => {});
95
97
  }
98
+ return Promise.resolve();
96
99
  }
97
100
 
98
101
  /**
@@ -1,4 +1,4 @@
1
- type Callback = () => void;
1
+ type Callback = () => Promise<void>;
2
2
 
3
3
  type PushLogoutCallbacks = {
4
4
  current?: Callback[];
@@ -6,7 +6,7 @@ type PushLogoutCallbacks = {
6
6
 
7
7
  let pushLogoutCallbacks: PushLogoutCallbacks = {};
8
8
 
9
- export const setPushLogoutCallback = (callback: () => void) => {
9
+ export const setPushLogoutCallback = (callback: Callback) => {
10
10
  if (!pushLogoutCallbacks.current) {
11
11
  pushLogoutCallbacks.current = [callback];
12
12
  } else {
@@ -104,10 +104,12 @@ export async function initAndroidPushToken(
104
104
  return;
105
105
  }
106
106
  const setDeviceToken = async (token: string) => {
107
- setPushLogoutCallback(() => {
108
- client.removeDevice(token).catch((err) => {
109
- console.warn('Failed to remove voip token from stream', err);
110
- });
107
+ setPushLogoutCallback(async () => {
108
+ try {
109
+ client.removeDevice(token);
110
+ } catch (err) {
111
+ console.warn('Failed to remove firebase token from stream', err);
112
+ }
111
113
  });
112
114
  const push_provider_name = pushConfig.android.pushProviderName;
113
115
  await client.addDevice(token, 'firebase', push_provider_name);
@@ -133,10 +133,12 @@ export async function initIosNonVoipToken(
133
133
  return;
134
134
  }
135
135
  const setDeviceToken = async (token: string) => {
136
- setPushLogoutCallback(() => {
137
- client.removeDevice(token).catch((err) => {
138
- console.warn('Failed to remove voip token from stream', err);
139
- });
136
+ setPushLogoutCallback(async () => {
137
+ try {
138
+ client.removeDevice(token);
139
+ } catch (err) {
140
+ console.warn('Failed to remove apn token from stream', err);
141
+ }
140
142
  });
141
143
  const push_provider_name = pushConfig.ios.pushProviderName;
142
144
  await client.addDevice(token, 'apn', push_provider_name);
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.6.2';
1
+ export const version = '0.6.3';
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebrtc","_icons","_CallControlsButton","_videoClient","_videoReactBindings","_contexts","_hooks","_hooks2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CanScreenShare","Platform","OS","Number","parseInt","Version","split","ScreenShareButton","onScreenShareStartedHandler","onScreenShareStoppedHandler","theme","colors","screenShareButton","useTheme","useCall","useLocalParticipant","useCallSettings","useCallStateHooks","callSettings","isScreenSharingEnabledInCall","screensharing","enabled","isScreenSharingAccessRequestEnabled","access_request_enabled","onScreenShareStartedHandlerRef","useRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStarted","useIsIosScreenshareBroadcastStarted","prevIosScreenShareStarted","usePrevious","localParticipant","hasPublishedScreenShare","publishedTracks","includes","SfuModels","TrackType","SCREEN_SHARE","useEffect","run","_onScreenShareStarted","media","navigator","mediaDevices","getDisplayMedia","deviceId","video","audio","publishScreenShareStream","_onScreenShareStopped","stopPublish","screenCaptureRef","React","onPress","reactTag","findNodeHandle","NativeModules","ScreenCapturePickerViewManager","show","_onScreenShareStarted2","e","_onScreenShareStopped2","createElement","CallControlsButton","disabled","color","static_white","style","container","svgContainer","ScreenShare","static_black","ScreenCapturePickerView","ref","exports"],"sourceRoot":"../../../../../src","sources":["components/Call/CallControls/ScreenShareButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAU,yBAAAC,WAAA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A8E,aAAA,CAAC5F,MAAA,CAAAoG,WAAW;IAACL,KAAK,EAAEvD,MAAM,CAAC6D;EAAa,CAAE,CAAC,EAC1CvE,qBAAQ,CAACC,EAAE,KAAK,KAAK,iBACpBpC,MAAA,CAAAmB,OAAA,CAAA8E,aAAA,CAAC7F,kBAAA,CAAAuG,uBAAuB;IAACC,GAAG,EAAEtB;EAAiB,CAAE,CAEjC,CAAC;AAEzB,CAAC;AAACuB,OAAA,CAAApE,iBAAA,GAAAA,iBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useEffect","useRef","NativeModules","Platform","findNodeHandle","ScreenCapturePickerView","ScreenShare","CallControlsButton","SfuModels","useCall","useCallStateHooks","useTheme","useIsIosScreenshareBroadcastStarted","usePrevious","CanScreenShare","OS","Number","parseInt","Version","split","ScreenShareButton","onScreenShareStartedHandler","onScreenShareStoppedHandler","theme","colors","screenShareButton","call","useLocalParticipant","useCallSettings","callSettings","isScreenSharingEnabledInCall","screensharing","enabled","isScreenSharingAccessRequestEnabled","access_request_enabled","onScreenShareStartedHandlerRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStarted","prevIosScreenShareStarted","localParticipant","hasPublishedScreenShare","publishedTracks","includes","TrackType","SCREEN_SHARE","run","_onScreenShareStarted","media","navigator","mediaDevices","getDisplayMedia","deviceId","video","audio","publishScreenShareStream","_onScreenShareStopped","stopPublish","screenCaptureRef","onPress","reactTag","ScreenCapturePickerViewManager","show","_onScreenShareStarted2","e","_onScreenShareStopped2","createElement","disabled","color","static_white","style","container","svgContainer","static_black","ref"],"sourceRoot":"../../../../../src","sources":["components/Call/CallControls/ScreenShareButton.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,aAAa,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,cAAc;AACtE,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAAS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CAAAmE,aAAA,CAAC3D,kBAAkB;IACjB4D,QAAQ,EAAE,CAAClC,mCAAoC;IAC/C0B,OAAO,EAAEA,OAAQ;IACjBS,KAAK,EAAE5C,MAAM,CAAC6C,YAAa;IAC3BC,KAAK,EAAE;MACLC,SAAS,EAAE9C,iBAAiB,CAAC8C,SAAS;MACtCC,YAAY,EAAE/C,iBAAiB,CAAC+C;IAClC;EAAE,gBAEFzE,KAAA,CAAAmE,aAAA,CAAC5D,WAAW;IAAC8D,KAAK,EAAE5C,MAAM,CAACiD;EAAa,CAAE,CAAC,EAC1CtE,QAAQ,CAACY,EAAE,KAAK,KAAK,iBACpBhB,KAAA,CAAAmE,aAAA,CAAC7D,uBAAuB;IAACqE,GAAG,EAAEhB;EAAiB,CAAE,CAEjC,CAAC;AAEzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScreenShareButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallControls/ScreenShareButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAWjD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,IAAI,CAAC;IACzC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1C,CAAC;AASF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kEAG3B,sBAAsB,kCA8FxB,CAAC"}