@zezosoft/zezo-ott-react-native-ui-kit 1.1.0 → 1.1.1

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 (178) hide show
  1. package/lib/module/components/BottomSheet/BottomSheet.js +152 -0
  2. package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -0
  3. package/lib/module/components/BottomSheet/index.js +4 -0
  4. package/lib/module/components/BottomSheet/index.js.map +1 -0
  5. package/lib/module/components/Button/BackBtn.js +28 -2
  6. package/lib/module/components/Button/BackBtn.js.map +1 -1
  7. package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js +134 -0
  8. package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js.map +1 -0
  9. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js +154 -0
  10. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js.map +1 -0
  11. package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js +173 -0
  12. package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js.map +1 -0
  13. package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js +77 -0
  14. package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js.map +1 -0
  15. package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js +132 -0
  16. package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js.map +1 -0
  17. package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js +165 -0
  18. package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js.map +1 -0
  19. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js +106 -0
  20. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js.map +1 -0
  21. package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js +124 -0
  22. package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js.map +1 -0
  23. package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js +102 -64
  24. package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js.map +1 -1
  25. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js +241 -232
  26. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js.map +1 -1
  27. package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js +153 -0
  28. package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js.map +1 -0
  29. package/lib/module/components/Reels/ReelsSeries/{Model → components}/Episodes.js +46 -36
  30. package/lib/module/components/Reels/ReelsSeries/components/Episodes.js.map +1 -0
  31. package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js +35 -0
  32. package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js.map +1 -0
  33. package/lib/module/components/Reels/ReelsSeries/components/Like.js +37 -0
  34. package/lib/module/components/Reels/ReelsSeries/components/Like.js.map +1 -0
  35. package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js +55 -0
  36. package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js.map +1 -0
  37. package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js +268 -0
  38. package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js.map +1 -0
  39. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js +143 -0
  40. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js.map +1 -0
  41. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js +56 -0
  42. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js.map +1 -0
  43. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js +5 -0
  44. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js.map +1 -0
  45. package/lib/module/components/Reels/utils/Controls/gestureUtils.js +30 -0
  46. package/lib/module/components/Reels/utils/Controls/gestureUtils.js.map +1 -0
  47. package/lib/module/components/Reels/utils/Controls/index.js +7 -0
  48. package/lib/module/components/Reels/utils/Controls/index.js.map +1 -0
  49. package/lib/module/components/Reels/utils/Controls/overlayUtils.js +28 -0
  50. package/lib/module/components/Reels/utils/Controls/overlayUtils.js.map +1 -0
  51. package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js +27 -0
  52. package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js.map +1 -0
  53. package/lib/module/components/Reels/utils/Controls/videoRef.js +5 -0
  54. package/lib/module/components/Reels/utils/Controls/videoRef.js.map +1 -0
  55. package/lib/module/components/Reels/utils/index.js +4 -0
  56. package/lib/module/components/Reels/utils/index.js.map +1 -0
  57. package/lib/module/components/Reels/utils/timeoutUtils.js +24 -0
  58. package/lib/module/components/Reels/utils/timeoutUtils.js.map +1 -0
  59. package/lib/module/components/index.js +1 -0
  60. package/lib/module/components/index.js.map +1 -1
  61. package/lib/module/theme/ThemeProvider.js +7 -4
  62. package/lib/module/theme/ThemeProvider.js.map +1 -1
  63. package/lib/module/theme/themes.js +3 -3
  64. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +18 -0
  65. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
  66. package/lib/typescript/src/components/BottomSheet/index.d.ts +3 -0
  67. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
  68. package/lib/typescript/src/components/Button/BackBtn.d.ts +3 -1
  69. package/lib/typescript/src/components/Button/BackBtn.d.ts.map +1 -1
  70. package/lib/typescript/src/components/Button/index.d.ts +2 -0
  71. package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
  72. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts +14 -0
  73. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts.map +1 -0
  74. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts +60 -0
  75. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts.map +1 -0
  76. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts +14 -0
  77. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts.map +1 -0
  78. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts +14 -0
  79. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts.map +1 -0
  80. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts +12 -0
  81. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts.map +1 -0
  82. package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts +16 -0
  83. package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts.map +1 -0
  84. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts +15 -0
  85. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts.map +1 -0
  86. package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts +14 -0
  87. package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts.map +1 -0
  88. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts +8 -2
  89. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts.map +1 -1
  90. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts +8 -2
  91. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts.map +1 -1
  92. package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts +13 -0
  93. package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts.map +1 -0
  94. package/lib/typescript/src/components/Reels/ReelsSeries/{Model → components}/Episodes.d.ts +3 -2
  95. package/lib/typescript/src/components/Reels/ReelsSeries/components/Episodes.d.ts.map +1 -0
  96. package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts +7 -0
  97. package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts.map +1 -0
  98. package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts +7 -0
  99. package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts.map +1 -0
  100. package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts +12 -0
  101. package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts.map +1 -0
  102. package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts +12 -0
  103. package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts.map +1 -0
  104. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts +11 -0
  105. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts.map +1 -0
  106. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts +10 -0
  107. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts.map +1 -0
  108. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts +3 -0
  109. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts.map +1 -0
  110. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts +13 -0
  111. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts.map +1 -1
  112. package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts +10 -0
  113. package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts.map +1 -0
  114. package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts +5 -0
  115. package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts.map +1 -0
  116. package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts +12 -0
  117. package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts.map +1 -0
  118. package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts +24 -0
  119. package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts.map +1 -0
  120. package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts +3 -0
  121. package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts.map +1 -0
  122. package/lib/typescript/src/components/Reels/utils/index.d.ts +2 -0
  123. package/lib/typescript/src/components/Reels/utils/index.d.ts.map +1 -0
  124. package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts +14 -0
  125. package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts.map +1 -0
  126. package/lib/typescript/src/components/index.d.ts +1 -0
  127. package/lib/typescript/src/components/index.d.ts.map +1 -1
  128. package/package.json +1 -1
  129. package/src/components/BottomSheet/BottomSheet.tsx +195 -0
  130. package/src/components/BottomSheet/index.ts +2 -0
  131. package/src/components/Button/BackBtn.tsx +33 -0
  132. package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +156 -0
  133. package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +234 -0
  134. package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +196 -0
  135. package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +92 -0
  136. package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +163 -0
  137. package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +210 -0
  138. package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +143 -0
  139. package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +154 -0
  140. package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +142 -74
  141. package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +349 -250
  142. package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +184 -0
  143. package/src/components/Reels/ReelsSeries/{Model → components}/Episodes.tsx +54 -33
  144. package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +41 -0
  145. package/src/components/Reels/ReelsSeries/components/Like.tsx +40 -0
  146. package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +79 -0
  147. package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +332 -0
  148. package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +190 -0
  149. package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +80 -0
  150. package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +2 -0
  151. package/src/components/Reels/ReelsSeries/types.ts +13 -2
  152. package/src/components/Reels/utils/Controls/gestureUtils.ts +42 -0
  153. package/src/components/Reels/utils/Controls/index.ts +4 -0
  154. package/src/components/Reels/utils/Controls/overlayUtils.ts +35 -0
  155. package/src/components/Reels/utils/Controls/videoControlsConstants.ts +25 -0
  156. package/src/components/Reels/utils/Controls/videoRef.ts +4 -0
  157. package/src/components/Reels/utils/index.ts +1 -0
  158. package/src/components/Reels/utils/timeoutUtils.ts +29 -0
  159. package/src/components/index.ts +1 -0
  160. package/src/theme/ThemeProvider.tsx +8 -2
  161. package/src/theme/themes.ts +3 -3
  162. package/lib/module/components/Reels/ReelsSeries/Model/Episodes.js.map +0 -1
  163. package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js +0 -212
  164. package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js.map +0 -1
  165. package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js +0 -182
  166. package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js.map +0 -1
  167. package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js +0 -203
  168. package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js.map +0 -1
  169. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Episodes.d.ts.map +0 -1
  170. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts +0 -9
  171. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts.map +0 -1
  172. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts +0 -13
  173. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts.map +0 -1
  174. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts +0 -18
  175. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts.map +0 -1
  176. package/src/components/Reels/ReelsSeries/Model/Synopsis.tsx +0 -242
  177. package/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.tsx +0 -209
  178. package/src/components/Reels/ReelsSeries/ReelSeriesOverlay.tsx +0 -185
