@stream-io/video-react-native-sdk 0.1.9 → 0.1.11

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 (230) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -4
  3. package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -1
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  5. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js +71 -0
  6. package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
  7. package/dist/commonjs/components/Livestream/HostLivestream/index.js +17 -0
  8. package/dist/commonjs/components/Livestream/HostLivestream/index.js.map +1 -0
  9. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js +69 -0
  10. package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
  11. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +113 -0
  12. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
  13. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +70 -0
  14. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
  15. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js +38 -0
  16. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
  17. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +70 -0
  18. package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
  19. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +83 -0
  20. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
  21. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +64 -0
  22. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
  23. package/dist/commonjs/components/Livestream/LivestreamControls/index.js +61 -0
  24. package/dist/commonjs/components/Livestream/LivestreamControls/index.js.map +1 -0
  25. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js +65 -0
  26. package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
  27. package/dist/commonjs/components/Livestream/LivestreamLayout/index.js +17 -0
  28. package/dist/commonjs/components/Livestream/LivestreamLayout/index.js.map +1 -0
  29. package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js +144 -0
  30. package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
  31. package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js +71 -0
  32. package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
  33. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +87 -0
  34. package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
  35. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +55 -0
  36. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
  37. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +80 -0
  38. package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
  39. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js +50 -0
  40. package/dist/commonjs/components/Livestream/LivestreamTopView/index.js.map +1 -0
  41. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +88 -0
  42. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
  43. package/dist/commonjs/components/Livestream/ViewerLivestream/index.js +17 -0
  44. package/dist/commonjs/components/Livestream/ViewerLivestream/index.js.map +1 -0
  45. package/dist/commonjs/components/Livestream/index.js +61 -0
  46. package/dist/commonjs/components/Livestream/index.js.map +1 -0
  47. package/dist/commonjs/components/index.js +11 -0
  48. package/dist/commonjs/components/index.js.map +1 -1
  49. package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js +26 -0
  50. package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
  51. package/dist/commonjs/icons/EndStreamIcon.js +20 -0
  52. package/dist/commonjs/icons/EndStreamIcon.js.map +1 -0
  53. package/dist/commonjs/icons/Eye.js +20 -0
  54. package/dist/commonjs/icons/Eye.js.map +1 -0
  55. package/dist/commonjs/icons/LeaveStreamIcon.js +20 -0
  56. package/dist/commonjs/icons/LeaveStreamIcon.js.map +1 -0
  57. package/dist/commonjs/icons/ShieldBadge.js +20 -0
  58. package/dist/commonjs/icons/ShieldBadge.js.map +1 -0
  59. package/dist/commonjs/icons/StartStreamIcon.js +20 -0
  60. package/dist/commonjs/icons/StartStreamIcon.js.map +1 -0
  61. package/dist/commonjs/icons/index.js +55 -0
  62. package/dist/commonjs/icons/index.js.map +1 -1
  63. package/dist/commonjs/theme/theme.js +70 -0
  64. package/dist/commonjs/theme/theme.js.map +1 -1
  65. package/dist/commonjs/translations/en.json +6 -1
  66. package/dist/commonjs/version.js +1 -1
  67. package/dist/commonjs/version.js.map +1 -1
  68. package/dist/module/components/Call/CallContent/CallContent.js +1 -1
  69. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  70. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js +64 -0
  71. package/dist/module/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
  72. package/dist/module/components/Livestream/HostLivestream/index.js +2 -0
  73. package/dist/module/components/Livestream/HostLivestream/index.js.map +1 -0
  74. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js +62 -0
  75. package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
  76. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +105 -0
  77. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
  78. package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +63 -0
  79. package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
  80. package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js +31 -0
  81. package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
  82. package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +63 -0
  83. package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
  84. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +75 -0
  85. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
  86. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +57 -0
  87. package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
  88. package/dist/module/components/Livestream/LivestreamControls/index.js +6 -0
  89. package/dist/module/components/Livestream/LivestreamControls/index.js.map +1 -0
  90. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js +58 -0
  91. package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
  92. package/dist/module/components/Livestream/LivestreamLayout/index.js +2 -0
  93. package/dist/module/components/Livestream/LivestreamLayout/index.js.map +1 -0
  94. package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js +136 -0
  95. package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
  96. package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js +64 -0
  97. package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
  98. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +80 -0
  99. package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
  100. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +48 -0
  101. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
  102. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +73 -0
  103. package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
  104. package/dist/module/components/Livestream/LivestreamTopView/index.js +5 -0
  105. package/dist/module/components/Livestream/LivestreamTopView/index.js.map +1 -0
  106. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +81 -0
  107. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
  108. package/dist/module/components/Livestream/ViewerLivestream/index.js +2 -0
  109. package/dist/module/components/Livestream/ViewerLivestream/index.js.map +1 -0
  110. package/dist/module/components/Livestream/index.js +6 -0
  111. package/dist/module/components/Livestream/index.js.map +1 -0
  112. package/dist/module/components/index.js +1 -0
  113. package/dist/module/components/index.js.map +1 -1
  114. package/dist/module/hooks/usePaginatedLayoutSortPreset.js +19 -0
  115. package/dist/module/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
  116. package/dist/module/icons/EndStreamIcon.js +12 -0
  117. package/dist/module/icons/EndStreamIcon.js.map +1 -0
  118. package/dist/module/icons/Eye.js +12 -0
  119. package/dist/module/icons/Eye.js.map +1 -0
  120. package/dist/module/icons/LeaveStreamIcon.js +12 -0
  121. package/dist/module/icons/LeaveStreamIcon.js.map +1 -0
  122. package/dist/module/icons/ShieldBadge.js +12 -0
  123. package/dist/module/icons/ShieldBadge.js.map +1 -0
  124. package/dist/module/icons/StartStreamIcon.js +12 -0
  125. package/dist/module/icons/StartStreamIcon.js.map +1 -0
  126. package/dist/module/icons/index.js +5 -0
  127. package/dist/module/icons/index.js.map +1 -1
  128. package/dist/module/theme/theme.js +70 -0
  129. package/dist/module/theme/theme.js.map +1 -1
  130. package/dist/module/translations/en.json +6 -1
  131. package/dist/module/version.js +1 -1
  132. package/dist/module/version.js.map +1 -1
  133. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts +30 -0
  134. package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts.map +1 -0
  135. package/dist/typescript/components/Livestream/HostLivestream/index.d.ts +2 -0
  136. package/dist/typescript/components/Livestream/HostLivestream/index.d.ts.map +1 -0
  137. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts +25 -0
  138. package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts.map +1 -0
  139. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts +25 -0
  140. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -0
  141. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts +6 -0
  142. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts.map +1 -0
  143. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts +10 -0
  144. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts.map +1 -0
  145. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts +6 -0
  146. package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts.map +1 -0
  147. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts +16 -0
  148. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts.map +1 -0
  149. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts +16 -0
  150. package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts.map +1 -0
  151. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts +6 -0
  152. package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts.map +1 -0
  153. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts +17 -0
  154. package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts.map +1 -0
  155. package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts +2 -0
  156. package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts.map +1 -0
  157. package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts +12 -0
  158. package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts.map +1 -0
  159. package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts +10 -0
  160. package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts.map +1 -0
  161. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts +26 -0
  162. package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts.map +1 -0
  163. package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts +10 -0
  164. package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts.map +1 -0
  165. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts +26 -0
  166. package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts.map +1 -0
  167. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts +5 -0
  168. package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts.map +1 -0
  169. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts +32 -0
  170. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -0
  171. package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts +2 -0
  172. package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts.map +1 -0
  173. package/dist/typescript/components/Livestream/index.d.ts +6 -0
  174. package/dist/typescript/components/Livestream/index.d.ts.map +1 -0
  175. package/dist/typescript/components/index.d.ts +1 -0
  176. package/dist/typescript/components/index.d.ts.map +1 -1
  177. package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts +3 -0
  178. package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts.map +1 -0
  179. package/dist/typescript/icons/EndStreamIcon.d.ts +3 -0
  180. package/dist/typescript/icons/EndStreamIcon.d.ts.map +1 -0
  181. package/dist/typescript/icons/Eye.d.ts +3 -0
  182. package/dist/typescript/icons/Eye.d.ts.map +1 -0
  183. package/dist/typescript/icons/LeaveStreamIcon.d.ts +3 -0
  184. package/dist/typescript/icons/LeaveStreamIcon.d.ts.map +1 -0
  185. package/dist/typescript/icons/ShieldBadge.d.ts +3 -0
  186. package/dist/typescript/icons/ShieldBadge.d.ts.map +1 -0
  187. package/dist/typescript/icons/StartStreamIcon.d.ts +3 -0
  188. package/dist/typescript/icons/StartStreamIcon.d.ts.map +1 -0
  189. package/dist/typescript/icons/index.d.ts +5 -0
  190. package/dist/typescript/icons/index.d.ts.map +1 -1
  191. package/dist/typescript/theme/theme.d.ts +70 -0
  192. package/dist/typescript/theme/theme.d.ts.map +1 -1
  193. package/dist/typescript/translations/index.d.ts +6 -1
  194. package/dist/typescript/translations/index.d.ts.map +1 -1
  195. package/dist/typescript/version.d.ts +1 -1
  196. package/dist/typescript/version.d.ts.map +1 -1
  197. package/package.json +3 -3
  198. package/src/components/Call/CallContent/CallContent.tsx +1 -1
  199. package/src/components/Livestream/HostLivestream/HostLivestream.tsx +99 -0
  200. package/src/components/Livestream/HostLivestream/index.ts +1 -0
  201. package/src/components/Livestream/LivestreamControls/HostLivestreamControls.tsx +87 -0
  202. package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +163 -0
  203. package/src/components/Livestream/LivestreamControls/LivestreamAudioControlButton.tsx +78 -0
  204. package/src/components/Livestream/LivestreamControls/LivestreamMediaControls.tsx +32 -0
  205. package/src/components/Livestream/LivestreamControls/LivestreamVideoControlButton.tsx +78 -0
  206. package/src/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx +102 -0
  207. package/src/components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx +75 -0
  208. package/src/components/Livestream/LivestreamControls/index.ts +5 -0
  209. package/src/components/Livestream/LivestreamLayout/LivestreamLayout.tsx +77 -0
  210. package/src/components/Livestream/LivestreamLayout/index.ts +1 -0
  211. package/src/components/Livestream/LivestreamTopView/DurationBadge.tsx +170 -0
  212. package/src/components/Livestream/LivestreamTopView/FollowerCount.tsx +74 -0
  213. package/src/components/Livestream/LivestreamTopView/HostLivestreamTopView.tsx +105 -0
  214. package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +53 -0
  215. package/src/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.tsx +102 -0
  216. package/src/components/Livestream/LivestreamTopView/index.ts +4 -0
  217. package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +126 -0
  218. package/src/components/Livestream/ViewerLivestream/index.ts +1 -0
  219. package/src/components/Livestream/index.ts +5 -0
  220. package/src/components/index.ts +1 -0
  221. package/src/hooks/usePaginatedLayoutSortPreset.ts +27 -0
  222. package/src/icons/EndStreamIcon.tsx +13 -0
  223. package/src/icons/Eye.tsx +13 -0
  224. package/src/icons/LeaveStreamIcon.tsx +13 -0
  225. package/src/icons/ShieldBadge.tsx +13 -0
  226. package/src/icons/StartStreamIcon.tsx +13 -0
  227. package/src/icons/index.tsx +5 -0
  228. package/src/theme/theme.ts +140 -0
  229. package/src/translations/en.json +6 -1
  230. package/src/version.ts +1 -1
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ViewerLeaveStreamButton = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _contexts = require("../../../contexts");
10
+ var _icons = require("../../../icons");
11
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ /**
15
+ * Props for the ViewerLeaveStreamButton component.
16
+ */
17
+
18
+ /**
19
+ * The ViewerLeaveStreamButton component displays and controls the leave stream logic of the viewer's live stream.
20
+ */
21
+ const ViewerLeaveStreamButton = _ref => {
22
+ let {
23
+ onLeaveStreamHandler
24
+ } = _ref;
25
+ const [isAwaitingResponse, setIsAwaitingResponse] = (0, _react.useState)(false);
26
+ const call = (0, _videoReactBindings.useCall)();
27
+ const {
28
+ t
29
+ } = (0, _videoReactBindings.useI18n)();
30
+ const {
31
+ theme: {
32
+ colors,
33
+ variants: {
34
+ iconSizes
35
+ },
36
+ typefaces,
37
+ viewerLeaveStreamButton
38
+ }
39
+ } = (0, _contexts.useTheme)();
40
+ const onLeaveStreamButtonPress = async () => {
41
+ if (onLeaveStreamHandler) {
42
+ onLeaveStreamHandler();
43
+ return;
44
+ }
45
+ try {
46
+ setIsAwaitingResponse(true);
47
+ await (call === null || call === void 0 ? void 0 : call.leave());
48
+ setIsAwaitingResponse(false);
49
+ } catch (error) {
50
+ console.error('Error stopping livestream', error);
51
+ }
52
+ };
53
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
54
+ style: [styles.container, {
55
+ backgroundColor: colors.dark_gray
56
+ }, viewerLeaveStreamButton.container],
57
+ onPress: onLeaveStreamButtonPress
58
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
59
+ style: [styles.icon, {
60
+ height: iconSizes.xs,
61
+ width: iconSizes.xs
62
+ }, viewerLeaveStreamButton.icon]
63
+ }, isAwaitingResponse ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, null) : /*#__PURE__*/_react.default.createElement(_icons.LeaveStreamIcon, null)), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
64
+ style: [styles.text, typefaces.subtitleBold, {
65
+ color: colors.static_white
66
+ }, viewerLeaveStreamButton.text]
67
+ }, isAwaitingResponse ? t('Loading...') : t('Leave Stream')));
68
+ };
69
+ exports.ViewerLeaveStreamButton = ViewerLeaveStreamButton;
70
+ const styles = _reactNative.StyleSheet.create({
71
+ container: {
72
+ flexDirection: 'row',
73
+ alignItems: 'center',
74
+ padding: 8,
75
+ borderRadius: 4
76
+ },
77
+ icon: {},
78
+ text: {
79
+ marginLeft: 8,
80
+ includeFontPadding: false
81
+ }
82
+ });
83
+ //# sourceMappingURL=ViewerLeaveStreamButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_contexts","_icons","_videoReactBindings","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ViewerLeaveStreamButton","_ref","onLeaveStreamHandler","isAwaitingResponse","setIsAwaitingResponse","useState","useCall","t","useI18n","theme","colors","variants","iconSizes","typefaces","viewerLeaveStreamButton","useTheme","onLeaveStreamButtonPress","leave","error","console","createElement","Pressable","style","styles","container","backgroundColor","dark_gray","onPress","View","icon","height","xs","width","ActivityIndicator","LeaveStreamIcon","Text","text","subtitleBold","color","static_white","exports","StyleSheet","create","flexDirection","alignItems","padding","borderRadius","marginLeft","includeFontPadding"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBA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ACmB,EAAE;MAAEC,KAAK,EAAEpB,SAAS,CAACmB;IAAG,CAAC,EAC7CjB,uBAAuB,CAACe,IAAI;EAC5B,GAED1B,kBAAkB,gBAAGhC,MAAA,CAAAc,OAAA,CAAAmC,aAAA,CAAC9C,YAAA,CAAA2D,iBAAiB,MAAE,CAAC,gBAAG9D,MAAA,CAAAc,OAAA,CAAAmC,aAAA,CAAC5C,MAAA,CAAA0D,eAAe,MAAE,CAC5D,CAAC,eACP/D,MAAA,CAAAc,OAAA,CAAAmC,aAAA,CAAC9C,YAAA,CAAA6D,IAAI;IACHb,KAAK,EAAE,CACLC,MAAM,CAACa,IAAI,EACXvB,SAAS,CAACwB,YAAY,EACtB;MAAEC,KAAK,EAAE5B,MAAM,CAAC6B;IAAa,CAAC,EAC9BzB,uBAAuB,CAACsB,IAAI;EAC5B,GAEDjC,kBAAkB,GAAGI,CAAC,CAAC,YAAY,CAAC,GAAGA,CAAC,CAAC,cAAc,CACpD,CACG,CAAC;AAEhB,CAAC;AAACiC,OAAA,CAAAxC,uBAAA,GAAAA,uBAAA;AAEF,MAAMuB,MAAM,GAAGkB,uBAAU,CAACC,MAAM,CAAC;EAC/BlB,SAAS,EAAE;IACTmB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE,CAAC;IACVC,YAAY,EAAE;EAChB,CAAC;EACDjB,IAAI,EAAE,CAAC,CAAC;EACRO,IAAI,EAAE;IACJW,UAAU,EAAE,CAAC;IACbC,kBAAkB,EAAE;EACtB;AACF,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ViewerLivestreamControls = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _ViewerLeaveStreamButton = require("./ViewerLeaveStreamButton");
10
+ var _contexts = require("../../../contexts");
11
+ var _constants = require("../../../constants");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ /**
14
+ * Props for the ViewerLivestreamControls component.
15
+ */
16
+
17
+ /**
18
+ * The ViewerLivestreamControls component displays the call controls for the live stream at viewer's end.
19
+ */
20
+ const ViewerLivestreamControls = _ref => {
21
+ let {
22
+ ViewerLeaveStreamButton = _ViewerLeaveStreamButton.ViewerLeaveStreamButton,
23
+ onLeaveStreamHandler
24
+ } = _ref;
25
+ const {
26
+ theme: {
27
+ colors,
28
+ viewerLivestreamControls
29
+ }
30
+ } = (0, _contexts.useTheme)();
31
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
32
+ style: [styles.container, {
33
+ backgroundColor: colors.static_overlay
34
+ }, viewerLivestreamControls.container]
35
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
36
+ style: [styles.leftElement, viewerLivestreamControls.leftElement]
37
+ }, ViewerLeaveStreamButton && /*#__PURE__*/_react.default.createElement(ViewerLeaveStreamButton, {
38
+ onLeaveStreamHandler: onLeaveStreamHandler
39
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
40
+ style: [styles.rightElement, viewerLivestreamControls.rightElement]
41
+ }));
42
+ };
43
+ exports.ViewerLivestreamControls = ViewerLivestreamControls;
44
+ const styles = _reactNative.StyleSheet.create({
45
+ container: {
46
+ position: 'absolute',
47
+ bottom: 0,
48
+ flexDirection: 'row',
49
+ alignItems: 'center',
50
+ paddingVertical: 16,
51
+ paddingHorizontal: 8,
52
+ zIndex: _constants.Z_INDEX.IN_FRONT
53
+ },
54
+ content: {},
55
+ leftElement: {
56
+ flex: 1,
57
+ alignItems: 'flex-start'
58
+ },
59
+ rightElement: {
60
+ flex: 1,
61
+ alignItems: 'flex-end'
62
+ }
63
+ });
64
+ //# sourceMappingURL=ViewerLivestreamControls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ViewerLeaveStreamButton","_contexts","_constants","obj","__esModule","default","ViewerLivestreamControls","_ref","ViewerLeaveStreamButton","DefaultViewerLeaveStreamButton","onLeaveStreamHandler","theme","colors","viewerLivestreamControls","useTheme","createElement","View","style","styles","container","backgroundColor","static_overlay","leftElement","rightElement","exports","StyleSheet","create","position","bottom","flexDirection","alignItems","paddingVertical","paddingHorizontal","zIndex","Z_INDEX","IN_FRONT","content","flex"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AAIA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAA6C,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE7C;AACA;AACA;;AAQA;AACA;AACA;AACO,MAAMG,wBAAwB,GAAGC,IAAA,IAGH;EAAA,IAHI;IACvCC,uBAAuB,GAAGC,gDAA8B;IACxDC;EAC6B,CAAC,GAAAH,IAAA;EAC9B,MAAM;IACJI,KAAK,EAAE;MAAEC,MAAM;MAAEC;IAAyB;EAC5C,CAAC,GAAG,IAAAC,kBAAQ,EAAC,CAAC;EAEd,oBACElB,MAAA,CAAAS,OAAA,CAAAU,aAAA,CAAChB,YAAA,CAAAiB,IAAI;IACHC,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAER,MAAM,CAACS;IAC1B,CAAC,EACDR,wBAAwB,CAACM,SAAS;EAClC,gBAEFvB,MAAA,CAAAS,OAAA,CAAAU,aAAA,CAAChB,YAAA,CAAAiB,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACI,WAAW,EAAET,wBAAwB,CAACS,WAAW;EAAE,GACrEd,uBAAuB,iBACtBZ,MAAA,CAAAS,OAAA,CAAAU,aAAA,CAACP,uBAAuB;IACtBE,oBAAoB,EAAEA;EAAqB,CAC5C,CAEC,CAAC,eACPd,MAAA,CAAAS,OAAA,CAAAU,aAAA,CAAChB,YAAA,CAAAiB,IAAI;IACHC,KAAK,EAAE,CAACC,MAAM,CAACK,YAAY,EAAEV,wBAAwB,CAACU,YAAY;EAAE,CACrE,CACG,CAAC;AAEX,CAAC;AAACC,OAAA,CAAAlB,wBAAA,GAAAA,wBAAA;AAEF,MAAMY,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,MAAM,EAAEC,kBAAO,CAACC;EAClB,CAAC;EACDC,OAAO,EAAE,CAAC,CAAC;EACXd,WAAW,EAAE;IACXe,IAAI,EAAE,CAAC;IACPP,UAAU,EAAE;EACd,CAAC;EACDP,YAAY,EAAE;IACZc,IAAI,EAAE,CAAC;IACPP,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _HostLivestreamControls = require("./HostLivestreamControls");
7
+ Object.keys(_HostLivestreamControls).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _HostLivestreamControls[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _HostLivestreamControls[key];
14
+ }
15
+ });
16
+ });
17
+ var _LivestreamMediaControls = require("./LivestreamMediaControls");
18
+ Object.keys(_LivestreamMediaControls).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _LivestreamMediaControls[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _LivestreamMediaControls[key];
25
+ }
26
+ });
27
+ });
28
+ var _HostStartStreamButton = require("./HostStartStreamButton");
29
+ Object.keys(_HostStartStreamButton).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _HostStartStreamButton[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _HostStartStreamButton[key];
36
+ }
37
+ });
38
+ });
39
+ var _LivestreamAudioControlButton = require("./LivestreamAudioControlButton");
40
+ Object.keys(_LivestreamAudioControlButton).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _LivestreamAudioControlButton[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _LivestreamAudioControlButton[key];
47
+ }
48
+ });
49
+ });
50
+ var _LivestreamVideoControlButton = require("./LivestreamVideoControlButton");
51
+ Object.keys(_LivestreamVideoControlButton).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _LivestreamVideoControlButton[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _LivestreamVideoControlButton[key];
58
+ }
59
+ });
60
+ });
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_HostLivestreamControls","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_LivestreamMediaControls","_HostStartStreamButton","_LivestreamAudioControlButton","_LivestreamVideoControlButton"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/index.ts"],"mappings":";;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,uBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CA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OAAAG,6BAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,6BAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,6BAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,6BAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,6BAAA,CAAAR,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LivestreamLayout = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _videoClient = require("@stream-io/video-client");
9
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
10
+ var _reactNative = require("react-native");
11
+ var _usePaginatedLayoutSortPreset = require("../../../hooks/usePaginatedLayoutSortPreset");
12
+ var _contexts = require("../../../contexts");
13
+ var _Participant = require("../../Participant");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ /**
16
+ * Props for the LivestreamLayout component.
17
+ */
18
+
19
+ const hasScreenShare = p => p === null || p === void 0 ? void 0 : p.publishedTracks.includes(_videoClient.SfuModels.TrackType.SCREEN_SHARE);
20
+
21
+ /**
22
+ * The LivestreamLayout component presents the live stream video layout.
23
+ */
24
+ const LivestreamLayout = _ref => {
25
+ let {
26
+ landscape,
27
+ VideoRenderer = _Participant.VideoRenderer
28
+ } = _ref;
29
+ const {
30
+ useParticipants,
31
+ useHasOngoingScreenShare
32
+ } = (0, _videoReactBindings.useCallStateHooks)();
33
+ const call = (0, _videoReactBindings.useCall)();
34
+ const {
35
+ theme: {
36
+ colors,
37
+ livestreamLayout
38
+ }
39
+ } = (0, _contexts.useTheme)();
40
+ const [currentSpeaker, ...otherParticipants] = useParticipants();
41
+ const hasOngoingScreenShare = useHasOngoingScreenShare();
42
+ const presenter = hasOngoingScreenShare ? hasScreenShare(currentSpeaker) && currentSpeaker : otherParticipants.find(hasScreenShare);
43
+ (0, _usePaginatedLayoutSortPreset.usePaginatedLayoutSortPreset)(call);
44
+ const landScapeStyles = {
45
+ flexDirection: landscape ? 'row' : 'column'
46
+ };
47
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
48
+ style: [styles.container, landScapeStyles, {
49
+ backgroundColor: colors.dark_gray
50
+ }, livestreamLayout.container]
51
+ }, VideoRenderer && hasOngoingScreenShare && presenter && /*#__PURE__*/_react.default.createElement(VideoRenderer, {
52
+ trackType: "screenShareTrack",
53
+ participant: presenter
54
+ }), VideoRenderer && !hasOngoingScreenShare && currentSpeaker && /*#__PURE__*/_react.default.createElement(VideoRenderer, {
55
+ participant: currentSpeaker,
56
+ trackType: "videoTrack"
57
+ }));
58
+ };
59
+ exports.LivestreamLayout = LivestreamLayout;
60
+ const styles = _reactNative.StyleSheet.create({
61
+ container: {
62
+ flex: 1
63
+ }
64
+ });
65
+ //# sourceMappingURL=LivestreamLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_videoClient","_videoReactBindings","_reactNative","_usePaginatedLayoutSortPreset","_contexts","_Participant","obj","__esModule","default","hasScreenShare","p","publishedTracks","includes","SfuModels","TrackType","SCREEN_SHARE","LivestreamLayout","_ref","landscape","VideoRenderer","DefaultVideoRenderer","useParticipants","useHasOngoingScreenShare","useCallStateHooks","call","useCall","theme","colors","livestreamLayout","useTheme","currentSpeaker","otherParticipants","hasOngoingScreenShare","presenter","find","usePaginatedLayoutSortPreset","landScapeStyles","flexDirection","createElement","View","style","styles","container","backgroundColor","dark_gray","trackType","participant","exports","StyleSheet","create","flex"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamLayout/LivestreamLayout.tsx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AS,GAAG,KAAK,GAAG;EACrC,CAAC;EAED,oBACErB,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACpC,YAAA,CAAAqC,IAAI;IACHC,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChBN,eAAe,EACf;MAAEO,eAAe,EAAEhB,MAAM,CAACiB;IAAU,CAAC,EACrChB,gBAAgB,CAACc,SAAS;EAC1B,GAEDvB,aAAa,IAAIa,qBAAqB,IAAIC,SAAS,iBAClDpC,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACnB,aAAa;IAAC0B,SAAS,EAAC,kBAAkB;IAACC,WAAW,EAAEb;EAAU,CAAE,CACtE,EACAd,aAAa,IAAI,CAACa,qBAAqB,IAAIF,cAAc,iBACxDjC,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACnB,aAAa;IAAC2B,WAAW,EAAEhB,cAAe;IAACe,SAAS,EAAC;EAAY,CAAE,CAElE,CAAC;AAEX,CAAC;AAACE,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA;AAEF,MAAMyB,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _LivestreamLayout = require("./LivestreamLayout");
7
+ Object.keys(_LivestreamLayout).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _LivestreamLayout[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _LivestreamLayout[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_LivestreamLayout","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamLayout/index.ts"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DurationBadge = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _contexts = require("../../../contexts");
10
+ var _icons = require("../../../icons");
11
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ /**
15
+ * Props for the HostDurationBadge component.
16
+ */
17
+
18
+ /**
19
+ * The HostDurationBadge component displays the duration while the live stream is active.
20
+ */
21
+ const DurationBadge = _ref => {
22
+ let {
23
+ mode
24
+ } = _ref;
25
+ const {
26
+ useCallSession
27
+ } = (0, _videoReactBindings.useCallStateHooks)();
28
+ const session = useCallSession();
29
+ const [duration, setDuration] = (0, _react.useState)(() => {
30
+ if (!session || !session.live_started_at) {
31
+ return 0;
32
+ }
33
+ const liveStartTime = new Date(session.live_started_at);
34
+ const now = new Date();
35
+ return Math.floor((now.getTime() - liveStartTime.getTime()) / 1000);
36
+ });
37
+ const call = (0, _videoReactBindings.useCall)();
38
+ const {
39
+ theme: {
40
+ colors,
41
+ variants: {
42
+ iconSizes
43
+ },
44
+ durationBadge
45
+ }
46
+ } = (0, _contexts.useTheme)();
47
+
48
+ // for host
49
+ (0, _react.useEffect)(() => {
50
+ if (mode !== 'host') {
51
+ return;
52
+ }
53
+ let intervalId;
54
+ const handleLiveStarted = () => {
55
+ intervalId = setInterval(() => {
56
+ setDuration(d => d + 1);
57
+ }, 1000);
58
+ };
59
+ const handleLiveEnded = event => {
60
+ const callDetails = event.call.session;
61
+ if ((callDetails === null || callDetails === void 0 ? void 0 : callDetails.live_ended_at) !== null) {
62
+ clearInterval(intervalId);
63
+ }
64
+ };
65
+ const callLiveStartedUnsubscribe = call === null || call === void 0 ? void 0 : call.on('call.live_started', handleLiveStarted);
66
+ const callUpdatedUnsubscribe = call === null || call === void 0 ? void 0 : call.on('call.updated', handleLiveEnded);
67
+ return () => {
68
+ if (mode !== 'host') {
69
+ return;
70
+ }
71
+ if (callLiveStartedUnsubscribe && callUpdatedUnsubscribe) {
72
+ callLiveStartedUnsubscribe();
73
+ callUpdatedUnsubscribe();
74
+ }
75
+ if (intervalId) {
76
+ clearInterval(intervalId);
77
+ }
78
+ };
79
+ }, [call, mode]);
80
+
81
+ // for viewer
82
+ (0, _react.useEffect)(() => {
83
+ if (mode !== 'viewer') {
84
+ return;
85
+ }
86
+ let intervalId;
87
+ const handleLiveStarted = () => {
88
+ intervalId = setInterval(() => {
89
+ setDuration(d => d + 1);
90
+ }, 1000);
91
+ };
92
+ handleLiveStarted();
93
+ return () => {
94
+ if (mode !== 'viewer') {
95
+ return;
96
+ }
97
+ if (intervalId) {
98
+ clearInterval(intervalId);
99
+ }
100
+ };
101
+ }, [mode]);
102
+ const formatDuration = durationInMs => {
103
+ const days = Math.floor(durationInMs / 86400);
104
+ const hours = Math.floor(durationInMs / 3600);
105
+ const minutes = Math.floor(durationInMs % 3600 / 60);
106
+ const seconds = durationInMs % 60;
107
+ return `${days ? days + ' ' : ''}${hours ? hours + ':' : ''}${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
108
+ };
109
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
110
+ style: [styles.container, {
111
+ backgroundColor: colors.dark_gray
112
+ }, durationBadge.container]
113
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
114
+ style: [styles.icon, {
115
+ height: iconSizes.xs,
116
+ width: iconSizes.xs
117
+ }, durationBadge.icon]
118
+ }, /*#__PURE__*/_react.default.createElement(_icons.ShieldBadge, null)), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
119
+ style: [styles.label, {
120
+ color: colors.static_white
121
+ }, durationBadge.label]
122
+ }, formatDuration(duration)));
123
+ };
124
+ exports.DurationBadge = DurationBadge;
125
+ const styles = _reactNative.StyleSheet.create({
126
+ container: {
127
+ paddingHorizontal: 8,
128
+ paddingVertical: 4,
129
+ borderRadius: 4,
130
+ flexDirection: 'row',
131
+ alignItems: 'center',
132
+ justifyContent: 'center'
133
+ },
134
+ icon: {},
135
+ label: {
136
+ textAlign: 'center',
137
+ fontSize: 13,
138
+ fontWeight: '400',
139
+ flexShrink: 1,
140
+ includeFontPadding: false,
141
+ paddingLeft: 4
142
+ }
143
+ });
144
+ //# sourceMappingURL=DurationBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_contexts","_icons","_videoReactBindings","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DurationBadge","_ref","mode","useCallSession","useCallStateHooks","session","duration","setDuration","useState","live_started_at","liveStartTime","Date","now","Math","floor","getTime","useCall","theme","colors","variants","iconSizes","durationBadge","useTheme","useEffect","intervalId","handleLiveStarted","setInterval","d","handleLiveEnded","event","callDetails","live_ended_at","clearInterval","callLiveStartedUnsubscribe","on","callUpdatedUnsubscribe","formatDuration","durationInMs","days","hours","minutes","seconds","createElement","View","style","styles","container","backgroundColor","dark_gray","icon","height","xs","width","ShieldBadge","Text","label","color","static_white","exports","StyleSheet","create","paddingHorizontal","paddingVertical","borderRadius","flexDirection","alignItems","justifyContent","textAlign","fontSize","fontWeight","flexShrink","includeFontPadding","paddingLeft"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamTopView/DurationBadge.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAA6E,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BA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E,KAAK;IACjBC,UAAU,EAAE,CAAC;IACbC,kBAAkB,EAAE,KAAK;IACzBC,WAAW,EAAE;EACf;AACF,CAAC,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FollowerCount = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _contexts = require("../../../contexts");
10
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
11
+ var _icons = require("../../../icons");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ /**
14
+ * Props for the FollowerCount component.
15
+ */
16
+
17
+ /**
18
+ * The FollowerCount component that displays the number of participants while in the call.
19
+ */
20
+ const FollowerCount = _ref => {
21
+ let {} = _ref;
22
+ const {
23
+ theme: {
24
+ colors,
25
+ variants: {
26
+ iconSizes
27
+ },
28
+ followerCount
29
+ }
30
+ } = (0, _contexts.useTheme)();
31
+ const {
32
+ useParticipantCount
33
+ } = (0, _videoReactBindings.useCallStateHooks)();
34
+ const totalParticipants = useParticipantCount();
35
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
36
+ style: [styles.container, {
37
+ backgroundColor: colors.dark_gray
38
+ }, followerCount.container]
39
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
40
+ style: [styles.icon, {
41
+ height: iconSizes.xs,
42
+ width: iconSizes.xs
43
+ }, followerCount.icon]
44
+ }, /*#__PURE__*/_react.default.createElement(_icons.Eye, null)), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
45
+ style: [styles.label, {
46
+ color: colors.static_white
47
+ }, followerCount.label]
48
+ }, totalParticipants));
49
+ };
50
+ exports.FollowerCount = FollowerCount;
51
+ const styles = _reactNative.StyleSheet.create({
52
+ container: {
53
+ paddingHorizontal: 8,
54
+ paddingVertical: 4,
55
+ borderTopRightRadius: 4,
56
+ borderBottomRightRadius: 4,
57
+ flexDirection: 'row',
58
+ alignItems: 'center',
59
+ justifyContent: 'center'
60
+ },
61
+ icon: {},
62
+ label: {
63
+ fontSize: 13,
64
+ fontWeight: '400',
65
+ flexShrink: 1,
66
+ textAlign: 'center',
67
+ includeFontPadding: false,
68
+ marginLeft: 4
69
+ }
70
+ });
71
+ //# sourceMappingURL=FollowerCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_contexts","_videoReactBindings","_icons","obj","__esModule","default","FollowerCount","_ref","theme","colors","variants","iconSizes","followerCount","useTheme","useParticipantCount","useCallStateHooks","totalParticipants","createElement","View","style","styles","container","backgroundColor","dark_gray","icon","height","xs","width","Eye","Text","label","color","static_white","exports","StyleSheet","create","paddingHorizontal","paddingVertical","borderTopRightRadius","borderBottomRightRadius","flexDirection","alignItems","justifyContent","fontSize","fontWeight","flexShrink","textAlign","includeFontPadding","marginLeft"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamTopView/FollowerCount.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAqC,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErC;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMG,aAAa,GAAGC,IAAA,IAA4B;EAAA,IAA3B,CAAqB,CAAC,GAAAA,IAAA;EAClD,MAAM;IACJC,KAAK,EAAE;MACLC,MAAM;MACNC,QAAQ,EAAE;QAAEC;MAAU,CAAC;MACvBC;IACF;EACF,CAAC,GAAG,IAAAC,kBAAQ,EAAC,CAAC;EACd,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,qCAAiB,EAAC,CAA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;IACbC,SAAS,EAAE,QAAQ;IACnBC,kBAAkB,EAAE,KAAK;IACzBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HostLivestreamTopView = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _DurationBadge = require("./DurationBadge");
10
+ var _LiveIndicator = require("./LiveIndicator");
11
+ var _FollowerCount = require("./FollowerCount");
12
+ var _contexts = require("../../../contexts");
13
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
14
+ var _constants = require("../../../constants");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ /**
17
+ * Props for the HostLivestreamTopView component.
18
+ */
19
+
20
+ /**
21
+ * The HostLivestreamTopView component displays the top view component of the host's live stream.
22
+ */
23
+ const HostLivestreamTopView = _ref => {
24
+ let {
25
+ DurationBadge = _DurationBadge.DurationBadge,
26
+ LiveIndicator = _LiveIndicator.LiveIndicator,
27
+ FollowerCount = _FollowerCount.FollowerCount
28
+ } = _ref;
29
+ const {
30
+ useIsCallLive,
31
+ useIsCallBroadcastingInProgress
32
+ } = (0, _videoReactBindings.useCallStateHooks)();
33
+ const isCallLive = useIsCallLive();
34
+ const isBroadcasting = useIsCallBroadcastingInProgress();
35
+ const liveOrBroadcasting = isCallLive || isBroadcasting;
36
+ const {
37
+ theme: {
38
+ colors,
39
+ hostLivestreamTopView
40
+ }
41
+ } = (0, _contexts.useTheme)();
42
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
43
+ style: [styles.container, {
44
+ backgroundColor: colors.static_overlay
45
+ }, hostLivestreamTopView.container]
46
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
47
+ style: [styles.leftElement, hostLivestreamTopView.leftElement]
48
+ }, DurationBadge && /*#__PURE__*/_react.default.createElement(DurationBadge, {
49
+ mode: "host"
50
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
51
+ style: [styles.centerElement, hostLivestreamTopView.centerElement]
52
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
53
+ style: [styles.rightElement, hostLivestreamTopView.rightElement]
54
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
55
+ style: [styles.liveInfo, hostLivestreamTopView.liveInfo]
56
+ }, liveOrBroadcasting && LiveIndicator && /*#__PURE__*/_react.default.createElement(LiveIndicator, null), FollowerCount && /*#__PURE__*/_react.default.createElement(FollowerCount, null))));
57
+ };
58
+ exports.HostLivestreamTopView = HostLivestreamTopView;
59
+ const styles = _reactNative.StyleSheet.create({
60
+ container: {
61
+ position: 'absolute',
62
+ top: 0,
63
+ flexDirection: 'row',
64
+ alignItems: 'center',
65
+ paddingVertical: 16,
66
+ paddingHorizontal: 8,
67
+ borderBottomEndRadius: 8,
68
+ borderBottomStartRadius: 8,
69
+ zIndex: _constants.Z_INDEX.IN_FRONT
70
+ },
71
+ liveInfo: {
72
+ flexDirection: 'row'
73
+ },
74
+ leftElement: {
75
+ flex: 1,
76
+ alignItems: 'flex-start'
77
+ },
78
+ centerElement: {
79
+ flex: 1,
80
+ alignItems: 'center'
81
+ },
82
+ rightElement: {
83
+ flex: 1,
84
+ alignItems: 'flex-end'
85
+ }
86
+ });
87
+ //# sourceMappingURL=HostLivestreamTopView.js.map