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

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 (327) hide show
  1. package/lib/commonjs/HMSRoomSetup.js +8 -0
  2. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  3. package/lib/commonjs/Icons/Pause/assets/pause-med.png +0 -0
  4. package/lib/commonjs/Icons/Pause/assets/pause-med@2x.png +0 -0
  5. package/lib/commonjs/Icons/Pause/assets/pause-med@3x.png +0 -0
  6. package/lib/commonjs/Icons/Pause/index.js +35 -0
  7. package/lib/commonjs/Icons/Pause/index.js.map +1 -0
  8. package/lib/commonjs/Icons/Pencil/assets/pencil-board.png +0 -0
  9. package/lib/commonjs/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  10. package/lib/commonjs/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  11. package/lib/commonjs/Icons/Pencil/index.js +2 -1
  12. package/lib/commonjs/Icons/Pencil/index.js.map +1 -1
  13. package/lib/commonjs/Icons/Play/assets/play-med.png +0 -0
  14. package/lib/commonjs/Icons/Play/assets/play-med@2x.png +0 -0
  15. package/lib/commonjs/Icons/Play/assets/play-med@3x.png +0 -0
  16. package/lib/commonjs/Icons/Play/index.js +35 -0
  17. package/lib/commonjs/Icons/Play/index.js.map +1 -0
  18. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  19. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  20. package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  21. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  22. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  23. package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  24. package/lib/commonjs/Icons/SeekArrow/index.js +34 -0
  25. package/lib/commonjs/Icons/SeekArrow/index.js.map +1 -0
  26. package/lib/commonjs/Icons/index.js +33 -0
  27. package/lib/commonjs/Icons/index.js.map +1 -1
  28. package/lib/commonjs/components/DisplayView.js +2 -1
  29. package/lib/commonjs/components/DisplayView.js.map +1 -1
  30. package/lib/commonjs/components/Footer.js +1 -1
  31. package/lib/commonjs/components/Footer.js.map +1 -1
  32. package/lib/commonjs/components/FullScreenWhiteboard.js +58 -0
  33. package/lib/commonjs/components/FullScreenWhiteboard.js.map +1 -0
  34. package/lib/commonjs/components/GridView.js +6 -4
  35. package/lib/commonjs/components/GridView.js.map +1 -1
  36. package/lib/commonjs/components/HLSChatMessages.js +4 -5
  37. package/lib/commonjs/components/HLSChatMessages.js.map +1 -1
  38. package/lib/commonjs/components/HLSChatView.js +7 -2
  39. package/lib/commonjs/components/HLSChatView.js.map +1 -1
  40. package/lib/commonjs/components/HLSCloseMeetingControl.js +41 -0
  41. package/lib/commonjs/components/HLSCloseMeetingControl.js.map +1 -0
  42. package/lib/commonjs/components/HLSClosedCaptionControl.js +109 -0
  43. package/lib/commonjs/components/HLSClosedCaptionControl.js.map +1 -0
  44. package/lib/commonjs/components/HLSDistanceFromLive.js +56 -0
  45. package/lib/commonjs/components/HLSDistanceFromLive.js.map +1 -0
  46. package/lib/commonjs/components/HLSFullScreenControl.js +42 -0
  47. package/lib/commonjs/components/HLSFullScreenControl.js.map +1 -0
  48. package/lib/commonjs/components/HLSGoLiveControl.js +78 -0
  49. package/lib/commonjs/components/HLSGoLiveControl.js.map +1 -0
  50. package/lib/commonjs/components/HLSPlayPauseControl.js +62 -0
  51. package/lib/commonjs/components/HLSPlayPauseControl.js.map +1 -0
  52. package/lib/commonjs/components/HLSPlayer.js +82 -81
  53. package/lib/commonjs/components/HLSPlayer.js.map +1 -1
  54. package/lib/commonjs/components/HLSPlayerContainer.js +65 -3
  55. package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
  56. package/lib/commonjs/components/HLSPlayerControls.js +89 -46
  57. package/lib/commonjs/components/HLSPlayerControls.js.map +1 -1
  58. package/lib/commonjs/components/HLSSeekbackwardControl.js +67 -0
  59. package/lib/commonjs/components/HLSSeekbackwardControl.js.map +1 -0
  60. package/lib/commonjs/components/HLSSeekbar.js +285 -0
  61. package/lib/commonjs/components/HLSSeekbar.js.map +1 -0
  62. package/lib/commonjs/components/HLSSeekforwardControl.js +71 -0
  63. package/lib/commonjs/components/HLSSeekforwardControl.js.map +1 -0
  64. package/lib/commonjs/components/HMSHLSMessage.js +19 -41
  65. package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
  66. package/lib/commonjs/components/HMSHLSMessageList.js +2 -2
  67. package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
  68. package/lib/commonjs/components/HMSOverlayMessageView.js +150 -0
  69. package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -0
  70. package/lib/commonjs/components/MeetingScreenContent.js +22 -2
  71. package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
  72. package/lib/commonjs/components/Participants/ParticipantsList.js +4 -4
  73. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
  74. package/lib/commonjs/components/RoomSettingsModalContent.js +63 -6
  75. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  76. package/lib/commonjs/components/TilesContainer.js +4 -4
  77. package/lib/commonjs/components/TilesContainer.js.map +1 -1
  78. package/lib/commonjs/components/WebrtcView.js +2 -2
  79. package/lib/commonjs/components/WebrtcView.js.map +1 -1
  80. package/lib/commonjs/components/Whiteboard.js +72 -0
  81. package/lib/commonjs/components/Whiteboard.js.map +1 -0
  82. package/lib/commonjs/components/WhiteboardContainer.js +35 -0
  83. package/lib/commonjs/components/WhiteboardContainer.js.map +1 -0
  84. package/lib/commonjs/components/WhiteboardFullScreenButton.js +42 -0
  85. package/lib/commonjs/components/WhiteboardFullScreenButton.js.map +1 -0
  86. package/lib/commonjs/hooks-util.js +66 -8
  87. package/lib/commonjs/hooks-util.js.map +1 -1
  88. package/lib/commonjs/redux/actionTypes.js +5 -0
  89. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  90. package/lib/commonjs/redux/actions/index.js +22 -3
  91. package/lib/commonjs/redux/actions/index.js.map +1 -1
  92. package/lib/commonjs/redux/reducers/appState.js +17 -1
  93. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  94. package/lib/commonjs/redux/reducers/hmsStates.js +7 -1
  95. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
  96. package/lib/module/HMSRoomSetup.js +10 -2
  97. package/lib/module/HMSRoomSetup.js.map +1 -1
  98. package/lib/module/Icons/Pause/assets/pause-med.png +0 -0
  99. package/lib/module/Icons/Pause/assets/pause-med@2x.png +0 -0
  100. package/lib/module/Icons/Pause/assets/pause-med@3x.png +0 -0
  101. package/lib/module/Icons/Pause/index.js +27 -0
  102. package/lib/module/Icons/Pause/index.js.map +1 -0
  103. package/lib/module/Icons/Pencil/assets/pencil-board.png +0 -0
  104. package/lib/module/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  105. package/lib/module/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  106. package/lib/module/Icons/Pencil/index.js +2 -1
  107. package/lib/module/Icons/Pencil/index.js.map +1 -1
  108. package/lib/module/Icons/Play/assets/play-med.png +0 -0
  109. package/lib/module/Icons/Play/assets/play-med@2x.png +0 -0
  110. package/lib/module/Icons/Play/assets/play-med@3x.png +0 -0
  111. package/lib/module/Icons/Play/index.js +27 -0
  112. package/lib/module/Icons/Play/index.js.map +1 -0
  113. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  114. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  115. package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  116. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  117. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  118. package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  119. package/lib/module/Icons/SeekArrow/index.js +26 -0
  120. package/lib/module/Icons/SeekArrow/index.js.map +1 -0
  121. package/lib/module/Icons/index.js +3 -0
  122. package/lib/module/Icons/index.js.map +1 -1
  123. package/lib/module/components/DisplayView.js +2 -1
  124. package/lib/module/components/DisplayView.js.map +1 -1
  125. package/lib/module/components/Footer.js +1 -1
  126. package/lib/module/components/Footer.js.map +1 -1
  127. package/lib/module/components/FullScreenWhiteboard.js +48 -0
  128. package/lib/module/components/FullScreenWhiteboard.js.map +1 -0
  129. package/lib/module/components/GridView.js +6 -4
  130. package/lib/module/components/GridView.js.map +1 -1
  131. package/lib/module/components/HLSChatMessages.js +5 -6
  132. package/lib/module/components/HLSChatMessages.js.map +1 -1
  133. package/lib/module/components/HLSChatView.js +7 -2
  134. package/lib/module/components/HLSChatView.js.map +1 -1
  135. package/lib/module/components/HLSCloseMeetingControl.js +33 -0
  136. package/lib/module/components/HLSCloseMeetingControl.js.map +1 -0
  137. package/lib/module/components/HLSClosedCaptionControl.js +100 -0
  138. package/lib/module/components/HLSClosedCaptionControl.js.map +1 -0
  139. package/lib/module/components/HLSDistanceFromLive.js +48 -0
  140. package/lib/module/components/HLSDistanceFromLive.js.map +1 -0
  141. package/lib/module/components/HLSFullScreenControl.js +34 -0
  142. package/lib/module/components/HLSFullScreenControl.js.map +1 -0
  143. package/lib/module/components/HLSGoLiveControl.js +70 -0
  144. package/lib/module/components/HLSGoLiveControl.js.map +1 -0
  145. package/lib/module/components/HLSPlayPauseControl.js +54 -0
  146. package/lib/module/components/HLSPlayPauseControl.js.map +1 -0
  147. package/lib/module/components/HLSPlayer.js +83 -81
  148. package/lib/module/components/HLSPlayer.js.map +1 -1
  149. package/lib/module/components/HLSPlayerContainer.js +65 -3
  150. package/lib/module/components/HLSPlayerContainer.js.map +1 -1
  151. package/lib/module/components/HLSPlayerControls.js +89 -50
  152. package/lib/module/components/HLSPlayerControls.js.map +1 -1
  153. package/lib/module/components/HLSSeekbackwardControl.js +59 -0
  154. package/lib/module/components/HLSSeekbackwardControl.js.map +1 -0
  155. package/lib/module/components/HLSSeekbar.js +276 -0
  156. package/lib/module/components/HLSSeekbar.js.map +1 -0
  157. package/lib/module/components/HLSSeekforwardControl.js +63 -0
  158. package/lib/module/components/HLSSeekforwardControl.js.map +1 -0
  159. package/lib/module/components/HMSHLSMessage.js +19 -41
  160. package/lib/module/components/HMSHLSMessage.js.map +1 -1
  161. package/lib/module/components/HMSHLSMessageList.js +2 -2
  162. package/lib/module/components/HMSHLSMessageList.js.map +1 -1
  163. package/lib/module/components/HMSOverlayMessageView.js +142 -0
  164. package/lib/module/components/HMSOverlayMessageView.js.map +1 -0
  165. package/lib/module/components/MeetingScreenContent.js +23 -3
  166. package/lib/module/components/MeetingScreenContent.js.map +1 -1
  167. package/lib/module/components/Participants/ParticipantsList.js +4 -4
  168. package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
  169. package/lib/module/components/RoomSettingsModalContent.js +65 -8
  170. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  171. package/lib/module/components/TilesContainer.js +4 -4
  172. package/lib/module/components/TilesContainer.js.map +1 -1
  173. package/lib/module/components/WebrtcView.js +2 -2
  174. package/lib/module/components/WebrtcView.js.map +1 -1
  175. package/lib/module/components/Whiteboard.js +64 -0
  176. package/lib/module/components/Whiteboard.js.map +1 -0
  177. package/lib/module/components/WhiteboardContainer.js +27 -0
  178. package/lib/module/components/WhiteboardContainer.js.map +1 -0
  179. package/lib/module/components/WhiteboardFullScreenButton.js +33 -0
  180. package/lib/module/components/WhiteboardFullScreenButton.js.map +1 -0
  181. package/lib/module/hooks-util.js +66 -9
  182. package/lib/module/hooks-util.js.map +1 -1
  183. package/lib/module/redux/actionTypes.js +5 -0
  184. package/lib/module/redux/actionTypes.js.map +1 -1
  185. package/lib/module/redux/actions/index.js +16 -0
  186. package/lib/module/redux/actions/index.js.map +1 -1
  187. package/lib/module/redux/reducers/appState.js +17 -1
  188. package/lib/module/redux/reducers/appState.js.map +1 -1
  189. package/lib/module/redux/reducers/hmsStates.js +7 -1
  190. package/lib/module/redux/reducers/hmsStates.js.map +1 -1
  191. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  192. package/lib/typescript/Icons/Pause/index.d.ts +8 -0
  193. package/lib/typescript/Icons/Pause/index.d.ts.map +1 -0
  194. package/lib/typescript/Icons/Pencil/index.d.ts +1 -0
  195. package/lib/typescript/Icons/Pencil/index.d.ts.map +1 -1
  196. package/lib/typescript/Icons/Play/index.d.ts +8 -0
  197. package/lib/typescript/Icons/Play/index.d.ts.map +1 -0
  198. package/lib/typescript/Icons/SeekArrow/index.d.ts +8 -0
  199. package/lib/typescript/Icons/SeekArrow/index.d.ts.map +1 -0
  200. package/lib/typescript/Icons/index.d.ts +3 -0
  201. package/lib/typescript/Icons/index.d.ts.map +1 -1
  202. package/lib/typescript/components/CustomButton.d.ts +5 -5
  203. package/lib/typescript/components/CustomButton.d.ts.map +1 -1
  204. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  205. package/lib/typescript/components/Footer.d.ts.map +1 -1
  206. package/lib/typescript/components/FullScreenWhiteboard.d.ts +3 -0
  207. package/lib/typescript/components/FullScreenWhiteboard.d.ts.map +1 -0
  208. package/lib/typescript/components/GridView.d.ts.map +1 -1
  209. package/lib/typescript/components/HLSChatMessages.d.ts.map +1 -1
  210. package/lib/typescript/components/HLSChatView.d.ts.map +1 -1
  211. package/lib/typescript/components/HLSCloseMeetingControl.d.ts +8 -0
  212. package/lib/typescript/components/HLSCloseMeetingControl.d.ts.map +1 -0
  213. package/lib/typescript/components/HLSClosedCaptionControl.d.ts +10 -0
  214. package/lib/typescript/components/HLSClosedCaptionControl.d.ts.map +1 -0
  215. package/lib/typescript/components/HLSDistanceFromLive.d.ts +8 -0
  216. package/lib/typescript/components/HLSDistanceFromLive.d.ts.map +1 -0
  217. package/lib/typescript/components/HLSFullScreenControl.d.ts +8 -0
  218. package/lib/typescript/components/HLSFullScreenControl.d.ts.map +1 -0
  219. package/lib/typescript/components/HLSGoLiveControl.d.ts +10 -0
  220. package/lib/typescript/components/HLSGoLiveControl.d.ts.map +1 -0
  221. package/lib/typescript/components/HLSPlayPauseControl.d.ts +8 -0
  222. package/lib/typescript/components/HLSPlayPauseControl.d.ts.map +1 -0
  223. package/lib/typescript/components/HLSPlayer.d.ts +4 -2
  224. package/lib/typescript/components/HLSPlayer.d.ts.map +1 -1
  225. package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
  226. package/lib/typescript/components/HLSPlayerControls.d.ts +12 -2
  227. package/lib/typescript/components/HLSPlayerControls.d.ts.map +1 -1
  228. package/lib/typescript/components/HLSSeekbackwardControl.d.ts +8 -0
  229. package/lib/typescript/components/HLSSeekbackwardControl.d.ts.map +1 -0
  230. package/lib/typescript/components/HLSSeekbar.d.ts +66 -0
  231. package/lib/typescript/components/HLSSeekbar.d.ts.map +1 -0
  232. package/lib/typescript/components/HLSSeekforwardControl.d.ts +8 -0
  233. package/lib/typescript/components/HLSSeekforwardControl.d.ts.map +1 -0
  234. package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
  235. package/lib/typescript/components/HMSOverlayMessageView.d.ts +8 -0
  236. package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -0
  237. package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
  238. package/lib/typescript/components/Modals.d.ts +3 -3
  239. package/lib/typescript/components/Modals.d.ts.map +1 -1
  240. package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
  241. package/lib/typescript/components/Preview.d.ts.map +1 -1
  242. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  243. package/lib/typescript/components/TilesContainer.d.ts.map +1 -1
  244. package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
  245. package/lib/typescript/components/Whiteboard.d.ts +6 -0
  246. package/lib/typescript/components/Whiteboard.d.ts.map +1 -0
  247. package/lib/typescript/components/WhiteboardContainer.d.ts +6 -0
  248. package/lib/typescript/components/WhiteboardContainer.d.ts.map +1 -0
  249. package/lib/typescript/components/WhiteboardFullScreenButton.d.ts +5 -0
  250. package/lib/typescript/components/WhiteboardFullScreenButton.d.ts.map +1 -0
  251. package/lib/typescript/hooks-util.d.ts +12 -7
  252. package/lib/typescript/hooks-util.d.ts.map +1 -1
  253. package/lib/typescript/redux/actionTypes.d.ts +3 -0
  254. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  255. package/lib/typescript/redux/actions/index.d.ts +17 -1
  256. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  257. package/lib/typescript/redux/index.d.ts +19 -16
  258. package/lib/typescript/redux/index.d.ts.map +1 -1
  259. package/lib/typescript/redux/reducers/appState.d.ts +2 -0
  260. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  261. package/lib/typescript/redux/reducers/hmsStates.d.ts +7 -2
  262. package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
  263. package/lib/typescript/redux/reducers/index.d.ts +19 -16
  264. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  265. package/package.json +4 -3
  266. package/src/HMSRoomSetup.tsx +21 -0
  267. package/src/Icons/Pause/assets/pause-med.png +0 -0
  268. package/src/Icons/Pause/assets/pause-med@2x.png +0 -0
  269. package/src/Icons/Pause/assets/pause-med@3x.png +0 -0
  270. package/src/Icons/Pause/index.tsx +36 -0
  271. package/src/Icons/Pencil/assets/pencil-board.png +0 -0
  272. package/src/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  273. package/src/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  274. package/src/Icons/Pencil/index.tsx +9 -2
  275. package/src/Icons/Play/assets/play-med.png +0 -0
  276. package/src/Icons/Play/assets/play-med@2x.png +0 -0
  277. package/src/Icons/Play/assets/play-med@3x.png +0 -0
  278. package/src/Icons/Play/index.tsx +36 -0
  279. package/src/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
  280. package/src/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
  281. package/src/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
  282. package/src/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
  283. package/src/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
  284. package/src/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
  285. package/src/Icons/SeekArrow/index.tsx +40 -0
  286. package/src/Icons/index.ts +3 -0
  287. package/src/components/DisplayView.tsx +3 -0
  288. package/src/components/Footer.tsx +5 -2
  289. package/src/components/FullScreenWhiteboard.tsx +59 -0
  290. package/src/components/GridView.tsx +14 -5
  291. package/src/components/HLSChatMessages.tsx +4 -6
  292. package/src/components/HLSChatView.tsx +7 -4
  293. package/src/components/HLSCloseMeetingControl.tsx +39 -0
  294. package/src/components/HLSClosedCaptionControl.tsx +140 -0
  295. package/src/components/HLSDistanceFromLive.tsx +69 -0
  296. package/src/components/HLSFullScreenControl.tsx +46 -0
  297. package/src/components/HLSGoLiveControl.tsx +104 -0
  298. package/src/components/HLSPlayPauseControl.tsx +69 -0
  299. package/src/components/HLSPlayer.tsx +98 -88
  300. package/src/components/HLSPlayerContainer.tsx +89 -14
  301. package/src/components/HLSPlayerControls.tsx +137 -58
  302. package/src/components/HLSSeekbackwardControl.tsx +88 -0
  303. package/src/components/HLSSeekbar.tsx +381 -0
  304. package/src/components/HLSSeekforwardControl.tsx +97 -0
  305. package/src/components/HMSHLSMessage.tsx +32 -49
  306. package/src/components/HMSHLSMessageList.tsx +2 -2
  307. package/src/components/HMSOverlayMessageView.tsx +189 -0
  308. package/src/components/MeetingScreenContent.tsx +28 -2
  309. package/src/components/Participants/ParticipantsList.tsx +12 -10
  310. package/src/components/RoomSettingsModalContent.tsx +77 -2
  311. package/src/components/TilesContainer.tsx +7 -5
  312. package/src/components/WebrtcView.tsx +11 -4
  313. package/src/components/Whiteboard.tsx +101 -0
  314. package/src/components/WhiteboardContainer.tsx +35 -0
  315. package/src/components/WhiteboardFullScreenButton.tsx +52 -0
  316. package/src/hooks-util.ts +80 -10
  317. package/src/redux/actionTypes.ts +7 -0
  318. package/src/redux/actions/index.ts +16 -0
  319. package/src/redux/reducers/appState.ts +16 -0
  320. package/src/redux/reducers/hmsStates.ts +15 -1
  321. package/lib/commonjs/components/CustomHLSPlayerControls.js +0 -80
  322. package/lib/commonjs/components/CustomHLSPlayerControls.js.map +0 -1
  323. package/lib/module/components/CustomHLSPlayerControls.js +0 -72
  324. package/lib/module/components/CustomHLSPlayerControls.js.map +0 -1
  325. package/lib/typescript/components/CustomHLSPlayerControls.d.ts +0 -7
  326. package/lib/typescript/components/CustomHLSPlayerControls.d.ts.map +0 -1
  327. package/src/components/CustomHLSPlayerControls.tsx +0 -92
