@100mslive/react-native-room-kit 1.1.6 → 1.1.7

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 (222) hide show
  1. package/lib/commonjs/Icons/Pause/assets/pause-med.png +0 -0
  2. package/lib/commonjs/Icons/Pause/assets/pause-med@2x.png +0 -0
  3. package/lib/commonjs/Icons/Pause/assets/pause-med@3x.png +0 -0
  4. package/lib/commonjs/Icons/Pause/index.js +35 -0
  5. package/lib/commonjs/Icons/Pause/index.js.map +1 -0
  6. package/lib/commonjs/Icons/Play/assets/play-med.png +0 -0
  7. package/lib/commonjs/Icons/Play/assets/play-med@2x.png +0 -0
  8. package/lib/commonjs/Icons/Play/assets/play-med@3x.png +0 -0
  9. package/lib/commonjs/Icons/Play/index.js +35 -0
  10. package/lib/commonjs/Icons/Play/index.js.map +1 -0
  11. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  12. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  13. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  14. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  15. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  16. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  17. package/lib/commonjs/Icons/SeekArrow/index.js +34 -0
  18. package/lib/commonjs/Icons/SeekArrow/index.js.map +1 -0
  19. package/lib/commonjs/Icons/index.js +33 -0
  20. package/lib/commonjs/Icons/index.js.map +1 -1
  21. package/lib/commonjs/components/HLSChatMessages.js +4 -5
  22. package/lib/commonjs/components/HLSChatMessages.js.map +1 -1
  23. package/lib/commonjs/components/HLSCloseMeetingControl.js +41 -0
  24. package/lib/commonjs/components/HLSCloseMeetingControl.js.map +1 -0
  25. package/lib/commonjs/components/HLSClosedCaptionControl.js +109 -0
  26. package/lib/commonjs/components/HLSClosedCaptionControl.js.map +1 -0
  27. package/lib/commonjs/components/HLSDistanceFromLive.js +56 -0
  28. package/lib/commonjs/components/HLSDistanceFromLive.js.map +1 -0
  29. package/lib/commonjs/components/HLSFullScreenControl.js +42 -0
  30. package/lib/commonjs/components/HLSFullScreenControl.js.map +1 -0
  31. package/lib/commonjs/components/HLSGoLiveControl.js +78 -0
  32. package/lib/commonjs/components/HLSGoLiveControl.js.map +1 -0
  33. package/lib/commonjs/components/HLSPlayPauseControl.js +62 -0
  34. package/lib/commonjs/components/HLSPlayPauseControl.js.map +1 -0
  35. package/lib/commonjs/components/HLSPlayer.js +82 -81
  36. package/lib/commonjs/components/HLSPlayer.js.map +1 -1
  37. package/lib/commonjs/components/HLSPlayerContainer.js +62 -3
  38. package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
  39. package/lib/commonjs/components/HLSPlayerControls.js +89 -46
  40. package/lib/commonjs/components/HLSPlayerControls.js.map +1 -1
  41. package/lib/commonjs/components/HLSSeekbackwardControl.js +67 -0
  42. package/lib/commonjs/components/HLSSeekbackwardControl.js.map +1 -0
  43. package/lib/commonjs/components/HLSSeekbar.js +285 -0
  44. package/lib/commonjs/components/HLSSeekbar.js.map +1 -0
  45. package/lib/commonjs/components/HLSSeekforwardControl.js +71 -0
  46. package/lib/commonjs/components/HLSSeekforwardControl.js.map +1 -0
  47. package/lib/commonjs/components/HMSHLSMessage.js +19 -41
  48. package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
  49. package/lib/commonjs/components/HMSHLSMessageList.js +2 -2
  50. package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
  51. package/lib/commonjs/components/HMSOverlayMessageView.js +150 -0
  52. package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -0
  53. package/lib/commonjs/components/Participants/ParticipantsList.js +4 -4
  54. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
  55. package/lib/commonjs/hooks-util.js +30 -2
  56. package/lib/commonjs/hooks-util.js.map +1 -1
  57. package/lib/commonjs/redux/actionTypes.js +2 -0
  58. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  59. package/lib/commonjs/redux/actions/index.js +10 -3
  60. package/lib/commonjs/redux/actions/index.js.map +1 -1
  61. package/lib/commonjs/redux/reducers/appState.js +9 -1
  62. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  63. package/lib/module/Icons/Pause/assets/pause-med.png +0 -0
  64. package/lib/module/Icons/Pause/assets/pause-med@2x.png +0 -0
  65. package/lib/module/Icons/Pause/assets/pause-med@3x.png +0 -0
  66. package/lib/module/Icons/Pause/index.js +27 -0
  67. package/lib/module/Icons/Pause/index.js.map +1 -0
  68. package/lib/module/Icons/Play/assets/play-med.png +0 -0
  69. package/lib/module/Icons/Play/assets/play-med@2x.png +0 -0
  70. package/lib/module/Icons/Play/assets/play-med@3x.png +0 -0
  71. package/lib/module/Icons/Play/index.js +27 -0
  72. package/lib/module/Icons/Play/index.js.map +1 -0
  73. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  74. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  75. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  76. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  77. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  78. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  79. package/lib/module/Icons/SeekArrow/index.js +26 -0
  80. package/lib/module/Icons/SeekArrow/index.js.map +1 -0
  81. package/lib/module/Icons/index.js +3 -0
  82. package/lib/module/Icons/index.js.map +1 -1
  83. package/lib/module/components/HLSChatMessages.js +5 -6
  84. package/lib/module/components/HLSChatMessages.js.map +1 -1
  85. package/lib/module/components/HLSCloseMeetingControl.js +33 -0
  86. package/lib/module/components/HLSCloseMeetingControl.js.map +1 -0
  87. package/lib/module/components/HLSClosedCaptionControl.js +100 -0
  88. package/lib/module/components/HLSClosedCaptionControl.js.map +1 -0
  89. package/lib/module/components/HLSDistanceFromLive.js +48 -0
  90. package/lib/module/components/HLSDistanceFromLive.js.map +1 -0
  91. package/lib/module/components/HLSFullScreenControl.js +34 -0
  92. package/lib/module/components/HLSFullScreenControl.js.map +1 -0
  93. package/lib/module/components/HLSGoLiveControl.js +70 -0
  94. package/lib/module/components/HLSGoLiveControl.js.map +1 -0
  95. package/lib/module/components/HLSPlayPauseControl.js +54 -0
  96. package/lib/module/components/HLSPlayPauseControl.js.map +1 -0
  97. package/lib/module/components/HLSPlayer.js +83 -81
  98. package/lib/module/components/HLSPlayer.js.map +1 -1
  99. package/lib/module/components/HLSPlayerContainer.js +62 -3
  100. package/lib/module/components/HLSPlayerContainer.js.map +1 -1
  101. package/lib/module/components/HLSPlayerControls.js +89 -50
  102. package/lib/module/components/HLSPlayerControls.js.map +1 -1
  103. package/lib/module/components/HLSSeekbackwardControl.js +59 -0
  104. package/lib/module/components/HLSSeekbackwardControl.js.map +1 -0
  105. package/lib/module/components/HLSSeekbar.js +276 -0
  106. package/lib/module/components/HLSSeekbar.js.map +1 -0
  107. package/lib/module/components/HLSSeekforwardControl.js +63 -0
  108. package/lib/module/components/HLSSeekforwardControl.js.map +1 -0
  109. package/lib/module/components/HMSHLSMessage.js +19 -41
  110. package/lib/module/components/HMSHLSMessage.js.map +1 -1
  111. package/lib/module/components/HMSHLSMessageList.js +2 -2
  112. package/lib/module/components/HMSHLSMessageList.js.map +1 -1
  113. package/lib/module/components/HMSOverlayMessageView.js +142 -0
  114. package/lib/module/components/HMSOverlayMessageView.js.map +1 -0
  115. package/lib/module/components/Participants/ParticipantsList.js +4 -4
  116. package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
  117. package/lib/module/hooks-util.js +30 -3
  118. package/lib/module/hooks-util.js.map +1 -1
  119. package/lib/module/redux/actionTypes.js +2 -0
  120. package/lib/module/redux/actionTypes.js.map +1 -1
  121. package/lib/module/redux/actions/index.js +6 -0
  122. package/lib/module/redux/actions/index.js.map +1 -1
  123. package/lib/module/redux/reducers/appState.js +9 -1
  124. package/lib/module/redux/reducers/appState.js.map +1 -1
  125. package/lib/typescript/Icons/Pause/index.d.ts +8 -0
  126. package/lib/typescript/Icons/Pause/index.d.ts.map +1 -0
  127. package/lib/typescript/Icons/Play/index.d.ts +8 -0
  128. package/lib/typescript/Icons/Play/index.d.ts.map +1 -0
  129. package/lib/typescript/Icons/SeekArrow/index.d.ts +8 -0
  130. package/lib/typescript/Icons/SeekArrow/index.d.ts.map +1 -0
  131. package/lib/typescript/Icons/index.d.ts +3 -0
  132. package/lib/typescript/Icons/index.d.ts.map +1 -1
  133. package/lib/typescript/components/CustomButton.d.ts +5 -5
  134. package/lib/typescript/components/CustomButton.d.ts.map +1 -1
  135. package/lib/typescript/components/HLSChatMessages.d.ts.map +1 -1
  136. package/lib/typescript/components/HLSCloseMeetingControl.d.ts +8 -0
  137. package/lib/typescript/components/HLSCloseMeetingControl.d.ts.map +1 -0
  138. package/lib/typescript/components/HLSClosedCaptionControl.d.ts +10 -0
  139. package/lib/typescript/components/HLSClosedCaptionControl.d.ts.map +1 -0
  140. package/lib/typescript/components/HLSDistanceFromLive.d.ts +8 -0
  141. package/lib/typescript/components/HLSDistanceFromLive.d.ts.map +1 -0
  142. package/lib/typescript/components/HLSFullScreenControl.d.ts +8 -0
  143. package/lib/typescript/components/HLSFullScreenControl.d.ts.map +1 -0
  144. package/lib/typescript/components/HLSGoLiveControl.d.ts +10 -0
  145. package/lib/typescript/components/HLSGoLiveControl.d.ts.map +1 -0
  146. package/lib/typescript/components/HLSPlayPauseControl.d.ts +8 -0
  147. package/lib/typescript/components/HLSPlayPauseControl.d.ts.map +1 -0
  148. package/lib/typescript/components/HLSPlayer.d.ts +4 -2
  149. package/lib/typescript/components/HLSPlayer.d.ts.map +1 -1
  150. package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
  151. package/lib/typescript/components/HLSPlayerControls.d.ts +12 -2
  152. package/lib/typescript/components/HLSPlayerControls.d.ts.map +1 -1
  153. package/lib/typescript/components/HLSSeekbackwardControl.d.ts +8 -0
  154. package/lib/typescript/components/HLSSeekbackwardControl.d.ts.map +1 -0
  155. package/lib/typescript/components/HLSSeekbar.d.ts +66 -0
  156. package/lib/typescript/components/HLSSeekbar.d.ts.map +1 -0
  157. package/lib/typescript/components/HLSSeekforwardControl.d.ts +8 -0
  158. package/lib/typescript/components/HLSSeekforwardControl.d.ts.map +1 -0
  159. package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
  160. package/lib/typescript/components/HMSOverlayMessageView.d.ts +8 -0
  161. package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -0
  162. package/lib/typescript/components/Modals.d.ts +3 -3
  163. package/lib/typescript/components/Modals.d.ts.map +1 -1
  164. package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
  165. package/lib/typescript/components/Preview.d.ts.map +1 -1
  166. package/lib/typescript/hooks-util.d.ts +12 -7
  167. package/lib/typescript/hooks-util.d.ts.map +1 -1
  168. package/lib/typescript/redux/actionTypes.d.ts +1 -0
  169. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  170. package/lib/typescript/redux/actions/index.d.ts +6 -0
  171. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  172. package/lib/typescript/redux/index.d.ts +17 -16
  173. package/lib/typescript/redux/index.d.ts.map +1 -1
  174. package/lib/typescript/redux/reducers/appState.d.ts +1 -0
  175. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  176. package/lib/typescript/redux/reducers/index.d.ts +17 -16
  177. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  178. package/package.json +2 -2
  179. package/src/Icons/Pause/assets/pause-med.png +0 -0
  180. package/src/Icons/Pause/assets/pause-med@2x.png +0 -0
  181. package/src/Icons/Pause/assets/pause-med@3x.png +0 -0
  182. package/src/Icons/Pause/index.tsx +36 -0
  183. package/src/Icons/Play/assets/play-med.png +0 -0
  184. package/src/Icons/Play/assets/play-med@2x.png +0 -0
  185. package/src/Icons/Play/assets/play-med@3x.png +0 -0
  186. package/src/Icons/Play/index.tsx +36 -0
  187. package/src/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  188. package/src/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  189. package/src/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  190. package/src/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  191. package/src/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  192. package/src/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  193. package/src/Icons/SeekArrow/index.tsx +40 -0
  194. package/src/Icons/index.ts +3 -0
  195. package/src/components/HLSChatMessages.tsx +4 -6
  196. package/src/components/HLSCloseMeetingControl.tsx +39 -0
  197. package/src/components/HLSClosedCaptionControl.tsx +140 -0
  198. package/src/components/HLSDistanceFromLive.tsx +69 -0
  199. package/src/components/HLSFullScreenControl.tsx +46 -0
  200. package/src/components/HLSGoLiveControl.tsx +104 -0
  201. package/src/components/HLSPlayPauseControl.tsx +69 -0
  202. package/src/components/HLSPlayer.tsx +98 -88
  203. package/src/components/HLSPlayerContainer.tsx +81 -14
  204. package/src/components/HLSPlayerControls.tsx +137 -58
  205. package/src/components/HLSSeekbackwardControl.tsx +88 -0
  206. package/src/components/HLSSeekbar.tsx +381 -0
  207. package/src/components/HLSSeekforwardControl.tsx +97 -0
  208. package/src/components/HMSHLSMessage.tsx +32 -49
  209. package/src/components/HMSHLSMessageList.tsx +2 -2
  210. package/src/components/HMSOverlayMessageView.tsx +189 -0
  211. package/src/components/Participants/ParticipantsList.tsx +12 -10
  212. package/src/hooks-util.ts +39 -1
  213. package/src/redux/actionTypes.ts +3 -0
  214. package/src/redux/actions/index.ts +5 -0
  215. package/src/redux/reducers/appState.ts +8 -0
  216. package/lib/commonjs/components/CustomHLSPlayerControls.js +0 -80
  217. package/lib/commonjs/components/CustomHLSPlayerControls.js.map +0 -1
  218. package/lib/module/components/CustomHLSPlayerControls.js +0 -72
  219. package/lib/module/components/CustomHLSPlayerControls.js.map +0 -1
  220. package/lib/typescript/components/CustomHLSPlayerControls.d.ts +0 -7
  221. package/lib/typescript/components/CustomHLSPlayerControls.d.ts.map +0 -1
  222. package/src/components/CustomHLSPlayerControls.tsx +0 -92
