@stream-io/video-react-native-sdk 0.1.10 → 0.1.12

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 (290) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNative.kt +19 -1
  3. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +82 -2
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js +9 -7
  5. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  6. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +7 -2
  7. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  8. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +3 -1
  9. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  10. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js +71 -0
  11. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
  12. package/dist/commonjs/components/Livestream/HostLivestream/index.js +17 -0
  13. package/dist/commonjs/components/Livestream/HostLivestream/index.js.map +1 -0
  14. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js +69 -0
  15. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
  16. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +113 -0
  17. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
  18. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +70 -0
  19. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
  20. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js +38 -0
  21. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
  22. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +70 -0
  23. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
  24. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +83 -0
  25. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
  26. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +64 -0
  27. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
  28. package/dist/commonjs/components/Livestream/LivestreamControls/index.js +61 -0
  29. package/dist/commonjs/components/Livestream/LivestreamControls/index.js.map +1 -0
  30. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js +65 -0
  31. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
  32. package/dist/commonjs/components/Livestream/LivestreamLayout/index.js +17 -0
  33. package/dist/commonjs/components/Livestream/LivestreamLayout/index.js.map +1 -0
  34. package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js +144 -0
  35. package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
  36. package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js +71 -0
  37. package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
  38. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +87 -0
  39. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
  40. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +55 -0
  41. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
  42. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +80 -0
  43. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
  44. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js +50 -0
  45. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js.map +1 -0
  46. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +88 -0
  47. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
  48. package/dist/commonjs/components/Livestream/ViewerLivestream/index.js +17 -0
  49. package/dist/commonjs/components/Livestream/ViewerLivestream/index.js.map +1 -0
  50. package/dist/commonjs/components/Livestream/index.js +61 -0
  51. package/dist/commonjs/components/Livestream/index.js.map +1 -0
  52. package/dist/commonjs/components/index.js +11 -0
  53. package/dist/commonjs/components/index.js.map +1 -1
  54. package/dist/commonjs/hooks/index.js +22 -0
  55. package/dist/commonjs/hooks/index.js.map +1 -1
  56. package/dist/commonjs/hooks/useAutoEnterPiPEffect.js +20 -0
  57. package/dist/commonjs/hooks/useAutoEnterPiPEffect.js.map +1 -0
  58. package/dist/commonjs/hooks/useIsInPiPMode.js +25 -0
  59. package/dist/commonjs/hooks/useIsInPiPMode.js.map +1 -0
  60. package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js +26 -0
  61. package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
  62. package/dist/commonjs/icons/EndStreamIcon.js +20 -0
  63. package/dist/commonjs/icons/EndStreamIcon.js.map +1 -0
  64. package/dist/commonjs/icons/Eye.js +20 -0
  65. package/dist/commonjs/icons/Eye.js.map +1 -0
  66. package/dist/commonjs/icons/LeaveStreamIcon.js +20 -0
  67. package/dist/commonjs/icons/LeaveStreamIcon.js.map +1 -0
  68. package/dist/commonjs/icons/ShieldBadge.js +20 -0
  69. package/dist/commonjs/icons/ShieldBadge.js.map +1 -0
  70. package/dist/commonjs/icons/StartStreamIcon.js +20 -0
  71. package/dist/commonjs/icons/StartStreamIcon.js.map +1 -0
  72. package/dist/commonjs/icons/index.js +55 -0
  73. package/dist/commonjs/icons/index.js.map +1 -1
  74. package/dist/commonjs/providers/MediaStreamManagement.js +15 -2
  75. package/dist/commonjs/providers/MediaStreamManagement.js.map +1 -1
  76. package/dist/commonjs/theme/theme.js +70 -0
  77. package/dist/commonjs/theme/theme.js.map +1 -1
  78. package/dist/commonjs/translations/en.json +6 -1
  79. package/dist/commonjs/utils/enterPiPAndroid.js +15 -0
  80. package/dist/commonjs/utils/enterPiPAndroid.js.map +1 -0
  81. package/dist/commonjs/utils/index.js +12 -0
  82. package/dist/commonjs/utils/index.js.map +1 -1
  83. package/dist/commonjs/version.js +1 -1
  84. package/dist/module/components/Call/CallContent/CallContent.js +10 -7
  85. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  86. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +7 -2
  87. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  88. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +3 -1
  89. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  90. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js +64 -0
  91. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
  92. package/dist/module/components/Livestream/HostLivestream/index.js +2 -0
  93. package/dist/module/components/Livestream/HostLivestream/index.js.map +1 -0
  94. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js +62 -0
  95. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
  96. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +105 -0
  97. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
  98. package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +63 -0
  99. package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
  100. package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js +31 -0
  101. package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
  102. package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +63 -0
  103. package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
  104. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +75 -0
  105. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
  106. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +57 -0
  107. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
  108. package/dist/module/components/Livestream/LivestreamControls/index.js +6 -0
  109. package/dist/module/components/Livestream/LivestreamControls/index.js.map +1 -0
  110. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js +58 -0
  111. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
  112. package/dist/module/components/Livestream/LivestreamLayout/index.js +2 -0
  113. package/dist/module/components/Livestream/LivestreamLayout/index.js.map +1 -0
  114. package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js +136 -0
  115. package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
  116. package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js +64 -0
  117. package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
  118. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +80 -0
  119. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
  120. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +48 -0
  121. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
  122. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +73 -0
  123. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
  124. package/dist/module/components/Livestream/LivestreamTopView/index.js +5 -0
  125. package/dist/module/components/Livestream/LivestreamTopView/index.js.map +1 -0
  126. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +81 -0
  127. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
  128. package/dist/module/components/Livestream/ViewerLivestream/index.js +2 -0
  129. package/dist/module/components/Livestream/ViewerLivestream/index.js.map +1 -0
  130. package/dist/module/components/Livestream/index.js +6 -0
  131. package/dist/module/components/Livestream/index.js.map +1 -0
  132. package/dist/module/components/index.js +1 -0
  133. package/dist/module/components/index.js.map +1 -1
  134. package/dist/module/hooks/index.js +2 -0
  135. package/dist/module/hooks/index.js.map +1 -1
  136. package/dist/module/hooks/useAutoEnterPiPEffect.js +14 -0
  137. package/dist/module/hooks/useAutoEnterPiPEffect.js.map +1 -0
  138. package/dist/module/hooks/useIsInPiPMode.js +19 -0
  139. package/dist/module/hooks/useIsInPiPMode.js.map +1 -0
  140. package/dist/module/hooks/usePaginatedLayoutSortPreset.js +19 -0
  141. package/dist/module/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
  142. package/dist/module/icons/EndStreamIcon.js +12 -0
  143. package/dist/module/icons/EndStreamIcon.js.map +1 -0
  144. package/dist/module/icons/Eye.js +12 -0
  145. package/dist/module/icons/Eye.js.map +1 -0
  146. package/dist/module/icons/LeaveStreamIcon.js +12 -0
  147. package/dist/module/icons/LeaveStreamIcon.js.map +1 -0
  148. package/dist/module/icons/ShieldBadge.js +12 -0
  149. package/dist/module/icons/ShieldBadge.js.map +1 -0
  150. package/dist/module/icons/StartStreamIcon.js +12 -0
  151. package/dist/module/icons/StartStreamIcon.js.map +1 -0
  152. package/dist/module/icons/index.js +5 -0
  153. package/dist/module/icons/index.js.map +1 -1
  154. package/dist/module/providers/MediaStreamManagement.js +15 -2
  155. package/dist/module/providers/MediaStreamManagement.js.map +1 -1
  156. package/dist/module/theme/theme.js +70 -0
  157. package/dist/module/theme/theme.js.map +1 -1
  158. package/dist/module/translations/en.json +6 -1
  159. package/dist/module/utils/enterPiPAndroid.js +9 -0
  160. package/dist/module/utils/enterPiPAndroid.js.map +1 -0
  161. package/dist/module/utils/index.js +1 -0
  162. package/dist/module/utils/index.js.map +1 -1
  163. package/dist/module/version.js +1 -1
  164. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  165. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
  166. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
  167. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts +30 -0
  168. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts.map +1 -0
  169. package/dist/typescript/components/Livestream/HostLivestream/index.d.ts +2 -0
  170. package/dist/typescript/components/Livestream/HostLivestream/index.d.ts.map +1 -0
  171. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts +25 -0
  172. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts.map +1 -0
  173. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts +25 -0
  174. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -0
  175. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts +6 -0
  176. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts.map +1 -0
  177. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts +10 -0
  178. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts.map +1 -0
  179. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts +6 -0
  180. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts.map +1 -0
  181. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts +16 -0
  182. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts.map +1 -0
  183. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts +16 -0
  184. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts.map +1 -0
  185. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts +6 -0
  186. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts.map +1 -0
  187. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts +17 -0
  188. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts.map +1 -0
  189. package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts +2 -0
  190. package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts.map +1 -0
  191. package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts +12 -0
  192. package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts.map +1 -0
  193. package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts +10 -0
  194. package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts.map +1 -0
  195. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts +26 -0
  196. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts.map +1 -0
  197. package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts +10 -0
  198. package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts.map +1 -0
  199. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts +26 -0
  200. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts.map +1 -0
  201. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts +5 -0
  202. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts.map +1 -0
  203. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts +32 -0
  204. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -0
  205. package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts +2 -0
  206. package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts.map +1 -0
  207. package/dist/typescript/components/Livestream/index.d.ts +6 -0
  208. package/dist/typescript/components/Livestream/index.d.ts.map +1 -0
  209. package/dist/typescript/components/index.d.ts +1 -0
  210. package/dist/typescript/components/index.d.ts.map +1 -1
  211. package/dist/typescript/hooks/index.d.ts +2 -0
  212. package/dist/typescript/hooks/index.d.ts.map +1 -1
  213. package/dist/typescript/hooks/useAutoEnterPiPEffect.d.ts +2 -0
  214. package/dist/typescript/hooks/useAutoEnterPiPEffect.d.ts.map +1 -0
  215. package/dist/typescript/hooks/useIsInPiPMode.d.ts +2 -0
  216. package/dist/typescript/hooks/useIsInPiPMode.d.ts.map +1 -0
  217. package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts +3 -0
  218. package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts.map +1 -0
  219. package/dist/typescript/icons/EndStreamIcon.d.ts +3 -0
  220. package/dist/typescript/icons/EndStreamIcon.d.ts.map +1 -0
  221. package/dist/typescript/icons/Eye.d.ts +3 -0
  222. package/dist/typescript/icons/Eye.d.ts.map +1 -0
  223. package/dist/typescript/icons/LeaveStreamIcon.d.ts +3 -0
  224. package/dist/typescript/icons/LeaveStreamIcon.d.ts.map +1 -0
  225. package/dist/typescript/icons/ShieldBadge.d.ts +3 -0
  226. package/dist/typescript/icons/ShieldBadge.d.ts.map +1 -0
  227. package/dist/typescript/icons/StartStreamIcon.d.ts +3 -0
  228. package/dist/typescript/icons/StartStreamIcon.d.ts.map +1 -0
  229. package/dist/typescript/icons/index.d.ts +5 -0
  230. package/dist/typescript/icons/index.d.ts.map +1 -1
  231. package/dist/typescript/providers/MediaStreamManagement.d.ts.map +1 -1
  232. package/dist/typescript/theme/theme.d.ts +70 -0
  233. package/dist/typescript/theme/theme.d.ts.map +1 -1
  234. package/dist/typescript/translations/index.d.ts +6 -1
  235. package/dist/typescript/translations/index.d.ts.map +1 -1
  236. package/dist/typescript/utils/enterPiPAndroid.d.ts +2 -0
  237. package/dist/typescript/utils/enterPiPAndroid.d.ts.map +1 -0
  238. package/dist/typescript/utils/index.d.ts +1 -0
  239. package/dist/typescript/utils/index.d.ts.map +1 -1
  240. package/dist/typescript/version.d.ts +1 -1
  241. package/expo-config-plugin/dist/common/addNewLinesToMainActivity.d.ts +1 -0
  242. package/expo-config-plugin/dist/common/addNewLinesToMainActivity.js +16 -0
  243. package/expo-config-plugin/dist/common/types.d.ts +4 -0
  244. package/expo-config-plugin/dist/index.js +6 -2
  245. package/expo-config-plugin/dist/withAndroidManifest.d.ts +2 -1
  246. package/expo-config-plugin/dist/withAndroidManifest.js +20 -2
  247. package/expo-config-plugin/dist/withMainActivity.d.ts +4 -0
  248. package/expo-config-plugin/dist/withMainActivity.js +72 -0
  249. package/package.json +1 -1
  250. package/src/components/Call/CallContent/CallContent.tsx +15 -7
  251. package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +16 -2
  252. package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +4 -1
  253. package/src/components/Livestream/HostLivestream/HostLivestream.tsx +99 -0
  254. package/src/components/Livestream/HostLivestream/index.ts +1 -0
  255. package/src/components/Livestream/LivestreamControls/HostLivestreamControls.tsx +87 -0
  256. package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +163 -0
  257. package/src/components/Livestream/LivestreamControls/LivestreamAudioControlButton.tsx +78 -0
  258. package/src/components/Livestream/LivestreamControls/LivestreamMediaControls.tsx +32 -0
  259. package/src/components/Livestream/LivestreamControls/LivestreamVideoControlButton.tsx +78 -0
  260. package/src/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx +102 -0
  261. package/src/components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx +75 -0
  262. package/src/components/Livestream/LivestreamControls/index.ts +5 -0
  263. package/src/components/Livestream/LivestreamLayout/LivestreamLayout.tsx +77 -0
  264. package/src/components/Livestream/LivestreamLayout/index.ts +1 -0
  265. package/src/components/Livestream/LivestreamTopView/DurationBadge.tsx +170 -0
  266. package/src/components/Livestream/LivestreamTopView/FollowerCount.tsx +74 -0
  267. package/src/components/Livestream/LivestreamTopView/HostLivestreamTopView.tsx +105 -0
  268. package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +53 -0
  269. package/src/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.tsx +102 -0
  270. package/src/components/Livestream/LivestreamTopView/index.ts +4 -0
  271. package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +126 -0
  272. package/src/components/Livestream/ViewerLivestream/index.ts +1 -0
  273. package/src/components/Livestream/index.ts +5 -0
  274. package/src/components/index.ts +1 -0
  275. package/src/hooks/index.ts +2 -0
  276. package/src/hooks/useAutoEnterPiPEffect.tsx +16 -0
  277. package/src/hooks/useIsInPiPMode.tsx +29 -0
  278. package/src/hooks/usePaginatedLayoutSortPreset.ts +27 -0
  279. package/src/icons/EndStreamIcon.tsx +13 -0
  280. package/src/icons/Eye.tsx +13 -0
  281. package/src/icons/LeaveStreamIcon.tsx +13 -0
  282. package/src/icons/ShieldBadge.tsx +13 -0
  283. package/src/icons/StartStreamIcon.tsx +13 -0
  284. package/src/icons/index.tsx +5 -0
  285. package/src/providers/MediaStreamManagement.tsx +14 -1
  286. package/src/theme/theme.ts +140 -0
  287. package/src/translations/en.json +6 -1
  288. package/src/utils/enterPiPAndroid.ts +11 -0
  289. package/src/utils/index.ts +1 -0
  290. package/src/version.ts +1 -1