@@ -0,0 +1,234 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+
4
+ import GradientOverlay from '../../ReelsSeries/components/GradientOverlay';
5
+ import Like from '../../ReelsSeries/components/Like';
6
+
7
+ import type {
8
+ ISeriesItem,
9
+ ISeriesEpisode,
10
+ ModalState,
11
+ ILikeMoreData,
12
+ } from '../types';
13
+ import type { ITheme } from '../../../../theme';
14
+
15
+ import TopControls from './TopControls';
16
+ import MiddleControls from './MiddleControls';
17
+ import RightControls from './RightControls';
18
+ import BottomControls from './BottomControls';
19
+ import DetailsModal from '../Model/DetailsModal';
20
+ import UnLockModal from '../Model/UnlockModal';
21
+ import SettingModal from '../Model/SettingModal';
22
+
23
+ export interface ContentProps {
24
+ series: ISeriesItem;
25
+ episode: ISeriesEpisode;
26
+ activeIndex: number;
27
+ }
28
+ export interface UnlockProps {
29
+ isVisible: boolean;
30
+ onClose: () => void;
31
+ }
32
+
33
+ export interface VideoProps {
34
+ currentTime: number;
35
+ duration: number;
36
+ paused: boolean;
37
+ buffering: boolean;
38
+ showCenterControls: boolean;
39
+ isLocked: boolean;
40
+ hasError: boolean;
41
+ }
42
+
43
+ export interface LikeProps {
44
+ liked: boolean;
45
+ count: number;
46
+ showAnimation: boolean;
47
+ }
48
+
49
+ export interface ActionsProps {
50
+ onLike?: (ep: ISeriesEpisode) => void;
51
+ onUnlockPress?: (ep: ISeriesEpisode) => void;
52
+ onEpisodeSelect?: (ep: ISeriesEpisode) => void;
53
+ onLikeMore?: (item: ILikeMoreData) => void;
54
+ onShare?: () => void;
55
+ onUnLock?: () => void;
56
+ }
57
+
58
+ export interface NavigationProps {
59
+ onBack?: () => void;
60
+ onSearch?: () => void;
61
+ }
62
+
63
+ export interface SettingsProps {
64
+ playbackRate: number;
65
+ quality: string;
66
+ onPlaybackRateChange: (rate: number) => void;
67
+ onQualityChange: (q: string) => void;
68
+ }
69
+
70
+ export interface MediaControlsProps {
71
+ children: React.ReactNode;
72
+ content: ContentProps;
73
+ video: VideoProps;
74
+ likes: LikeProps;
75
+ actions: ActionsProps;
76
+ navigation: NavigationProps;
77
+ settings: SettingsProps;
78
+ modal?: ModalState;
79
+ setModal?: (m: ModalState) => void;
80
+ unlock: UnlockProps;
81
+ theme: ITheme;
82
+ }
83
+
84
+ const MediaControlsProvider: React.FC<MediaControlsProps> = ({
85
+ children,
86
+ content,
87
+ video,
88
+ likes,
89
+ actions,
90
+ navigation,
91
+ settings,
92
+ modal,
93
+ unlock,
94
+ setModal,
95
+ theme,
96
+ }) => {
97
+ const { series, episode, activeIndex } = content;
98
+ const isSeries = series?.episodes ? true : false;
99
+
100
+ const {
101
+ currentTime,
102
+ duration,
103
+ paused,
104
+ buffering,
105
+ showCenterControls,
106
+ isLocked,
107
+ hasError,
108
+ } = video;
109
+
110
+ const { liked, count, showAnimation } = likes;
111
+
112
+ const {
113
+ onLike,
114
+ onEpisodeSelect,
115
+ onLikeMore,
116
+ onUnlockPress,
117
+ onShare,
118
+ onUnLock,
119
+ } = actions;
120
+
121
+ const { onBack, onSearch } = navigation;
122
+
123
+ const { playbackRate, quality, onPlaybackRateChange, onQualityChange } =
124
+ settings;
125
+
126
+ const episodeLabel = React.useMemo(() => {
127
+ return series.episodes.length > 0
128
+ ? `Ep ${activeIndex + 1}/${series.episodes.length}`
129
+ : undefined;
130
+ }, [activeIndex, series.episodes.length]);
131
+
132
+ return (
133
+ <View style={styles.root}>
134
+ {/* ❤️ Like Animation */}
135
+ <Like visible={showAnimation} />
136
+
137
+ {/* Video behind controls */}
138
+ {children}
139
+
140
+ {/* Gradient overlay */}
141
+ <GradientOverlay />
142
+
143
+ {/* UI Controls */}
144
+ <View style={StyleSheet.absoluteFillObject}>
145
+ {/* TOP */}
146
+ <TopControls
147
+ theme={theme}
148
+ onBack={onBack}
149
+ episodeLabel={episodeLabel}
150
+ onSettings={() => setModal?.({ type: 'settings', isVisible: true })}
151
+ onSearch={onSearch}
152
+ />
153
+
154
+ {/* CENTER */}
155
+ <MiddleControls
156
+ isLocked={isLocked}
157
+ theme={theme}
158
+ onUnLock={onUnLock}
159
+ isVisible={showCenterControls}
160
+ isPaused={paused}
161
+ isBuffering={buffering}
162
+ hasError={hasError}
163
+ />
164
+
165
+ {/* RIGHT ACTIONS */}
166
+ <RightControls
167
+ episode={episode}
168
+ isLiked={liked}
169
+ likeCount={count}
170
+ onLike={onLike}
171
+ showEpisodesButton={isSeries}
172
+ onDetailsPress={() =>
173
+ setModal?.({ type: 'details', isVisible: true })
174
+ }
175
+ onShare={onShare}
176
+ />
177
+
178
+ <BottomControls
179
+ theme={theme}
180
+ series={series}
181
+ episodeIndex={activeIndex}
182
+ videoCurrentTime={currentTime}
183
+ videoDuration={duration}
184
+ onEpisodesPress={() =>
185
+ setModal?.({ type: 'details', isVisible: true })
186
+ }
187
+ />
188
+ </View>
189
+
190
+ {/* DETAILS MODAL */}
191
+ {isSeries && (
192
+ <DetailsModal
193
+ reel={episode}
194
+ data={series}
195
+ activeEpisodeIndex={activeIndex}
196
+ theme={theme}
197
+ isVisible={modal?.type === 'details' && modal.isVisible}
198
+ onClose={() => setModal?.({ type: 'none', isVisible: false })}
199
+ onEpisodeSelect={onEpisodeSelect}
200
+ onLikeMorePress={onLikeMore}
201
+ />
202
+ )}
203
+
204
+ {/* SETTINGS MODAL */}
205
+ <SettingModal
206
+ theme={theme}
207
+ speed={playbackRate}
208
+ quality={quality}
209
+ videoUrl={episode.videoUrl}
210
+ onSpeedChange={onPlaybackRateChange}
211
+ onQualityChange={onQualityChange}
212
+ isVisible={modal?.type === 'settings' && modal.isVisible}
213
+ onClose={() => setModal?.({ type: 'none', isVisible: false })}
214
+ />
215
+
216
+ <UnLockModal
217
+ isVisible={unlock.isVisible}
218
+ onClose={() => unlock.onClose()}
219
+ theme={theme}
220
+ episode={episode}
221
+ data={series}
222
+ onUnlockPress={onUnlockPress}
223
+ />
224
+ </View>
225
+ );
226
+ };
227
+
228
+ export default MediaControlsProvider;
229
+
230
+ const styles = StyleSheet.create({
231
+ root: {
232
+ flex: 1,
233
+ },
234
+ });
@@ -0,0 +1,196 @@
1
+ import React from 'react';
2
+ import { View, StyleSheet, Text } from 'react-native';
3
+ import { Pause, Play, AlertCircle } from 'lucide-react-native';
4
+ import { moderateScale, verticalScale } from 'react-native-size-matters';
5
+ import { RFValue } from 'react-native-responsive-fontsize';
6
+ import RotatingLoader from '../../ReelsSeries/components/RotatingLoader';
7
+ import { Button } from '../../../Button';
8
+ import type { ITheme } from '../../../../theme';
9
+
10
+ interface MiddleControlsProps {
11
+ isVisible: boolean;
12
+ isPaused: boolean;
13
+ isBuffering: boolean;
14
+ isLocked: boolean;
15
+ hasError: boolean;
16
+ onUnLock?: () => void;
17
+ theme: ITheme;
18
+ }
19
+
20
+ const MiddleControls: React.FC<MiddleControlsProps> = ({
21
+ isVisible,
22
+ isPaused,
23
+ isBuffering,
24
+ isLocked,
25
+ hasError,
26
+ onUnLock,
27
+ theme,
28
+ }) => {
29
+ if (!isVisible) return null;
30
+
31
+ return (
32
+ <View style={styles.container} pointerEvents="box-none">
33
+ {/* ERROR MESSAGE */}
34
+ {hasError && !isBuffering && (
35
+ <View style={styles.errorWrapper}>
36
+ <View style={styles.errorContainer}>
37
+ <View style={styles.errorIconContainer}>
38
+ <AlertCircle
39
+ color={styles.errorIconColor.color}
40
+ size={moderateScale(28)}
41
+ strokeWidth={2.5}
42
+ />
43
+ </View>
44
+ <Text style={styles.errorText}>Unable to play video</Text>
45
+ <Text style={styles.errorSubtext}>Please try again later</Text>
46
+ </View>
47
+ </View>
48
+ )}
49
+
50
+ {/* BUFFERING LOADER */}
51
+ {isBuffering && !hasError && (
52
+ <View style={styles.loaderWrapper}>
53
+ <RotatingLoader
54
+ color={theme.colors.buttonText}
55
+ containerStyle={[
56
+ styles.loadingContainer,
57
+ { backgroundColor: theme.colors.button },
58
+ ]}
59
+ autoRotate={isBuffering}
60
+ />
61
+ </View>
62
+ )}
63
+
64
+ {/* PLAY / PAUSE ICON */}
65
+ {!isBuffering && !isLocked && !hasError && (
66
+ <View style={styles.iconWrapper}>
67
+ <View
68
+ style={[
69
+ styles.iconBackground,
70
+ { backgroundColor: theme.colors.button },
71
+ ]}
72
+ pointerEvents="none"
73
+ >
74
+ {isPaused ? (
75
+ <Play color={theme.colors.buttonText} size={moderateScale(26)} />
76
+ ) : (
77
+ <Pause color={theme.colors.buttonText} size={moderateScale(26)} />
78
+ )}
79
+ </View>
80
+ </View>
81
+ )}
82
+
83
+ {/* LOCKED → SHOW UNLOCK BUTTON */}
84
+ {!isBuffering && isLocked && !hasError && (
85
+ <View style={styles.unlockWrapper}>
86
+ <Button.Primary
87
+ title="Unlock Episode"
88
+ onPress={onUnLock}
89
+ theme={{
90
+ dark: theme.colors,
91
+ light: theme.colors,
92
+ }}
93
+ containerStyle={styles.unlockButton}
94
+ />
95
+ </View>
96
+ )}
97
+ </View>
98
+ );
99
+ };
100
+
101
+ export default MiddleControls;
102
+
103
+ /* ---------------------- STYLES ---------------------- */
104
+
105
+ const styles = StyleSheet.create({
106
+ container: {
107
+ position: 'absolute',
108
+ height: '100%',
109
+ width: '100%',
110
+ justifyContent: 'center',
111
+ alignItems: 'center',
112
+ zIndex: 5,
113
+ },
114
+
115
+ /* BUFFERING */
116
+ loaderWrapper: {
117
+ justifyContent: 'center',
118
+ alignItems: 'center',
119
+ },
120
+ loadingContainer: {
121
+ // backgroundColor: 'rgba(0,0,0,0.5)',
122
+ padding: moderateScale(8),
123
+ borderRadius: 50,
124
+ },
125
+
126
+ /* PLAY/PAUSE */
127
+ iconWrapper: {
128
+ justifyContent: 'center',
129
+ alignItems: 'center',
130
+ },
131
+ iconBackground: {
132
+ // backgroundColor: 'rgba(0,0,0,0.55)',
133
+ padding: moderateScale(12),
134
+ borderRadius: 50,
135
+ },
136
+
137
+ /* UNLOCK */
138
+ unlockWrapper: {
139
+ justifyContent: 'center',
140
+ alignItems: 'center',
141
+ },
142
+ unlockButton: {
143
+ paddingVertical: moderateScale(12),
144
+ paddingHorizontal: moderateScale(20),
145
+ borderRadius: moderateScale(30),
146
+ },
147
+
148
+ /* ERROR */
149
+ errorWrapper: {
150
+ justifyContent: 'center',
151
+ alignItems: 'center',
152
+ },
153
+ errorContainer: {
154
+ backgroundColor: 'rgba(21, 21, 21, 0.95)',
155
+ padding: moderateScale(20),
156
+ borderRadius: moderateScale(16),
157
+ alignItems: 'center',
158
+ minWidth: moderateScale(220),
159
+ borderWidth: 2,
160
+ borderColor: '#FF4444',
161
+ shadowColor: '#FF4444',
162
+ shadowOffset: {
163
+ width: 0,
164
+ height: 4,
165
+ },
166
+ shadowOpacity: 0.5,
167
+ shadowRadius: 12,
168
+ elevation: 10,
169
+ },
170
+ errorIconContainer: {
171
+ width: moderateScale(56),
172
+ height: moderateScale(56),
173
+ borderRadius: moderateScale(28),
174
+ backgroundColor: 'rgba(255, 68, 68, 0.15)',
175
+ justifyContent: 'center',
176
+ alignItems: 'center',
177
+ marginBottom: verticalScale(8),
178
+ },
179
+ errorIconColor: {
180
+ color: '#FF4444',
181
+ },
182
+ errorText: {
183
+ fontSize: RFValue(16),
184
+ fontWeight: '700',
185
+ marginTop: verticalScale(8),
186
+ textAlign: 'center',
187
+ letterSpacing: 0.3,
188
+ color: '#FFFFFF',
189
+ },
190
+ errorSubtext: {
191
+ fontSize: RFValue(13),
192
+ marginTop: verticalScale(6),
193
+ textAlign: 'center',
194
+ color: 'rgba(255, 255, 255, 0.75)',
195
+ },
196
+ });
@@ -0,0 +1,92 @@
1
+ import React from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3
+ import { Heart, Forward, ListVideo } from 'lucide-react-native';
4
+ import { moderateScale, verticalScale } from 'react-native-size-matters';
5
+ import { RFValue } from 'react-native-responsive-fontsize';
6
+ import type { ISeriesEpisode } from '../types';
7
+
8
+ interface RightControlsProps {
9
+ episode: ISeriesEpisode;
10
+ isLiked: boolean;
11
+ likeCount: number;
12
+
13
+ onLike?: (item: ISeriesEpisode) => void;
14
+ onDetailsPress?: () => void;
15
+ onShare?: () => void;
16
+
17
+ showEpisodesButton?: boolean;
18
+ }
19
+
20
+ const RightControls: React.FC<RightControlsProps> = ({
21
+ episode,
22
+ isLiked,
23
+ likeCount,
24
+ onLike,
25
+ onShare,
26
+ onDetailsPress,
27
+ showEpisodesButton = true,
28
+ }) => {
29
+ return (
30
+ <View style={styles.container}>
31
+ {/* ❤️ Like */}
32
+ <TouchableOpacity
33
+ style={styles.actionButton}
34
+ onPress={() => onLike?.(episode)}
35
+ activeOpacity={0.7}
36
+ >
37
+ <Heart
38
+ size={moderateScale(26)}
39
+ color={isLiked ? 'red' : '#fff'}
40
+ fill={isLiked ? 'red' : 'none'}
41
+ />
42
+ <Text style={styles.actionLabel}>{likeCount}</Text>
43
+ </TouchableOpacity>
44
+
45
+ {/* 📺 Episodes / Details */}
46
+ {showEpisodesButton && (
47
+ <TouchableOpacity
48
+ style={styles.actionButton}
49
+ onPress={onDetailsPress}
50
+ activeOpacity={0.7}
51
+ >
52
+ <ListVideo color={'#fff'} size={moderateScale(26)} />
53
+ <Text style={styles.actionLabel}>Episodes</Text>
54
+ </TouchableOpacity>
55
+ )}
56
+
57
+ {/* 📤 Share */}
58
+ {onShare && (
59
+ <TouchableOpacity
60
+ style={styles.actionButton}
61
+ onPress={onShare}
62
+ activeOpacity={0.7}
63
+ >
64
+ <Forward color={'#fff'} size={moderateScale(26)} />
65
+ <Text style={styles.actionLabel}>Share</Text>
66
+ </TouchableOpacity>
67
+ )}
68
+ </View>
69
+ );
70
+ };
71
+
72
+ export default RightControls;
73
+
74
+ const styles = StyleSheet.create({
75
+ container: {
76
+ position: 'absolute',
77
+ bottom: verticalScale(120),
78
+ right: moderateScale(10),
79
+ flexDirection: 'column',
80
+ zIndex: 20,
81
+ },
82
+ actionButton: {
83
+ marginVertical: verticalScale(10),
84
+ alignItems: 'center',
85
+ },
86
+ actionLabel: {
87
+ marginTop: verticalScale(4),
88
+ fontSize: RFValue(10),
89
+ color: '#fff',
90
+ textAlign: 'center',
91
+ },
92
+ });
@@ -0,0 +1,163 @@
1
+ import React from 'react';
2
+ import { View, TouchableOpacity, StyleSheet, Alert } from 'react-native';
3
+ import { ArrowLeft, Search, Settings } from 'lucide-react-native';
4
+ import { scale, verticalScale } from 'react-native-size-matters';
5
+ import type { ITheme } from '../../../../theme';
6
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
+ import { Text } from '../../../Text';
8
+
9
+ interface TopControlsProps {
10
+ theme: ITheme;
11
+ episodeLabel?: string;
12
+ onBack?: () => void;
13
+ onSearch?: () => void;
14
+ onSettings?: () => void;
15
+ }
16
+
17
+ type BackBtnProps = {
18
+ size?: number;
19
+ color?: string;
20
+ onPress?: () => void;
21
+ theme: ITheme;
22
+ enableBlur?: boolean;
23
+ label?: string;
24
+ };
25
+ const BackBtn: React.FC<BackBtnProps> = ({
26
+ size = scale(24),
27
+ color,
28
+ onPress,
29
+ theme,
30
+ label,
31
+ }) => {
32
+ const handlePress = () => {
33
+ if (onPress) {
34
+ onPress();
35
+ } else {
36
+ Alert.alert(
37
+ 'Back Action Not Provided',
38
+ 'Please define the back action using onPress prop.'
39
+ );
40
+ }
41
+ };
42
+ const hasLabel = !!label;
43
+ return (
44
+ <TouchableOpacity
45
+ activeOpacity={0.8}
46
+ style={styles.backButton}
47
+ onPress={handlePress}
48
+ >
49
+ <ArrowLeft size={size} color={color || theme.colors.textPrimary} />
50
+ {hasLabel && (
51
+ <Text
52
+ style={[styles.text, { color: color || theme.colors.textPrimary }]}
53
+ color={color || theme.colors.textPrimary}
54
+ >
55
+ {label}
56
+ </Text>
57
+ )}
58
+ </TouchableOpacity>
59
+ );
60
+ };
61
+
62
+ const TopControls: React.FC<TopControlsProps> = ({
63
+ theme,
64
+ episodeLabel,
65
+ onBack,
66
+ onSearch,
67
+ onSettings,
68
+ }) => {
69
+ const insets = useSafeAreaInsets();
70
+ const top = insets.top;
71
+ return (
72
+ <View
73
+ style={[
74
+ styles.container,
75
+ {
76
+ top,
77
+ paddingLeft: scale(16),
78
+ paddingRight: scale(16),
79
+ },
80
+ ]}
81
+ >
82
+ {/* Back Button with Episode Number */}
83
+ <View style={styles.leftContainer}>
84
+ {onBack && (
85
+ <BackBtn
86
+ theme={theme}
87
+ onPress={onBack}
88
+ color={theme.colors.white}
89
+ size={scale(20)}
90
+ label={episodeLabel}
91
+ />
92
+ )}
93
+ </View>
94
+
95
+ {/* Right Side Controls Container */}
96
+ <View style={styles.rightControlsContainer}>
97
+ {/* Search Button */}
98
+ {onSearch && (
99
+ <TouchableOpacity
100
+ style={styles.iconButton}
101
+ onPress={onSearch}
102
+ activeOpacity={0.7}
103
+ >
104
+ <Search color={theme.colors.white} size={verticalScale(22)} />
105
+ </TouchableOpacity>
106
+ )}
107
+
108
+ {/* Video Controls Button */}
109
+ <TouchableOpacity
110
+ style={styles.iconButton}
111
+ onPress={onSettings}
112
+ activeOpacity={0.7}
113
+ >
114
+ <Settings color={theme.colors.white} size={verticalScale(22)} />
115
+ </TouchableOpacity>
116
+ </View>
117
+ </View>
118
+ );
119
+ };
120
+
121
+ export default TopControls;
122
+
123
+ const styles = StyleSheet.create({
124
+ container: {
125
+ position: 'absolute',
126
+ top: 0,
127
+ left: 0,
128
+ right: 0,
129
+ flexDirection: 'row',
130
+ justifyContent: 'space-between',
131
+ alignItems: 'center',
132
+ zIndex: 10,
133
+ },
134
+ leftContainer: {
135
+ flex: 1,
136
+ flexDirection: 'row',
137
+ alignItems: 'center',
138
+ },
139
+ backButton: {
140
+ flexDirection: 'row',
141
+ alignItems: 'center',
142
+ paddingVertical: verticalScale(8),
143
+ paddingHorizontal: scale(4),
144
+ },
145
+ rightControlsContainer: {
146
+ flexDirection: 'row',
147
+ alignItems: 'center',
148
+ justifyContent: 'flex-end',
149
+ },
150
+ iconButton: {
151
+ padding: scale(8),
152
+ justifyContent: 'center',
153
+ alignItems: 'center',
154
+ },
155
+ text: {
156
+ fontSize: scale(14),
157
+ fontWeight: '600',
158
+ marginLeft: scale(8),
159
+ textShadowColor: 'rgba(0, 0, 0, 0.75)',
160
+ textShadowOffset: { width: 0, height: verticalScale(1) },
161
+ textShadowRadius: scale(3),
162
+ },
163
+ });