@@ -1,64 +1,103 @@
1
1
  import React from 'react';
2
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
3
- import { useDispatch, useSelector } from 'react-redux';
4
- import {
5
- // CCIcon,
6
- CloseIcon, MaximizeIcon, MinimizeIcon } from '../Icons';
7
- import { ModalTypes } from '../utils/types';
8
- import { useModalType } from '../hooks-util';
9
- import { setHlsFullScreen } from '../redux/actions';
10
- export const _HLSPlayerControls = () => {
11
- // const isHLSStreaming = useIsHLSStreamingOn();
12
- // const isStreamUrlPresent = useSelector(
13
- // (state: RootState) =>
14
- // !!state.hmsStates.room?.hlsStreamingState.variants?.[0]?.hlsStreamUrl
15
- // );
16
- const dispatch = useDispatch();
17
- const hlsFullScreen = useSelector(state => state.app.hlsFullScreen);
2
+ import { View, StyleSheet } from 'react-native';
3
+ import { useSelector } from 'react-redux';
4
+ import Animated, { useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated';
5
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
+ import { HLSGoLiveControl } from './HLSGoLiveControl';
7
+ import { HLSSeekbar } from './HLSSeekbar';
8
+ import { useIsLandscapeOrientation } from '../utils/dimension';
9
+ import { HLSCloseMeetingControl } from './HLSCloseMeetingControl';
10
+ import { HLSClosedCaptionControl } from './HLSClosedCaptionControl';
11
+ import { HLSFullScreenControl } from './HLSFullScreenControl';
12
+ import { HLSDistanceFromLive } from './HLSDistanceFromLive';
13
+ import { HLSPlayPauseControl } from './HLSPlayPauseControl';
14
+ import { HLSSeekbackwardControl } from './HLSSeekbackwardControl';
15
+ import { HLSSeekforwardControl } from './HLSSeekforwardControl';
16
+ export const _HLSPlayerControls = ({
17
+ playerRef,
18
+ cancelCurrentControlAnimation,
19
+ hideControlsAfterDelay,
20
+ animatedValue,
21
+ resetHideControlAnimation
22
+ }) => {
18
23
  const {
19
- handleModalVisibleType
20
- } = useModalType();
21
- const handleCloseBtnPress = () => {
22
- handleModalVisibleType(ModalTypes.LEAVE_ROOM);
23
- };
24
-
25
- // const handleCCBtnPress = () => {
26
- // //
27
- // };
28
-
29
- const toggleFullScreen = () => {
30
- dispatch(setHlsFullScreen(!hlsFullScreen));
31
- };
32
- return /*#__PURE__*/React.createElement(View, {
33
- style: styles.container
24
+ bottom: bottomSafeInset
25
+ } = useSafeAreaInsets();
26
+ const isLandscapeOrientation = useIsLandscapeOrientation();
27
+ const hlsFullScreen = useSelector(state => state.app.hlsFullScreen);
28
+ const hideControlsStyles = useAnimatedStyle(() => ({
29
+ opacity: animatedValue.value
30
+ }), []);
31
+ const hideControlsProps = useAnimatedProps(() => ({
32
+ pointerEvents: animatedValue.value < 0.8 ? 'none' : 'auto'
33
+ }), []);
34
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Animated.View, {
35
+ animatedProps: hideControlsProps,
36
+ style: [{
37
+ height: '100%'
38
+ }, styles.floatingContainer, hideControlsStyles]
39
+ }, /*#__PURE__*/React.createElement(View, {
40
+ style: {
41
+ flex: 1,
42
+ flexDirection: 'row',
43
+ alignItems: 'center',
44
+ justifyContent: 'center'
45
+ }
46
+ }, /*#__PURE__*/React.createElement(HLSSeekbackwardControl, {
47
+ playerRef: playerRef,
48
+ onPress: resetHideControlAnimation
49
+ }), /*#__PURE__*/React.createElement(HLSPlayPauseControl, {
50
+ playerRef: playerRef,
51
+ onPress: resetHideControlAnimation
52
+ }), /*#__PURE__*/React.createElement(HLSSeekforwardControl, {
53
+ playerRef: playerRef,
54
+ onPress: resetHideControlAnimation
55
+ }))), /*#__PURE__*/React.createElement(Animated.View, {
56
+ animatedProps: hideControlsProps,
57
+ style: [{
58
+ top: 0
59
+ }, styles.floatingContainer, hideControlsStyles]
34
60
  }, /*#__PURE__*/React.createElement(View, {
35
61
  style: styles.controlsRow
36
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
37
- onPress: handleCloseBtnPress,
38
- style: styles.icon
39
- }, /*#__PURE__*/React.createElement(CloseIcon, {
40
- size: "medium"
41
- }))), /*#__PURE__*/React.createElement(View, {
62
+ }, /*#__PURE__*/React.createElement(HLSCloseMeetingControl, {
63
+ onPress: resetHideControlAnimation
64
+ }), /*#__PURE__*/React.createElement(View, {
65
+ style: [styles.normalRow, styles.gap]
66
+ }, /*#__PURE__*/React.createElement(HLSClosedCaptionControl, {
67
+ playerRef: playerRef,
68
+ onPress: resetHideControlAnimation
69
+ })))), /*#__PURE__*/React.createElement(Animated.View, {
70
+ animatedProps: hideControlsProps,
71
+ style: [{
72
+ bottom: isLandscapeOrientation ? bottomSafeInset : 0
73
+ }, styles.floatingContainer, hideControlsStyles]
74
+ }, /*#__PURE__*/React.createElement(View, {
75
+ style: {
76
+ flexDirection: isLandscapeOrientation || hlsFullScreen ? 'column-reverse' : 'column'
77
+ }
78
+ }, /*#__PURE__*/React.createElement(View, {
42
79
  style: styles.controlsRow
43
- }, /*#__PURE__*/React.createElement(View, null), /*#__PURE__*/React.createElement(View, {
80
+ }, /*#__PURE__*/React.createElement(View, {
81
+ style: styles.normalRow
82
+ }, /*#__PURE__*/React.createElement(HLSGoLiveControl, {
83
+ playerRef: playerRef,
84
+ onPress: resetHideControlAnimation
85
+ }), /*#__PURE__*/React.createElement(HLSDistanceFromLive, null)), /*#__PURE__*/React.createElement(View, {
44
86
  style: [styles.normalRow, styles.gap]
45
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
46
- onPress: toggleFullScreen,
47
- style: styles.icon
48
- }, hlsFullScreen ? /*#__PURE__*/React.createElement(MinimizeIcon, {
49
- size: "medium"
50
- }) : /*#__PURE__*/React.createElement(MaximizeIcon, {
51
- size: "medium"
52
- })))));
87
+ }, /*#__PURE__*/React.createElement(HLSFullScreenControl, {
88
+ onPress: resetHideControlAnimation
89
+ }))), /*#__PURE__*/React.createElement(HLSSeekbar, {
90
+ playerRef: playerRef,
91
+ onStart: cancelCurrentControlAnimation,
92
+ onEnd: hideControlsAfterDelay
93
+ }))));
53
94
  };