@@ -0,0 +1,99 @@
1
+ import React from 'react';
2
+ import { StyleSheet, SafeAreaView } from 'react-native';
3
+ import { useTheme } from '../../../contexts';
4
+ import { useIncallManager } from '../../../hooks';
5
+ import {
6
+ HostLivestreamTopView as DefaultHostLivestreamTopView,
7
+ HostLivestreamTopViewProps,
8
+ } from '../LivestreamTopView/HostLivestreamTopView';
9
+ import {
10
+ HostLivestreamControls as DefaultHostLivestreamControls,
11
+ HostLivestreamControlsProps,
12
+ } from '../LivestreamControls/HostLivestreamControls';
13
+ import {
14
+ LivestreamLayout as DefaultLivestreamLayout,
15
+ LivestreamLayoutProps,
16
+ } from '../LivestreamLayout';
17
+
18
+ /**
19
+ * Props for the HostLivestream component.
20
+ */
21
+ export type HostLivestreamProps = HostLivestreamTopViewProps &
22
+ HostLivestreamControlsProps & {
23
+ /**
24
+ * Component to customize the top view at the host's live stream.
25
+ */
26
+ HostLivestreamTopView?: React.ComponentType<HostLivestreamTopViewProps> | null;
27
+ /**
28
+ * Component to customize the live stream video layout.
29
+ */
30
+ LivestreamLayout?: React.ComponentType<LivestreamLayoutProps> | null;
31
+ /**
32
+ * Component to customize the bottom view controls at the host's live stream.
33
+ */
34
+ HostLivestreamControls?: React.ComponentType<HostLivestreamControlsProps> | null;
35
+ /**
36
+ * Enable HTTP live streaming
37
+ */
38
+ hls?: boolean;
39
+ };
40
+
41
+ /**
42
+ * The HostLivestream component displays the UI for the Host's live stream.
43
+ */
44
+ export const HostLivestream = ({
45
+ HostLivestreamTopView = DefaultHostLivestreamTopView,
46
+ HostLivestreamControls = DefaultHostLivestreamControls,
47
+ LivestreamLayout = DefaultLivestreamLayout,
48
+ LiveIndicator,
49
+ FollowerCount,
50
+ DurationBadge,
51
+ HostStartStreamButton,
52
+ LivestreamMediaControls,
53
+ onEndStreamHandler,
54
+ onStartStreamHandler,
55
+ hls = false,
56
+ }: HostLivestreamProps) => {
57
+ const {
58
+ theme: { colors, hostLivestream },
59
+ } = useTheme();
60
+
61
+ // Automatically route audio to speaker devices as relevant for watching videos.
62
+ useIncallManager({ media: 'video', auto: true });
63
+
64
+ const topViewProps: HostLivestreamTopViewProps = {
65
+ LiveIndicator,
66
+ FollowerCount,
67
+ DurationBadge,
68
+ };
69
+
70
+ return (
71
+ <SafeAreaView
72
+ style={[
73
+ styles.container,
74
+ {
75
+ backgroundColor: colors.static_grey,
76
+ },
77
+ hostLivestream.container,
78
+ ]}
79
+ >
80
+ {HostLivestreamTopView && <HostLivestreamTopView {...topViewProps} />}
81
+ {LivestreamLayout && <LivestreamLayout />}
82
+ {HostLivestreamControls && (
83
+ <HostLivestreamControls
84
+ onEndStreamHandler={onEndStreamHandler}
85
+ onStartStreamHandler={onStartStreamHandler}
86
+ HostStartStreamButton={HostStartStreamButton}
87
+ LivestreamMediaControls={LivestreamMediaControls}
88
+ hls={hls}
89
+ />
90
+ )}
91
+ </SafeAreaView>
92
+ );
93
+ };
94
+
95
+ const styles = StyleSheet.create({
96
+ container: {
97
+ flex: 1,
98
+ },
99
+ });
@@ -0,0 +1 @@
1
+ export * from './HostLivestream';
@@ -0,0 +1,87 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import {
4
+ HostStartStreamButton as DefaultHostStartStreamButton,
5
+ HostStartStreamButtonProps,
6
+ } from './HostStartStreamButton';
7
+ import {
8
+ LivestreamMediaControls as DefaultLivestreamMediaControls,
9
+ LivestreamMediaControlsProps,
10
+ } from './LivestreamMediaControls';
11
+ import { useTheme } from '../../../contexts';
12
+ import { Z_INDEX } from '../../../constants';
13
+
14
+ /**
15
+ * Props for the HostLivestreamControls component.
16
+ */
17
+ export type HostLivestreamControlsProps = HostStartStreamButtonProps & {
18
+ /**
19
+ * Component to customize the host's start/end live stream button.
20
+ */
21
+ HostStartStreamButton?: React.ComponentType<HostStartStreamButtonProps> | null;
22
+ /**
23
+ * Component to customize the host's media control(audio/video) buttons.
24
+ */
25
+ LivestreamMediaControls?: React.ComponentType<LivestreamMediaControlsProps> | null;
26
+ /**
27
+ * Enable HTTP live streaming
28
+ */
29
+ hls?: boolean;
30
+ };
31
+
32
+ /**
33
+ * The HostLivestreamControls component displays the call controls for the live stream at host's end.
34
+ */
35
+ export const HostLivestreamControls = ({
36
+ HostStartStreamButton = DefaultHostStartStreamButton,
37
+ LivestreamMediaControls = DefaultLivestreamMediaControls,
38
+ onEndStreamHandler,
39
+ onStartStreamHandler,
40
+ hls = false,
41
+ }: HostLivestreamControlsProps) => {
42
+ const {
43
+ theme: { colors, hostLivestreamControls },
44
+ } = useTheme();
45
+ return (
46
+ <View
47
+ style={[
48
+ styles.container,
49
+ { backgroundColor: colors.static_overlay },
50
+ hostLivestreamControls.container,
51
+ ]}
52
+ >
53
+ <View style={[styles.leftElement, hostLivestreamControls.leftElement]}>
54
+ {HostStartStreamButton && (
55
+ <HostStartStreamButton
56
+ onEndStreamHandler={onEndStreamHandler}
57
+ onStartStreamHandler={onStartStreamHandler}
58
+ hls={hls}
59
+ />
60
+ )}
61
+ </View>
62
+ <View style={[styles.rightElement, hostLivestreamControls.rightElement]}>
63
+ {LivestreamMediaControls && <LivestreamMediaControls />}
64
+ </View>
65
+ </View>
66
+ );
67
+ };
68
+
69
+ const styles = StyleSheet.create({
70
+ container: {
71
+ position: 'absolute',
72
+ bottom: 0,
73
+ flexDirection: 'row',
74
+ alignItems: 'center',
75
+ paddingVertical: 16,
76
+ paddingHorizontal: 8,
77
+ zIndex: Z_INDEX.IN_FRONT,
78
+ },
79
+ leftElement: {
80
+ flex: 1,
81
+ alignItems: 'flex-start',
82
+ },
83
+ rightElement: {
84
+ flex: 1,
85
+ alignItems: 'flex-end',
86
+ },
87
+ });
@@ -0,0 +1,163 @@
1
+ import {
2
+ useCall,
3
+ useCallStateHooks,
4
+ useI18n,
5
+ } from '@stream-io/video-react-bindings';
6
+ import React, { useState } from 'react';
7
+ import {
8
+ ActivityIndicator,
9
+ Pressable,
10
+ StyleSheet,
11
+ Text,
12
+ View,
13
+ } from 'react-native';
14
+ import { useTheme } from '../../../contexts';
15
+ import { EndBroadcastIcon, StartStreamIcon } from '../../../icons';
16
+
17
+ /**
18
+ * Props for the HostStartStreamButton component.
19
+ */
20
+ export type HostStartStreamButtonProps = {
21
+ /**
22
+ * Handler to be called when the Start Stream button is pressed.
23
+ * @returns void
24
+ */
25
+ onStartStreamHandler?: () => void;
26
+ /**
27
+ * Handler to be called when the End Stream button is pressed.
28
+ * @returns void
29
+ */
30
+ onEndStreamHandler?: () => void;
31
+ /**
32
+ * Enable HTTP live streaming
33
+ */
34
+ hls?: boolean;
35
+ };
36
+
37
+ /**
38
+ * The HostStartStreamButton component displays and controls the start and end of the host's live stream.
39
+ */
40
+ export const HostStartStreamButton = ({
41
+ onEndStreamHandler,
42
+ onStartStreamHandler,
43
+ hls,
44
+ }: HostStartStreamButtonProps) => {
45
+ const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
46
+ const { useIsCallLive, useIsCallBroadcastingInProgress } =
47
+ useCallStateHooks();
48
+ const {
49
+ theme: {
50
+ colors,
51
+ variants: { iconSizes },
52
+ typefaces,
53
+ hostStartStreamButton,
54
+ },
55
+ } = useTheme();
56
+
57
+ const call = useCall();
58
+ const isCallLive = useIsCallLive();
59
+ const isCallBroadcasting = useIsCallBroadcastingInProgress();
60
+ const { t } = useI18n();
61
+
62
+ const liveOrBroadcasting = isCallLive || isCallBroadcasting;
63
+
64
+ const onStartStreamButtonPress = async () => {
65
+ if (onStartStreamHandler) {
66
+ onStartStreamHandler();
67
+ return;
68
+ }
69
+ try {
70
+ setIsAwaitingResponse(true);
71
+ await call?.goLive();
72
+ if (hls) {
73
+ await call?.startHLS();
74
+ }
75
+ setIsAwaitingResponse(false);
76
+ } catch (error) {
77
+ console.error('Error starting livestream', error);
78
+ }
79
+ };
80
+
81
+ const onEndStreamButtonPress = async () => {
82
+ if (onEndStreamHandler) {
83
+ onEndStreamHandler();
84
+ return;
85
+ }
86
+ try {
87
+ setIsAwaitingResponse(true);
88
+ if (hls) {
89
+ await call?.stopHLS();
90
+ } else {
91
+ await call?.stopLive();
92
+ }
93
+
94
+ setIsAwaitingResponse(false);
95
+ } catch (error) {
96
+ console.error('Error stopping livestream', error);
97
+ }
98
+ };
99
+
100
+ return (
101
+ <Pressable
102
+ disabled={isAwaitingResponse}
103
+ style={[
104
+ styles.container,
105
+ {
106
+ backgroundColor: isAwaitingResponse
107
+ ? colors.dark_gray
108
+ : liveOrBroadcasting
109
+ ? colors.error
110
+ : colors.primary,
111
+ },
112
+ hostStartStreamButton.container,
113
+ ]}
114
+ onPress={
115
+ liveOrBroadcasting ? onEndStreamButtonPress : onStartStreamButtonPress
116
+ }
117
+ >
118
+ <View
119
+ style={[
120
+ styles.icon,
121
+ { height: iconSizes.xs, width: iconSizes.xs },
122
+ hostStartStreamButton.icon,
123
+ ]}
124
+ >
125
+ {isAwaitingResponse ? (
126
+ <ActivityIndicator />
127
+ ) : liveOrBroadcasting ? (
128
+ <EndBroadcastIcon />
129
+ ) : (
130
+ <StartStreamIcon />
131
+ )}
132
+ </View>
133
+ <Text
134
+ style={[
135
+ styles.text,
136
+ typefaces.subtitleBold,
137
+ { color: colors.static_white },
138
+ hostStartStreamButton.text,
139
+ ]}
140
+ >
141
+ {isAwaitingResponse
142
+ ? t('Loading...')
143
+ : liveOrBroadcasting
144
+ ? t('Stop Livestream')
145
+ : t('Start Livestream')}
146
+ </Text>
147
+ </Pressable>
148
+ );
149
+ };
150
+
151
+ const styles = StyleSheet.create({
152
+ container: {
153
+ flexDirection: 'row',
154
+ alignItems: 'center',
155
+ padding: 8,
156
+ borderRadius: 4,
157
+ },
158
+ icon: {},
159
+ text: {
160
+ marginLeft: 8,
161
+ includeFontPadding: false,
162
+ },
163
+ });
@@ -0,0 +1,78 @@
1
+ import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
2
+ import React from 'react';
3
+ import { useTheme } from '../../../contexts';
4
+ import { Pressable, StyleSheet, View } from 'react-native';
5
+ import { Mic, MicOff } from '../../../icons';
6
+
7
+ /**
8
+ * The LivestreamAudioControlButton controls the audio stream publish/unpublish while in the livestream for the host.
9
+ */
10
+ export const LivestreamAudioControlButton = () => {
11
+ const call = useCall();
12
+ const { useMicrophoneState } = useCallStateHooks();
13
+ const { status } = useMicrophoneState();
14
+ const {
15
+ theme: {
16
+ colors,
17
+ variants: { iconSizes, buttonSizes },
18
+ livestreamAudioControlButton,
19
+ },
20
+ } = useTheme();
21
+
22
+ const onPress = async () => {
23
+ await call?.microphone.toggle();
24
+ };
25
+
26
+ return (
27
+ <Pressable
28
+ onPress={onPress}
29
+ style={[
30
+ styles.container,
31
+ {
32
+ backgroundColor: colors.dark_gray,
33
+ height: buttonSizes.xs,
34
+ width: buttonSizes.xs,
35
+ },
36
+ livestreamAudioControlButton.container,
37
+ ]}
38
+ >
39
+ {status === 'enabled' ? (
40
+ <View
41
+ style={[
42
+ styles.icon,
43
+ {
44
+ height: iconSizes.sm,
45
+ width: iconSizes.sm,
46
+ },
47
+ livestreamAudioControlButton.icon,
48
+ ]}
49
+ >
50
+ <Mic color={colors.static_white} />
51
+ </View>
52
+ ) : (
53
+ <View
54
+ style={[
55
+ styles.icon,
56
+ {
57
+ height: iconSizes.sm,
58
+ width: iconSizes.sm,
59
+ },
60
+ livestreamAudioControlButton.icon,
61
+ ]}
62
+ >
63
+ <MicOff color={colors.static_white} />
64
+ </View>
65
+ )}
66
+ </Pressable>
67
+ );
68
+ };
69
+
70
+ const styles = StyleSheet.create({
71
+ container: {
72
+ justifyContent: 'center',
73
+ alignItems: 'center',
74
+ marginHorizontal: 4,
75
+ borderRadius: 4,
76
+ },
77
+ icon: {},
78
+ });
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { useTheme } from '../../../contexts';
4
+ import { LivestreamAudioControlButton } from './LivestreamAudioControlButton';
5
+ import { LivestreamVideoControlButton } from './LivestreamVideoControlButton';
6
+
7
+ /**
8
+ * Props for the LivestreamMediaControls component.
9
+ */
10
+ export type LivestreamMediaControlsProps = {};
11
+
12
+ /**
13
+ * The LivestreamMediaControls component controls the media publish/unpublish for the host's live stream.
14
+ */
15
+ export const LivestreamMediaControls = ({}: LivestreamMediaControlsProps) => {
16
+ const {
17
+ theme: { livestreamMediaControls },
18
+ } = useTheme();
19
+ return (
20
+ <View style={[styles.container, livestreamMediaControls.container]}>
21
+ <LivestreamAudioControlButton />
22
+ <LivestreamVideoControlButton />
23
+ </View>
24
+ );
25
+ };
26
+
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ flexDirection: 'row',
30
+ alignItems: 'center',
31
+ },
32
+ });
@@ -0,0 +1,78 @@
1
+ import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
2
+ import React from 'react';
3
+ import { useTheme } from '../../../contexts';
4
+ import { Pressable, StyleSheet, View } from 'react-native';
5
+ import { Video, VideoSlash } from '../../../icons';
6
+
7
+ /**
8
+ * The LivestreamVideoControlButton controls the video stream publish/unpublish while in the livestream for the host.
9
+ */
10
+ export const LivestreamVideoControlButton = () => {
11
+ const call = useCall();
12
+ const { useCameraState } = useCallStateHooks();
13
+ const { status } = useCameraState();
14
+ const {
15
+ theme: {
16
+ colors,
17
+ variants: { iconSizes, buttonSizes },
18
+ livestreamVideoControlButton,
19
+ },
20
+ } = useTheme();
21
+
22
+ const onPress = async () => {
23
+ await call?.camera.toggle();
24
+ };
25
+
26
+ return (
27
+ <Pressable
28
+ onPress={onPress}
29
+ style={[
30
+ styles.container,
31
+ {
32
+ backgroundColor: colors.dark_gray,
33
+ height: buttonSizes.xs,
34
+ width: buttonSizes.xs,
35
+ },
36
+ livestreamVideoControlButton.container,
37
+ ]}
38
+ >
39
+ {status === 'enabled' ? (
40
+ <View
41
+ style={[
42
+ styles.icon,
43
+ {
44
+ height: iconSizes.sm,
45
+ width: iconSizes.sm,
46
+ },
47
+ livestreamVideoControlButton.icon,
48
+ ]}
49
+ >
50
+ <Video color={colors.static_white} />
51
+ </View>
52
+ ) : (
53
+ <View
54
+ style={[
55
+ styles.icon,
56
+ {
57
+ height: iconSizes.sm,
58
+ width: iconSizes.sm,
59
+ },
60
+ livestreamVideoControlButton.icon,
61
+ ]}
62
+ >
63
+ <VideoSlash color={colors.static_white} />
64
+ </View>
65
+ )}
66
+ </Pressable>
67
+ );
68
+ };
69
+
70
+ const styles = StyleSheet.create({
71
+ container: {
72
+ justifyContent: 'center',
73
+ alignItems: 'center',
74
+ marginHorizontal: 4,
75
+ borderRadius: 4,
76
+ },
77
+ icon: {},
78
+ });
@@ -0,0 +1,102 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ Pressable,
5
+ StyleSheet,
6
+ Text,
7
+ View,
8
+ } from 'react-native';
9
+ import { useTheme } from '../../../contexts';
10
+ import { LeaveStreamIcon } from '../../../icons';
11
+ import { useCall, useI18n } from '@stream-io/video-react-bindings';
12
+
13
+ /**
14
+ * Props for the ViewerLeaveStreamButton component.
15
+ */
16
+ export type ViewerLeaveStreamButtonProps = {
17
+ /**
18
+ * Handler to be called when the viewer's leave stream button is called.
19
+ * @returns void
20
+ */
21
+ onLeaveStreamHandler?: () => void;
22
+ };
23
+
24
+ /**
25
+ * The ViewerLeaveStreamButton component displays and controls the leave stream logic of the viewer's live stream.
26
+ */
27
+ export const ViewerLeaveStreamButton = ({
28
+ onLeaveStreamHandler,
29
+ }: ViewerLeaveStreamButtonProps) => {
30
+ const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
31
+ const call = useCall();
32
+ const { t } = useI18n();
33
+ const {
34
+ theme: {
35
+ colors,
36
+ variants: { iconSizes },
37
+ typefaces,
38
+ viewerLeaveStreamButton,
39
+ },
40
+ } = useTheme();
41
+
42
+ const onLeaveStreamButtonPress = async () => {
43
+ if (onLeaveStreamHandler) {
44
+ onLeaveStreamHandler();
45
+ return;
46
+ }
47
+ try {
48
+ setIsAwaitingResponse(true);
49
+ await call?.leave();
50
+ setIsAwaitingResponse(false);
51
+ } catch (error) {
52
+ console.error('Error stopping livestream', error);
53
+ }
54
+ };
55
+
56
+ return (
57
+ <Pressable
58
+ style={[
59
+ styles.container,
60
+ {
61
+ backgroundColor: colors.dark_gray,
62
+ },
63
+ viewerLeaveStreamButton.container,
64
+ ]}
65
+ onPress={onLeaveStreamButtonPress}
66
+ >
67
+ <View
68
+ style={[
69
+ styles.icon,
70
+ { height: iconSizes.xs, width: iconSizes.xs },
71
+ viewerLeaveStreamButton.icon,
72
+ ]}
73
+ >
74
+ {isAwaitingResponse ? <ActivityIndicator /> : <LeaveStreamIcon />}
75
+ </View>
76
+ <Text
77
+ style={[
78
+ styles.text,
79
+ typefaces.subtitleBold,
80
+ { color: colors.static_white },
81
+ viewerLeaveStreamButton.text,
82
+ ]}
83
+ >
84
+ {isAwaitingResponse ? t('Loading...') : t('Leave Stream')}
85
+ </Text>
86
+ </Pressable>
87
+ );
88
+ };
89
+
90
+ const styles = StyleSheet.create({
91
+ container: {
92
+ flexDirection: 'row',
93
+ alignItems: 'center',
94
+ padding: 8,
95
+ borderRadius: 4,
96
+ },
97
+ icon: {},
98
+ text: {
99
+ marginLeft: 8,
100
+ includeFontPadding: false,
101
+ },
102
+ });