@@ -1,6 +1,5 @@
1
- import React, { useRef } from 'react';
2
- import type { ComponentRef } from 'react';
3
- import { useDispatch, useSelector } from 'react-redux';
1
+ import React from 'react';
2
+ import { useSelector } from 'react-redux';
4
3
  import {
5
4
  View,
6
5
  Text,
@@ -12,96 +11,53 @@ import {
12
11
  HMSHLSPlayer,
13
12
  HMSHLSPlayerPlaybackState,
14
13
  useHMSHLSPlayerPlaybackState,
14
+ useHMSHLSPlayerSubtitles,
15
15
  } from '@100mslive/react-native-hms';
16
16
 
17
17
  import type { RootState } from '../redux';
18
- import { changeShowHLSStats } from '../redux/actions';
19
- import { HLSPlayerStatsView } from './HLSPlayerStatsView';
18
+ // import { changeShowHLSStats } from '../redux/actions';
19
+ // import { HLSPlayerStatsView } from './HLSPlayerStatsView';
20
20
  import { HLSPlayerEmoticons } from './HLSPlayerEmoticons';
21
- import { CustomControls } from './CustomHLSPlayerControls';
22
21
  import { COLORS, hexToRgbA } from '../utils/theme';
23
22
  import { HMSHLSNotStarted } from './HMSHLSNotStarted';
24
23
  import { CrossCircleIcon } from '../Icons';
25
24
  import {
26
25
  useHLSPlayerConstraints,
26
+ useHLSViewsConstraints,
27
27
  useHMSRoomColorPalette,
28
28
  useHMSRoomStyleSheet,
29
29
  } from '../hooks-util';
30
30
  import { useIsHLSStreamingOn } from '../hooks-sdk';
31
+ import { HMSPinchGesture } from './PeerVideoTile/HMSPinchGesture';
31
32
 
32
- export const _HLSPlayer: React.FC = () => {
33
- const dispatch = useDispatch();
33
+ export interface HLSPlayerProps {}
34
+
35
+ export const _HLSPlayer = React.forwardRef<
36
+ React.ElementRef<typeof HMSHLSPlayer>,
37
+ HLSPlayerProps
38
+ >((_props, hlsPlayerRef) => {
39
+ // const dispatch = useDispatch();
34
40
  const isHLSStreaming = useIsHLSStreamingOn();
35
41
  const isStreamUrlPresent = useSelector(
36
42
  (state: RootState) =>
37
43
  !!state.hmsStates.room?.hlsStreamingState.variants?.[0]?.hlsStreamUrl
38
44
  );
39
- const hmsHlsPlayerRef = useRef<ComponentRef<typeof HMSHLSPlayer>>(null);
40
- const showHLSStats = useSelector(
41
- (state: RootState) => state.app.joinConfig.showHLSStats
42
- );
43
- const showCustomHLSPlayerControls = useSelector(
44
- (state: RootState) => state.app.joinConfig.showCustomHLSPlayerControls
45
- );
45
+ // const showHLSStats = useSelector(
46
+ // (state: RootState) => state.app.joinConfig.showHLSStats
47
+ // );
48
+ // const showCustomHLSPlayerControls = useSelector(
49
+ // (state: RootState) => state.app.joinConfig.showCustomHLSPlayerControls
50
+ // );
46
51
  const enableHLSPlayerControls = useSelector(
47
52
  (state: RootState) => state.app.joinConfig.enableHLSPlayerControls
48
53
  );
49
54
 
50
- const handleClosePress = () => {
51
- dispatch(changeShowHLSStats(false));
52
- };
53
-
54
- const hlsPlayerActions = <
55
- T extends
56
- | 'play'
57
- | 'stop'
58
- | 'pause'
59
- | 'resume'
60
- | 'seekForward'
61
- | 'seekBackward'
62
- | 'seekToLive'
63
- | 'setVolume',
64
- >(
65
- action: T,
66
- ...args: any[]
67
- ) => {
68
- switch (action) {
69
- case 'play': {
70
- hmsHlsPlayerRef.current?.play(args[0]);
71
- break;
72
- }
73
- case 'stop': {
74
- hmsHlsPlayerRef.current?.stop();
75
- break;
76
- }
77
- case 'pause': {
78
- hmsHlsPlayerRef.current?.pause();
79
- break;
80
- }
81
- case 'resume': {
82
- hmsHlsPlayerRef.current?.resume();
83
- break;
84
- }
85
- case 'seekForward': {
86
- hmsHlsPlayerRef.current?.seekForward(args[0]);
87
- break;
88
- }
89
- case 'seekBackward': {
90
- hmsHlsPlayerRef.current?.seekBackward(args[0]);
91
- break;
92
- }
93
- case 'seekToLive': {
94
- hmsHlsPlayerRef.current?.seekToLivePosition();
95
- break;
96
- }
97
- case 'setVolume': {
98
- hmsHlsPlayerRef.current?.setVolume(args[0]);
99
- break;
100
- }
101
- }
102
- };
55
+ // const handleClosePress = () => {
56
+ // dispatch(changeShowHLSStats(false));
57
+ // };
103
58
 
104
59
  const hlsPlayerConstraints = useHLSPlayerConstraints();
60
+ const { playerWrapperConstraints } = useHLSViewsConstraints();
105
61
  const [playerKey, setPlayerKey] = React.useState(1);
106
62
 
107
63
  const prevReconnectingRef = React.useRef<null | boolean>(null);
@@ -111,6 +67,8 @@ export const _HLSPlayer: React.FC = () => {
111
67
 
112
68
  const hlsPlayerPlaybackState = useHMSHLSPlayerPlaybackState();
113
69
 
70
+ const subtitles = useHMSHLSPlayerSubtitles();
71
+
114
72
  const isPlaybackFailed =
115
73
  hlsPlayerPlaybackState === HMSHLSPlayerPlaybackState.FAILED;
116
74
 
@@ -147,6 +105,10 @@ export const _HLSPlayer: React.FC = () => {
147
105
  color: theme.palette.alert_warning,
148
106
  fontFamily: `${typography.font_family}-SemiBold`,
149
107
  },
108
+ semiboldWhite: {
109
+ fontFamily: `${typography.font_family}-SemiBold`,
110
+ color: '#ffffff',
111
+ },
150
112
  }));
151
113
 
152
114
  const { primary_bright: PrimaryBrightColor } = useHMSRoomColorPalette();
@@ -164,26 +126,50 @@ export const _HLSPlayer: React.FC = () => {
164
126
 
165
127
  return (
166
128
  <>
167
- <HMSHLSPlayer
168
- key={playerKey}
169
- ref={hmsHlsPlayerRef}
170
- enableStats={showHLSStats}
171
- enableControls={enableHLSPlayerControls}
172
- style={{
173
- width: hlsPlayerConstraints.width,
174
- height: hlsPlayerConstraints.height,
175
- }}
176
- />
129
+ <View style={styles.container}>
130
+ <View
131
+ style={[
132
+ styles.playerAndCaptionWrapper,
133
+ {
134
+ width: playerWrapperConstraints.width,
135
+ height: hlsPlayerConstraints.height,
136
+ },
137
+ ]}
138
+ >
139
+ <HMSPinchGesture>
140
+ <View pointerEvents="none" style={styles.playerContainer}>
141
+ <HMSHLSPlayer
142
+ key={playerKey}
143
+ ref={hlsPlayerRef}
144
+ enableStats={true}
145
+ enableControls={enableHLSPlayerControls}
146
+ containerStyle={styles.playerContainer}
147
+ style={{
148
+ width: hlsPlayerConstraints.width,
149
+ height: hlsPlayerConstraints.height,
150
+ }}
151
+ />
152
+ </View>
153
+ </HMSPinchGesture>
154
+
155
+ <View
156
+ style={[
157
+ { width: playerWrapperConstraints.width - 48, left: 24 },
158
+ styles.closedCaptionsContainer,
159
+ ]}
160
+ >
161
+ <Text style={[styles.closedCaptions, hmsRoomStyles.semiboldWhite]}>
162
+ {subtitles}
163
+ </Text>
164
+ </View>
165
+ </View>
166
+ </View>
177
167
 
178
168
  <HLSPlayerEmoticons />
179
169
 
180
- {showHLSStats ? (
170
+ {/* {showHLSStats ? (
181
171
  <HLSPlayerStatsView onClosePress={handleClosePress} />
182
- ) : null}
183
-
184
- {showCustomHLSPlayerControls ? (
185
- <CustomControls handleControlPress={hlsPlayerActions} />
186
- ) : null}
172
+ ) : null} */}
187
173
 
188
174
  {isPlayerBuffering ? (
189
175
  <View
@@ -212,17 +198,25 @@ export const _HLSPlayer: React.FC = () => {
212
198
  ) : null}
213
199
  </>
214
200
  );
215
- };
201
+ });
216
202
 
217
203
  export const HLSPlayer = React.memo(_HLSPlayer);
218
204
 
219
205
  const styles = StyleSheet.create({
220
- hlsView: {
206
+ container: {
221
207
  flex: 1,
208
+ alignItems: 'center',
209
+ justifyContent: 'center',
222
210
  },
223
- hlsPlayerContainer: {
224
- // flex: 1,
211
+ playerAndCaptionWrapper: {
225
212
  position: 'relative',
213
+ alignItems: 'center',
214
+ justifyContent: 'center',
215
+ },
216
+ playerContainer: {
217
+ flex: undefined,
218
+ alignItems: 'flex-start',
219
+ justifyContent: 'flex-start',
226
220
  },
227
221
  textContainer: {
228
222
  flex: 1,
@@ -236,6 +230,22 @@ const styles = StyleSheet.create({
236
230
  letterSpacing: 0.25,
237
231
  textAlign: 'center',
238
232
  },
233
+ closedCaptionsContainer: {
234
+ position: 'absolute',
235
+ bottom: 4,
236
+ paddingHorizontal: 8,
237
+ paddingVertical: 4,
238
+ alignItems: 'center',
239
+ justifyContent: 'center',
240
+ },
241
+ closedCaptions: {
242
+ fontSize: 14,
243
+ lineHeight: 16,
244
+ textAlign: 'center',
245
+ textShadowColor: 'rgba(0, 0, 0, 0.8)',
246
+ textShadowRadius: 3,
247
+ textShadowOffset: { width: 1, height: 1 },
248
+ },
239
249
  playbackFailedContainer: {
240
250
  flex: 1,
241
251
  width: '100%',
@@ -1,29 +1,104 @@
1
1
  import React from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
+ import { useSelector } from 'react-redux';
4
+ import type { HMSHLSPlayer } from '@100mslive/react-native-hms';
5
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
6
+ import {
7
+ Easing,
8
+ cancelAnimation,
9
+ useSharedValue,
10
+ withDelay,
11
+ withTiming,
12
+ } from 'react-native-reanimated';
3
13
 
4
14
  import { useHLSViewsConstraints } from '../hooks-util';
5
15
  import { HLSPlayer } from './HLSPlayer';
6
16
  import { HLSPlayerControls } from './HLSPlayerControls';
17
+ import { PipModes } from '../utils/types';
18
+ import type { RootState } from '../redux';
7
19
 
8
20
  export const _HLSPlayerContainer: React.FC = () => {
9
- // const hlsPlayerRef = useRef(null);
21
+ const hlsPlayerRef =
22
+ React.useRef<React.ElementRef<typeof HMSHLSPlayer>>(null);
10
23
  const { playerWrapperConstraints } = useHLSViewsConstraints();
24
+ const isPipModeActive = useSelector(
25
+ (state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
26
+ );
27
+
28
+ const animatedValue = useSharedValue(1);
29
+
30
+ const cancelCurrentControlAnimation = React.useCallback(() => {
31
+ 'worklet';
32
+ cancelAnimation(animatedValue);
33
+ }, []);
34
+
35
+ const hideControlsAfterDelay = React.useCallback((duration = 500) => {
36
+ 'worklet';
37
+ animatedValue.value = withDelay(
38
+ 5000,
39
+ withTiming(0, { duration, easing: Easing.ease })
40
+ );
41
+ }, []);
42
+
43
+ const resetHideControlAnimation = React.useCallback(() => {
44
+ cancelCurrentControlAnimation();
45
+ hideControlsAfterDelay();
46
+ }, [cancelCurrentControlAnimation, hideControlsAfterDelay]);
47
+
48
+ const hideControls = React.useCallback((duration = 500) => {
49
+ 'worklet';
50
+ animatedValue.value = withTiming(0, { duration, easing: Easing.ease });
51
+ }, []);
52
+
53
+ React.useEffect(() => {
54
+ resetHideControlAnimation();
55
+ }, [resetHideControlAnimation]);
56
+
57
+ const tapGesture = React.useMemo(() => {
58
+ return Gesture.Tap().onStart(() => {
59
+ cancelCurrentControlAnimation();
60
+ if (animatedValue.value < 1) {
61
+ animatedValue.value = withTiming(
62
+ 1,
63
+ { duration: 200, easing: Easing.ease },
64
+ (finished) => {
65
+ if (finished) {
66
+ hideControlsAfterDelay();
67
+ }
68
+ }
69
+ );
70
+ } else {
71
+ hideControls(200);
72
+ }
73
+ });
74
+ }, [cancelCurrentControlAnimation, hideControls, hideControlsAfterDelay]);
11
75
 
12
76
  return (
13
- <View
14
- style={[
15
- styles.hlsPlayerContainer,
16
- {
17
- backgroundColor: 'black',
18
- width: playerWrapperConstraints.width,
19
- height: playerWrapperConstraints.height,
20
- },
21
- ]}
22
- >
23
- <HLSPlayer />
77
+ <GestureDetector gesture={tapGesture}>
78
+ <View
79
+ collapsable={false}
80
+ style={[
81
+ styles.hlsPlayerContainer,
82
+ {
83
+ backgroundColor: 'black',
84
+ width: playerWrapperConstraints.width,
85
+ height: playerWrapperConstraints.height,
86
+ },
87
+ ]}
88
+ >
89
+ <HLSPlayer ref={hlsPlayerRef} />
24
90
 
25
- <HLSPlayerControls />
26
- </View>
91
+ {isPipModeActive ? null : (
92
+ <HLSPlayerControls
93
+ playerRef={hlsPlayerRef}
94
+ animatedValue={animatedValue}
95
+ cancelCurrentControlAnimation={cancelCurrentControlAnimation}
96
+ hideControlsAfterDelay={hideControlsAfterDelay}
97
+ resetHideControlAnimation={resetHideControlAnimation}
98
+ />
99
+ )}
100
+ </View>
101
+ </GestureDetector>
27
102
  );
28
103
  };
29
104
 
@@ -1,85 +1,164 @@
1
1
  import React from 'react';
2
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
3
- import { useDispatch, useSelector } from 'react-redux';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import type { ViewProps, ViewStyle } from 'react-native';
4
+ import { useSelector } from 'react-redux';
5
+ import Animated, {
6
+ useAnimatedProps,
7
+ useAnimatedStyle,
8
+ } from 'react-native-reanimated';
9
+ import type { SharedValue } from 'react-native-reanimated';
10
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
11
+ import type { HMSHLSPlayer } from '@100mslive/react-native-hms';
4
12
 
5
- import {
6
- // CCIcon,
7
- CloseIcon,
8
- MaximizeIcon,
9
- MinimizeIcon,
10
- } from '../Icons';
11
- import { ModalTypes } from '../utils/types';
12
- import { useModalType } from '../hooks-util';
13
13
  import type { RootState } from '../redux';
14
- import { setHlsFullScreen } from '../redux/actions';
14
+ import { HLSGoLiveControl } from './HLSGoLiveControl';
15
+ import { HLSSeekbar } from './HLSSeekbar';
16
+ import { useIsLandscapeOrientation } from '../utils/dimension';
17
+ import { HLSCloseMeetingControl } from './HLSCloseMeetingControl';
18
+ import { HLSClosedCaptionControl } from './HLSClosedCaptionControl';
19
+ import { HLSFullScreenControl } from './HLSFullScreenControl';
20
+ import { HLSDistanceFromLive } from './HLSDistanceFromLive';
21
+ import { HLSPlayPauseControl } from './HLSPlayPauseControl';
22
+ import { HLSSeekbackwardControl } from './HLSSeekbackwardControl';
23
+ import { HLSSeekforwardControl } from './HLSSeekforwardControl';
15
24
 
16
- export const _HLSPlayerControls: React.FC = () => {
17
- // const isHLSStreaming = useIsHLSStreamingOn();
18
- // const isStreamUrlPresent = useSelector(
19
- // (state: RootState) =>
20
- // !!state.hmsStates.room?.hlsStreamingState.variants?.[0]?.hlsStreamUrl
21
- // );
22
- const dispatch = useDispatch();
25
+ interface HLSPlayerControlsProps {
26
+ playerRef: React.RefObject<React.ElementRef<typeof HMSHLSPlayer>>;
27
+ cancelCurrentControlAnimation: () => void;
28
+ hideControlsAfterDelay: () => void;
29
+ resetHideControlAnimation: () => void;
30
+ animatedValue: SharedValue<number>;
31
+ }
32
+
33
+ export const _HLSPlayerControls: React.FC<HLSPlayerControlsProps> = ({
34
+ playerRef,
35
+ cancelCurrentControlAnimation,
36
+ hideControlsAfterDelay,
37
+ animatedValue,
38
+ resetHideControlAnimation,
39
+ }) => {
40
+ const { bottom: bottomSafeInset } = useSafeAreaInsets();
41
+ const isLandscapeOrientation = useIsLandscapeOrientation();
23
42
  const hlsFullScreen = useSelector(
24
43
  (state: RootState) => state.app.hlsFullScreen
25
44
  );
26
- const { handleModalVisibleType } = useModalType();
27
-
28
- const handleCloseBtnPress = () => {
29
- handleModalVisibleType(ModalTypes.LEAVE_ROOM);
30
- };
31
45
 
32
- // const handleCCBtnPress = () => {
33
- // //
34
- // };
46
+ const hideControlsStyles: ViewStyle = useAnimatedStyle(
47
+ () => ({
48
+ opacity: animatedValue.value,
49
+ }),
50
+ []
51
+ );
35
52
 
36
- const toggleFullScreen = () => {
37
- dispatch(setHlsFullScreen(!hlsFullScreen));
38
- };
53
+ const hideControlsProps: ViewProps = useAnimatedProps(
54
+ () => ({
55
+ pointerEvents: animatedValue.value < 0.8 ? 'none' : 'auto',
56
+ }),
57
+ []
58
+ );
39
59
 
40
60
  return (
41
- <View style={styles.container}>
42
- <View style={styles.controlsRow}>
43
- <TouchableOpacity onPress={handleCloseBtnPress} style={styles.icon}>
44
- <CloseIcon size="medium" />
45
- </TouchableOpacity>
61
+ <React.Fragment>
62
+ {/* Play/Pause Controls */}
63
+ <Animated.View
64
+ animatedProps={hideControlsProps}
65
+ style={[
66
+ { height: '100%' },
67
+ styles.floatingContainer,
68
+ hideControlsStyles,
69
+ ]}
70
+ >
71
+ <View
72
+ style={{
73
+ flex: 1,
74
+ flexDirection: 'row',
75
+ alignItems: 'center',
76
+ justifyContent: 'center',
77
+ }}
78
+ >
79
+ <HLSSeekbackwardControl
80
+ playerRef={playerRef}
81
+ onPress={resetHideControlAnimation}
82
+ />
83
+
84
+ <HLSPlayPauseControl
85
+ playerRef={playerRef}
86
+ onPress={resetHideControlAnimation}
87
+ />
46
88
 
47
- {/* <View style={[styles.normalRow, styles.gap]}>
48
- <TouchableOpacity
49
- onPress={handleCCBtnPress}
50
- style={[styles.icon, styles.gap]}
51
- >
52
- <CCIcon size="medium" enabled={true} />
53
- </TouchableOpacity>
54
- </View> */}
55
- </View>
89
+ <HLSSeekforwardControl
90
+ playerRef={playerRef}
91
+ onPress={resetHideControlAnimation}
92
+ />
93
+ </View>
94
+ </Animated.View>
56
95
 
57
- <View style={styles.controlsRow}>
58
- <View />
96
+ {/* Header Controls */}
97
+ <Animated.View
98
+ animatedProps={hideControlsProps}
99
+ style={[{ top: 0 }, styles.floatingContainer, hideControlsStyles]}
100
+ >
101
+ <View style={styles.controlsRow}>
102
+ <HLSCloseMeetingControl onPress={resetHideControlAnimation} />
59
103
 
60
- <View style={[styles.normalRow, styles.gap]}>
61
- <TouchableOpacity onPress={toggleFullScreen} style={styles.icon}>
62
- {hlsFullScreen ? (
63
- <MinimizeIcon size="medium" />
64
- ) : (
65
- <MaximizeIcon size="medium" />
66
- )}
67
- </TouchableOpacity>
104
+ <View style={[styles.normalRow, styles.gap]}>
105
+ <HLSClosedCaptionControl
106
+ playerRef={playerRef}
107
+ onPress={resetHideControlAnimation}
108
+ />
109
+ </View>
68
110
  </View>
69
- </View>
70
- </View>
111
+ </Animated.View>
112
+
113
+ {/* Footer Controls */}
114
+ <Animated.View
115
+ animatedProps={hideControlsProps}
116
+ style={[
117
+ { bottom: isLandscapeOrientation ? bottomSafeInset : 0 },
118
+ styles.floatingContainer,
119
+ hideControlsStyles,
120
+ ]}
121
+ >
122
+ <View
123
+ style={{
124
+ flexDirection:
125
+ isLandscapeOrientation || hlsFullScreen
126
+ ? 'column-reverse'
127
+ : 'column',
128
+ }}
129
+ >
130
+ <View style={styles.controlsRow}>
131
+ <View style={styles.normalRow}>
132
+ <HLSGoLiveControl
133
+ playerRef={playerRef}
134
+ onPress={resetHideControlAnimation}
135
+ />
136
+ <HLSDistanceFromLive />
137
+ </View>
138
+
139
+ <View style={[styles.normalRow, styles.gap]}>
140
+ <HLSFullScreenControl onPress={resetHideControlAnimation} />
141
+ </View>
142
+ </View>
143
+
144
+ <HLSSeekbar
145
+ playerRef={playerRef}
146
+ onStart={cancelCurrentControlAnimation}
147
+ onEnd={hideControlsAfterDelay}
148
+ />
149
+ </View>
150
+ </Animated.View>
151
+ </React.Fragment>
71
152
  );
72
153
  };
73
154
 
74
155
  export const HLSPlayerControls = React.memo(_HLSPlayerControls);
75
156
 
76
157
  const styles = StyleSheet.create({
77
- container: {
158
+ floatingContainer: {
78
159
  position: 'absolute',
79
160
  width: '100%',
80
- height: '100%',
81
161
  zIndex: 5,
82
- justifyContent: 'space-between',
83
162
  },
84
163
  controlsRow: {
85
164
  flexDirection: 'row',
@@ -0,0 +1,88 @@
1
+ import { HMSHLSPlaylistType } from '@100mslive/react-native-hms';
2
+ import type { HMSHLSPlayer } from '@100mslive/react-native-hms';
3
+ import * as React from 'react';
4
+ import { useSelector } from 'react-redux';
5
+ import { GestureDetector, Gesture } from 'react-native-gesture-handler';
6
+
7
+ import { useIsHLSStreamingOn } from '../hooks-sdk';
8
+ import type { RootState } from '../redux';
9
+ import { SeekArrowIcon } from '../Icons';
10
+ import Animated, {
11
+ Easing,
12
+ cancelAnimation,
13
+ interpolate,
14
+ runOnJS,
15
+ useAnimatedStyle,
16
+ useSharedValue,
17
+ withTiming,
18
+ } from 'react-native-reanimated';
19
+
20
+ export interface HLSSeekbackwardControlProps {
21
+ playerRef: React.RefObject<React.ElementRef<typeof HMSHLSPlayer>>;
22
+ onPress?: () => void;
23
+ }
24
+
25
+ const _HLSSeekbackwardControl: React.FC<HLSSeekbackwardControlProps> = ({
26
+ playerRef,
27
+ onPress,
28
+ }) => {
29
+ const animatedValue = useSharedValue(0);
30
+ const isHLSStreamingOn = useIsHLSStreamingOn();
31
+ const isDVRStream = useSelector((state: RootState) => {
32
+ return (
33
+ state.hmsStates.room?.hlsStreamingState.variants?.[0]?.playlistType ===
34
+ HMSHLSPlaylistType.DVR
35
+ );
36
+ });
37
+
38
+ const handdleSeekBackward = () => {
39
+ onPress?.();
40
+ playerRef.current?.seekBackward(10);
41
+ };
42
+
43
+ const tapGestureHandler = React.useMemo(() => {
44
+ return Gesture.Tap().onStart(() => {
45
+ cancelAnimation(animatedValue);
46
+ animatedValue.value = withTiming(
47
+ 1,
48
+ { duration: 200, easing: Easing.ease },
49
+ (finished) => {
50
+ if (finished) {
51
+ animatedValue.value = withTiming(0, {
52
+ duration: 100,
53
+ easing: Easing.ease,
54
+ });
55
+ }
56
+ }
57
+ );
58
+ runOnJS(handdleSeekBackward)();
59
+ });
60
+ }, []);
61
+
62
+ const animatedStyle = useAnimatedStyle(
63
+ () => ({
64
+ opacity: interpolate(animatedValue.value, [0, 1], [1, 0.8]),
65
+ transform: [
66
+ {
67
+ rotateZ: `${interpolate(animatedValue.value, [0, 1], [0, -17])} deg`,
68
+ },
69
+ ],
70
+ }),
71
+ []
72
+ );
73
+
74
+ if (!isHLSStreamingOn || !isDVRStream) return null;
75
+
76
+ return (
77
+ <GestureDetector gesture={tapGestureHandler}>
78
+ <Animated.View
79
+ collapsable={false}
80
+ style={[{ marginRight: 24 }, animatedStyle]}
81
+ >
82
+ <SeekArrowIcon type="backward" />
83
+ </Animated.View>
84
+ </GestureDetector>
85
+ );
86
+ };
87
+
88
+ export const HLSSeekbackwardControl = React.memo(_HLSSeekbackwardControl);