54
95
  export const HLSPlayerControls = /*#__PURE__*/React.memo(_HLSPlayerControls);
55
96
  const styles = StyleSheet.create({
56
- container: {
97
+ floatingContainer: {
57
98
  position: 'absolute',
58
99
  width: '100%',
59
- height: '100%',
60
- zIndex: 5,
61
- justifyContent: 'space-between'
100
+ zIndex: 5
62
101
  },
63
102
  controlsRow: {
64
103
  flexDirection: 'row',
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","StyleSheet","TouchableOpacity","useDispatch","useSelector","CloseIcon","MaximizeIcon","MinimizeIcon","ModalTypes","useModalType","setHlsFullScreen","_HLSPlayerControls","dispatch","hlsFullScreen","state","app","handleModalVisibleType","handleCloseBtnPress","LEAVE_ROOM","toggleFullScreen","createElement","style","styles","container","controlsRow","onPress","icon","size","normalRow","gap","HLSPlayerControls","memo","create","position","width","height","zIndex","justifyContent","flexDirection","alignItems","marginHorizontal","padding","alignSelf","marginLeft"],"sourceRoot":"../../../src","sources":["components/HLSPlayerControls.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AACjE,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD;AACE;AACAC,SAAS,EACTC,YAAY,EACZC,YAAY,QACP,UAAU;AACjB,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,YAAY,QAAQ,eAAe;AAE5C,SAASC,gBAAgB,QAAQ,kBAAkB;AAEnD,OAAO,MAAMC,kBAA4B,GAAGA,CAAA,KAAM;EAChD;EACA;EACA;EACA;EACA;EACA,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B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AA,CAACd,YAAY;IAACqB,IAAI,EAAC;EAAQ,CAAE,CAEf,CACd,CACF,CACF,CAAC;AAEX,CAAC;AAED,OAAO,MAAMG,iBAAiB,gBAAG/B,KAAK,CAACgC,IAAI,CAACpB,kBAAkB,CAAC;AAE/D,MAAMW,MAAM,GAAGrB,UAAU,CAAC+B,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,MAAM,EAAE,CAAC;IACTC,cAAc,EAAE;EAClB,CAAC;EACDb,WAAW,EAAE;IACXc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBF,cAAc,EAAE,eAAe;IAC/BG,gBAAgB,EAAE;EACpB,CAAC;EACDZ,SAAS,EAAE;IACTU,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDb,IAAI,EAAE;IACJe,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE;EACb,CAAC;EACDb,GAAG,EAAE;IACHc,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","StyleSheet","useSelector","Animated","useAnimatedProps","useAnimatedStyle","useSafeAreaInsets","HLSGoLiveControl","HLSSeekbar","useIsLandscapeOrientation","HLSCloseMeetingControl","HLSClosedCaptionControl","HLSFullScreenControl","HLSDistanceFromLive","HLSPlayPauseControl","HLSSeekbackwardControl","HLSSeekforwardControl","_HLSPlayerControls","playerRef","cancelCurrentControlAnimation","hideControlsAfterDelay","animatedValue","resetHideControlAnimation","bottom","bottomSafeInset","isLandscapeOrientation","hlsFullScreen","state","app","hideControlsStyles","opacity","value","hideControlsProps","pointerEvents","createElement","Fragment","animatedProps","style","height","styles","floatingContainer","flex","flexDirection","alignItems","justifyContent","onPress","top","controlsRow","normalRow","gap","onStart","onEnd","HLSPlayerControls","memo","create","position","width","zIndex","marginHorizontal","icon","padding","alignSelf","margin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,CAAC;AAED,OAAO,MAAMgC,iBAAiB,gBAAGrD,KAAK,CAACsD,IAAI,CAACpC,kBAAkB,CAAC;AAE/D,MAAMsB,MAAM,GAAGtC,UAAU,CAACqD,MAAM,CAAC;EAC/Bd,iBAAiB,EAAE;IACjBe,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDV,WAAW,EAAE;IACXL,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/Bc,gBAAgB,EAAE;EACpB,CAAC;EACDV,SAAS,EAAE;IACTN,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDgB,IAAI,EAAE;IACJC,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE;EACb,CAAC;EACDZ,GAAG,EAAE;IACHa,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ import { HMSHLSPlaylistType } from '@100mslive/react-native-hms';
2
+ import * as React from 'react';
3
+ import { useSelector } from 'react-redux';
4
+ import { GestureDetector, Gesture } from 'react-native-gesture-handler';
5
+ import { useIsHLSStreamingOn } from '../hooks-sdk';
6
+ import { SeekArrowIcon } from '../Icons';
7
+ import Animated, { Easing, cancelAnimation, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
8
+ const _HLSSeekbackwardControl = ({
9
+ playerRef,
10
+ onPress
11
+ }) => {
12
+ const animatedValue = useSharedValue(0);
13
+ const isHLSStreamingOn = useIsHLSStreamingOn();
14
+ const isDVRStream = useSelector(state => {
15
+ var _state$hmsStates$room;
16
+ return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room[0]) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.playlistType) === HMSHLSPlaylistType.DVR;
17
+ });
18
+ const handdleSeekBackward = () => {
19
+ var _playerRef$current;
20
+ onPress === null || onPress === void 0 || onPress();
21
+ (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 || _playerRef$current.seekBackward(10);
22
+ };
23
+ const tapGestureHandler = React.useMemo(() => {
24
+ return Gesture.Tap().onStart(() => {
25
+ cancelAnimation(animatedValue);
26
+ animatedValue.value = withTiming(1, {
27
+ duration: 200,
28
+ easing: Easing.ease
29
+ }, finished => {
30
+ if (finished) {
31
+ animatedValue.value = withTiming(0, {
32
+ duration: 100,
33
+ easing: Easing.ease
34
+ });
35
+ }
36
+ });
37
+ runOnJS(handdleSeekBackward)();
38
+ });
39
+ }, []);
40
+ const animatedStyle = useAnimatedStyle(() => ({
41
+ opacity: interpolate(animatedValue.value, [0, 1], [1, 0.8]),
42
+ transform: [{
43
+ rotateZ: `${interpolate(animatedValue.value, [0, 1], [0, -17])} deg`
44
+ }]
45
+ }), []);
46
+ if (!isHLSStreamingOn || !isDVRStream) return null;
47
+ return /*#__PURE__*/React.createElement(GestureDetector, {
48
+ gesture: tapGestureHandler
49
+ }, /*#__PURE__*/React.createElement(Animated.View, {
50
+ collapsable: false,
51
+ style: [{
52
+ marginRight: 24
53
+ }, animatedStyle]
54
+ }, /*#__PURE__*/React.createElement(SeekArrowIcon, {
55
+ type: "backward"
56
+ })));
57
+ };
58
+ export const HLSSeekbackwardControl = /*#__PURE__*/React.memo(_HLSSeekbackwardControl);
59
+ //# sourceMappingURL=HLSSeekbackwardControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HMSHLSPlaylistType","React","useSelector","GestureDetector","Gesture","useIsHLSStreamingOn","SeekArrowIcon","Animated","Easing","cancelAnimation","interpolate","runOnJS","useAnimatedStyle","useSharedValue","withTiming","_HLSSeekbackwardControl","playerRef","onPress","animatedValue","isHLSStreamingOn","isDVRStream","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","playlistType","DVR","handdleSeekBackward","_playerRef$current","current","seekBackward","tapGestureHandler","useMemo","Tap","onStart","value","duration","easing","ease","finished","animatedStyle","opacity","transform","rotateZ","createElement","gesture","View","collapsable","style","marginRight","type","HLSSeekbackwardControl","memo"],"sourceRoot":"../../../src","sources":["components/HLSSeekbackwardControl.tsx"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,6BAA6B;AAEhE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,eAAe,EAAEC,OAAO,QAAQ,8BAA8B;AAEvE,SAASC,mBAAmB,QAAQ,cAAc;AAElD,SAASC,aAAa,QAAQ,UAAU;AACxC,OAAOC,QAAQ,IACbC,MAAM,EACNC,eAAe,EACfC,WAAW,EACXC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAOhC,MAAMC,uBAA8D,GAAGA,CAAC;EACtEC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,aAAa,GAAGL,cAAc,CAAC,CAAC,CAAC;EACvC,MAAMM,gBAAgB,GAAGd,mBAAmB,CAAC,CAAC;EAC9C,MAAMe,WAAW,GAAGlB,WAAW,CAAEmB,KAAgB,IAAK;IAAA,IAAAC,qBAAA;IACpD,OACE,EAAAA,qBAAA,GAAAD,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAF,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,iBAAiB,CAACC,QAAQ,cAAAJ,qBAAA,gBAAAA,qBAAA,GAAhDA,qBAAA,CAAmD,CAAC,CAAC,cAAAA,qBAAA,uBAArDA,qBAAA,CAAuDK,YAAY,MACnE3B,kBAAkB,CAAC4B,GAAG;EAE1B,CAAC,CAAC;EAEF,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;IAAA,IAAAC,kBAAA;IAChCb,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAG,CAAC;IACX,CAAAa,kB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d;EAAkB,gBAC1ChC,KAAA,CAAA6C,aAAA,CAACvC,QAAQ,CAACyC,IAAI;IACZC,WAAW,EAAE,KAAM;IACnBC,KAAK,EAAE,CAAC;MAAEC,WAAW,EAAE;IAAG,CAAC,EAAET,aAAa;EAAE,gBAE5CzC,KAAA,CAAA6C,aAAA,CAACxC,aAAa;IAAC8C,IAAI,EAAC;EAAU,CAAE,CACnB,CACA,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMC,sBAAsB,gBAAGpD,KAAK,CAACqD,IAAI,CAACvC,uBAAuB,CAAC","ignoreList":[]}
@@ -0,0 +1,276 @@
1
+ import React, { useRef } from 'react';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import Animated, { Easing, Extrapolation, interpolate, runOnJS, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
4
+ import { GestureDetector, Gesture } from 'react-native-gesture-handler';
5
+ import { HMSHLSPlayerPlaybackState, HMSHLSPlaylistType, useHMSHLSPlayerPlaybackState, useHMSHLSPlayerStat } from '@100mslive/react-native-hms';
6
+ import { useSelector } from 'react-redux';
7
+ import { useHLSStreamResumePause, useHLSViewsConstraints, useHMSRoomStyle } from '../hooks-util';
8
+ import { useIsHLSStreamingOn } from '../hooks-sdk';
9
+ export const _HLSSeekbar = props => {
10
+ const isHLSStreamingOn = useIsHLSStreamingOn();
11
+ const isDVRStream = useSelector(state => {
12
+ var _state$hmsStates$room;
13
+ return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room[0]) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.playlistType) === HMSHLSPlaylistType.DVR;
14
+ });
15
+ if (!isHLSStreamingOn || !isDVRStream) return null;
16
+ return /*#__PURE__*/React.createElement(_Seekbar, props);
17
+ };
18
+ const _Seekbar = /*#__PURE__*/React.memo(({
19
+ playerRef,
20
+ onStart,
21
+ onEnd
22
+ }) => {
23
+ const {
24
+ playerWrapperConstraints
25
+ } = useHLSViewsConstraints();
26
+ const hlsPlayerDurationDetails = useRef(null);
27
+ const prevSeekbarPositionValue = useSharedValue(0);
28
+ const seekbarPositionValue = useSharedValue(0);
29
+ const seekbarHeightValue = useSharedValue(4);
30
+ const streamStartedAt = useSelector(state => {
31
+ var _state$hmsStates$room2;
32
+ return (_state$hmsStates$room2 = state.hmsStates.room) === null || _state$hmsStates$room2 === void 0 || (_state$hmsStates$room2 = _state$hmsStates$room2.hlsStreamingState.variants) === null || _state$hmsStates$room2 === void 0 || (_state$hmsStates$room2 = _state$hmsStates$room2[0]) === null || _state$hmsStates$room2 === void 0 ? void 0 : _state$hmsStates$room2.startedAt;
33
+ });
34
+ const distanceFromLiveEdge = useHMSHLSPlayerStat('distanceFromLive');
35
+ const distanceFromLiveEdgeValue = useDerivedValue(() => distanceFromLiveEdge, [distanceFromLiveEdge]);
36
+ const seekbarRoomStyle = useHMSRoomStyle(theme => ({
37
+ backgroundColor: theme.palette.primary_default
38
+ }));
39
+ const {
40
+ isPaused,
41
+ pauseStream,
42
+ resumeStream
43
+ } = useHLSStreamResumePause(playerRef);
44
+ const seekToBarPosition = () => {
45
+ var _hlsPlayerDurationDet;
46
+ if (!streamStartedAt) return;
47
+ const liveStreamDuration = Date.now() - streamStartedAt.getTime();
48
+ const rollingWindowTime = (_hlsPlayerDurationDet = hlsPlayerDurationDetails.current) === null || _hlsPlayerDurationDet === void 0 ? void 0 : _hlsPlayerDurationDet.rollingWindowTime;
49
+ const durationOfStream = rollingWindowTime && liveStreamDuration >= rollingWindowTime ? rollingWindowTime : liveStreamDuration;
50
+
51
+ // console.log(
52
+ // '$$$ rolling window time > ',
53
+ // hlsPlayerDurationDetails.current?.rollingWindowTime
54
+ // );
55
+ // console.log('$$$ live stream duration > ', liveStreamDuration);
56
+ // console.log('$$$ current stream duration > ', durationOfStream);
57
+
58
+ const prevPosition = prevSeekbarPositionValue.value;
59
+ const currPosition = seekbarPositionValue.value;
60
+ const diff = currPosition - prevPosition;
61
+ const seekByMillis = durationOfStream / 100 * Math.abs(diff);
62
+ const seekBySecs = seekByMillis / 1000;
63
+ if (diff >= 0) {
64
+ var _playerRef$current;
65
+ (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 || _playerRef$current.seekForward(seekBySecs);
66
+ } else {
67
+ var _playerRef$current2;
68
+ (_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 || _playerRef$current2.seekBackward(seekBySecs);
69
+ }
70
+ resumeStream();
71
+ };
72
+ const activeSeekbarStyle = useAnimatedStyle(() => ({
73
+ width: interpolate(seekbarPositionValue.value, [0, 100], [0, playerWrapperConstraints.width], {
74
+ extrapolateLeft: Extrapolation.CLAMP,
75
+ extrapolateRight: Extrapolation.CLAMP
76
+ }),
77
+ height: seekbarHeightValue.value
78
+ }), [playerWrapperConstraints.width]);
79
+ const activeSeekbarThumbStyle = useAnimatedStyle(() => ({
80
+ width: seekbarHeightValue.value * 3,
81
+ height: seekbarHeightValue.value * 3,
82
+ borderRadius: seekbarHeightValue.value * 3 / 2,
83
+ bottom: -seekbarHeightValue.value,
84
+ left: -(seekbarHeightValue.value * 3) / 2,
85
+ transform: [{
86
+ translateX: interpolate(seekbarPositionValue.value, [0, 100], [0, playerWrapperConstraints.width], {
87
+ extrapolateLeft: Extrapolation.CLAMP,
88
+ extrapolateRight: Extrapolation.CLAMP
89
+ })
90
+ }]
91
+ }), [playerWrapperConstraints.width]);
92
+ const panGesture = Gesture.Pan().maxPointers(1).minPointers(1).hitSlop({
93
+ top: 12,
94
+ bottom: 12
95
+ }).onStart(e => {
96
+ 'worklet';
97
+
98
+ onStart();
99
+ runOnJS(pauseStream)();
100
+ prevSeekbarPositionValue.value = seekbarPositionValue.value;
101
+ seekbarPositionValue.value = interpolate(e.x, [0, playerWrapperConstraints.width], [0, 100], {
102
+ extrapolateLeft: Extrapolation.CLAMP,
103
+ extrapolateRight: Extrapolation.CLAMP
104
+ });
105
+ seekbarHeightValue.value = withTiming(6, {
106
+ duration: 160,
107
+ easing: Easing.linear
108
+ });
109
+ }).onUpdate(e => {
110
+ 'worklet';
111
+
112
+ seekbarPositionValue.value = interpolate(e.x, [0, playerWrapperConstraints.width], [0, 100], {
113
+ extrapolateLeft: Extrapolation.CLAMP,
114
+ extrapolateRight: Extrapolation.CLAMP
115
+ });
116
+ }).onEnd(() => {
117
+ 'worklet';
118
+
119
+ onEnd();
120
+ seekbarHeightValue.value = withTiming(4, {
121
+ duration: 160,
122
+ easing: Easing.linear
123
+ });
124
+ runOnJS(seekToBarPosition)();
125
+ });
126
+ React.useEffect(() => {
127
+ if (streamStartedAt && !isPaused) {
128
+ const intervalId = setInterval(() => {
129
+ var _hlsPlayerDurationDet2;
130
+ const liveStreamDuration = Date.now() - streamStartedAt.getTime();
131
+ const rollingWindowTime = (_hlsPlayerDurationDet2 = hlsPlayerDurationDetails.current) === null || _hlsPlayerDurationDet2 === void 0 ? void 0 : _hlsPlayerDurationDet2.rollingWindowTime;
132
+ const durationOfStream = rollingWindowTime && liveStreamDuration >= rollingWindowTime ? rollingWindowTime : liveStreamDuration;
133
+
134
+ // console.log(
135
+ // '$$$ rolling window time > ',
136
+ // hlsPlayerDurationDetails.current?.rollingWindowTime
137
+ // );
138
+ // console.log('$$$ live stream duration > ', liveStreamDuration);
139
+ // console.log('$$$ current stream duration > ', durationOfStream);
140
+
141
+ const currentPosition = durationOfStream - distanceFromLiveEdgeValue.value;
142
+
143
+ // console.log('currentPosition > ', currentPosition);
144
+
145
+ seekbarPositionValue.value = interpolate(currentPosition, [0, durationOfStream], [0, 100], {
146
+ extrapolateLeft: Extrapolation.CLAMP,
147
+ extrapolateRight: Extrapolation.CLAMP
148
+ });
149
+ }, 1000);
150
+ return () => {
151
+ clearInterval(intervalId);
152
+ };
153
+ }
154
+ }, [isPaused, streamStartedAt]);
155
+ let startedPlayingFirstTime = false;
156
+ let prevPlaybackState = HMSHLSPlayerPlaybackState.UNKNOWN;
157
+ const playbackState = useHMSHLSPlayerPlaybackState();
158
+ if (prevPlaybackState === HMSHLSPlayerPlaybackState.UNKNOWN && playbackState === HMSHLSPlayerPlaybackState.PLAYING) {
159
+ prevPlaybackState = playbackState;
160
+ startedPlayingFirstTime = true;
161
+ }
162
+ React.useEffect(() => {
163
+ if (startedPlayingFirstTime && playerRef.current) {
164
+ let mounted = true;
165
+ playerRef.current.getPlayerDurationDetails().then(data => {
166
+ if (mounted) {
167
+ console.log('$$$ getPlayerDurationDetails > ', data);
168
+ hlsPlayerDurationDetails.current = data;
169
+ if (typeof data.rollingWindowTime === 'number' && data.rollingWindowTime < 300000) {
170
+ hlsPlayerDurationDetails.current.rollingWindowTime = 300000;
171
+ }
172
+ }
173
+ }).catch(() => {});
174
+ return () => {
175
+ mounted = false;
176
+ };
177
+ }
178
+ }, [startedPlayingFirstTime]);
179
+ return /*#__PURE__*/React.createElement(GestureDetector, {
180
+ gesture: panGesture
181
+ }, /*#__PURE__*/React.createElement(View, {
182
+ collapsable: false,
183
+ hitSlop: {
184
+ top: 12,
185
+ bottom: 12
186
+ },
187
+ style: [styles.container, {
188
+ width: playerWrapperConstraints.width
189
+ }]
190
+ }, /*#__PURE__*/React.createElement(Animated.View, {
191
+ style: [styles.inactiveSeekbar, {
192
+ width: playerWrapperConstraints.width
193
+ }]
194
+ }, /*#__PURE__*/React.createElement(Animated.View, {
195
+ style: [styles.seekbar, seekbarRoomStyle, activeSeekbarStyle]
196
+ }), /*#__PURE__*/React.createElement(Animated.View, {
197
+ style: [styles.seekbarThumb, seekbarRoomStyle, activeSeekbarThumbStyle]
198
+ }))));
199
+ });
200
+ export const HLSSeekbar = /*#__PURE__*/React.memo(_HLSSeekbar);
201
+ const styles = StyleSheet.create({
202
+ container: {
203
+ height: 6,
204
+ justifyContent: 'flex-end'
205
+ },
206
+ inactiveSeekbar: {
207
+ position: 'relative',
208
+ backgroundColor: 'rgba(255, 255, 255, 0.25)'
209
+ },
210
+ seekbar: {
211
+ height: 4
212
+ },
213
+ seekbarThumb: {
214
+ position: 'absolute',
215
+ bottom: -4,
216
+ right: 0,
217
+ zIndex: 100
218
+ }
219
+ });
220
+
221
+ /**
222
+ *
223
+ *
224
+ *
225
+ *
226
+ *
227
+ *
228
+ *
229
+ *
230
+ *
231
+ * 200 -> 200 * 40%
232
+ *
233
+ * 180 - 33.33% = 60;
234
+ *
235
+ * currentStreamDuration * (diff in current and prev) * 100 / prev
236
+ *
237
+ * 0 |----------| 150
238
+ * prev = 135
239
+ *
240
+ * curr = 90
241
+ *
242
+ *
243
+ *
244
+ *
245
+ *
246
+ *
247
+ *
248
+ *
249
+ *
250
+ * //// 2 * 30 = 60
251
+ * 1.5 * 30 = 45
252
+ *
253
+ * 180
254
+ *
255
+ * 120
256
+ *
257
+ * 0 |------____| 100
258
+ *
259
+ *
260
+ * 200 * 40% = 80
261
+ *
262
+ * 200 * 30% = 60
263
+ *
264
+ *
265
+ * 30*90
266
+ *
267
+ * 0 |---------_| 100
268
+ * Prev = 90
269
+ * |------|
270
+ * Curr = 60
271
+ *
272
+ * 90 - 60 = 30
273
+ *
274
+ * seekbackward(80)
275
+ */
276
+ //# sourceMappingURL=HLSSeekbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","View","StyleSheet","Animated","Easing","Extrapolation","interpolate","runOnJS","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","GestureDetector","Gesture","HMSHLSPlayerPlaybackState","HMSHLSPlaylistType","useHMSHLSPlayerPlaybackState","useHMSHLSPlayerStat","useSelector","useHLSStreamResumePause","useHLSViewsConstraints","useHMSRoomStyle","useIsHLSStreamingOn","_HLSSeekbar","props","isHLSStreamingOn","isDVRStream","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","playlistType","DVR","createElement","_Seekbar","memo","playerRef","onStart","onEnd","playerWrapperConstraints","hlsPlayerDurationDetails","prevSeekbarPositionValue","seekbarPositionValue","seekbarHeightValue","streamStartedAt","_state$hmsStates$room2","startedAt","distanceFromLiveEdge","distanceFromLiveEdgeValue","seekbarRoomStyle","theme","backgroundColor","palette","primary_default","isPaused","pauseStream","resumeStream","seekToBarPosition","_hlsPlayerDurationDet","liveStreamDuration","Date","now","getTime","rollingWindowTime","current","durationOfStream","prevPosition","value","currPosition","diff","seekByMillis","Math","abs","seekBySecs","_playerRef$current","seekForward","_playerRef$current2","seekBackward","activeSeekbarStyle","width","extrapolateLeft","CLAMP","extrapolateRight","height","activeSeekbarThumbStyle","borderRadius","bottom","left","transform","translateX","panGesture","Pan","maxPointers","minPointers","hitSlop","top","e","x","duration","easing","linear","onUpdate","useEffect","intervalId","setInterval","_hlsPlayerDurationDet2","currentPosition","clearInterval","startedPlayingFirstTime","prevPlaybackState","UNKNOWN","playbackState","PLAYING","mounted","getPlayerDurationDetails","then","data","console","log","catch","gesture","collapsable","style","styles","container","inactiveSeekbar","seekbar","seekbarThumb","HLSSeekbar","create","justifyContent","position","right","zIndex"],"sourceRoot":"../../../src","sources":["components/HLSSeekbar.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,OAAOC,QAAQ,IACbC,MAAM,EACNC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,eAAe,EAAEC,OAAO,QAAQ,8BAA8B;AACvE,SACEC,yBAAyB,EACzBC,kBAAkB,EAClBC,4BAA4B,EAC5BC,mBAAmB,QACd,6BAA6B;AAKpC,SAASC,WAAW,QAAQ,aAAa;AAEzC,SACEC,uBAAuB,EACvBC,sBAAsB,EACtBC,eAAe,QACV,eAAe;AACtB,SAASC,mBAAmB,QAAQ,cAAc;AASlD,OAAO,MAAMC,WAAsC,GAAIC,KAAK,IAAK;EAC/D,MAAMC,gBAAgB,GAAG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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ import { HMSHLSPlaylistType, useIsHLSStreamLive } from '@100mslive/react-native-hms';
2
+ import * as React from 'react';
3
+ import { useSelector } from 'react-redux';
4
+ import { GestureDetector, Gesture } from 'react-native-gesture-handler';
5
+ import { useIsHLSStreamingOn } from '../hooks-sdk';
6
+ import { SeekArrowIcon } from '../Icons';
7
+ import Animated, { Easing, cancelAnimation, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
8
+ const _HLSSeekforwardControl = ({
9
+ playerRef,
10
+ onPress
11
+ }) => {
12
+ const animatedValue = useSharedValue(0);
13
+ const isHLSStreamingOn = useIsHLSStreamingOn();
14
+ const isDVRStream = useSelector(state => {
15
+ var _state$hmsStates$room;
16
+ return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room[0]) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.playlistType) === HMSHLSPlaylistType.DVR;
17
+ });
18
+ const isStreamLive = useIsHLSStreamLive();
19
+ const handdleSeekForward = () => {
20
+ var _playerRef$current;
21
+ onPress === null || onPress === void 0 || onPress();
22
+ (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 || _playerRef$current.seekForward(10);
23
+ };
24
+ const tapGestureHandler = React.useMemo(() => {
25
+ return Gesture.Tap().enabled(!isStreamLive).onStart(() => {
26
+ cancelAnimation(animatedValue);
27
+ animatedValue.value = withTiming(1, {
28
+ duration: 200,
29
+ easing: Easing.ease
30
+ }, finished => {
31
+ if (finished) {
32
+ animatedValue.value = withTiming(0, {
33
+ duration: 100,
34
+ easing: Easing.ease
35
+ });
36
+ }
37
+ });
38
+ runOnJS(handdleSeekForward)();
39
+ });
40
+ }, [isStreamLive]);
41
+ const animatedStyle = useAnimatedStyle(() => ({
42
+ opacity: interpolate(animatedValue.value, [0, 1], [1, 0.8]),
43
+ transform: [{
44
+ rotateZ: `${interpolate(animatedValue.value, [0, 1], [0, 17])} deg`
45
+ }]
46
+ }), []);
47
+ if (!isHLSStreamingOn || !isDVRStream) return null;
48
+ return /*#__PURE__*/React.createElement(GestureDetector, {
49
+ gesture: tapGestureHandler
50
+ }, /*#__PURE__*/React.createElement(Animated.View, {
51
+ collapsable: false,
52
+ style: [{
53
+ marginLeft: 24
54
+ }, animatedStyle]
55
+ }, /*#__PURE__*/React.createElement(SeekArrowIcon, {
56
+ style: {
57
+ opacity: isStreamLive ? 0.2 : 1
58
+ },
59
+ type: "forward"
60
+ })));
61
+ };
62
+ export const HLSSeekforwardControl = /*#__PURE__*/React.memo(_HLSSeekforwardControl);
63
+ //# sourceMappingURL=HLSSeekforwardControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HMSHLSPlaylistType","useIsHLSStreamLive","React","useSelector","GestureDetector","Gesture","useIsHLSStreamingOn","SeekArrowIcon","Animated","Easing","cancelAnimation","interpolate","runOnJS","useAnimatedStyle","useSharedValue","withTiming","_HLSSeekforwardControl","playerRef","onPress","animatedValue","isHLSStreamingOn","isDVRStream","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","playlistType","DVR","isStreamLive","handdleSeekForward","_playerRef$current","current","seekForward","tapGestureHandler","useMemo","Tap","enabled","onStart","value","duration","easing","ease","finished","animatedStyle","opacity","transform","rotateZ","createElement","gesture","View","collapsable","style","marginLeft","type","HLSSeekforwardControl","memo"],"sourceRoot":"../../../src","sources":["components/HLSSeekforwardControl.tsx"],"mappings":"AAAA,SACEA,kBAAkB,EAClBC,kBAAkB,QACb,6BAA6B;AAEpC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,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