@zezosoft/zezo-ott-react-native-ui-kit 1.1.5 → 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.
- package/lib/module/components/Content/Card/Sliders/Styles/Three.js +5 -4
- package/lib/module/components/Content/Card/Sliders/Styles/Three.js.map +1 -1
- package/lib/module/components/Headers/Four.js +1 -1
- package/lib/module/components/Headers/Three.js +2 -1
- package/lib/module/components/Headers/Three.js.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/Three.d.ts.map +1 -1
- package/package.json +2 -14
- package/src/Styles/globalStyles.ts +0 -70
- package/src/assets/animations/135037-payment-processing-error.json +0 -1347
- package/src/assets/animations/7227-vui-animation.json +0 -3377
- package/src/assets/animations/Failed.json +0 -2103
- package/src/assets/animations/Pending.json +0 -522
- package/src/assets/animations/Successful.json +0 -2289
- package/src/assets/animations/heart.json +0 -788
- package/src/assets/animations/succesfull-payment.json +0 -2379
- package/src/assets/animations/voice-icon.json +0 -542
- package/src/assets/img/back.png +0 -0
- package/src/assets/img/bottom-panel.png +0 -0
- package/src/assets/img/camera.png +0 -0
- package/src/assets/img/camera2.png +0 -0
- package/src/assets/img/home.png +0 -0
- package/src/assets/img/lock.png +0 -0
- package/src/assets/img/play.png +0 -0
- package/src/assets/img/profile.jpg +0 -0
- package/src/assets/img/qr-code.png +0 -0
- package/src/assets/img/shadow.png +0 -0
- package/src/assets/img/shadow2.png +0 -0
- package/src/assets/img/user.png +0 -0
- package/src/assets/svg/Account.svg +0 -4
- package/src/assets/svg/Favourite.svg +0 -14
- package/src/assets/svg/Upcoming.svg +0 -4
- package/src/assets/svg/content-error.svg +0 -28
- package/src/assets/svg/download.svg +0 -3
- package/src/assets/svg/eye-off.svg +0 -10
- package/src/assets/svg/favorites.svg +0 -3
- package/src/assets/svg/h.svg +0 -4
- package/src/assets/svg/home.svg +0 -5
- package/src/assets/svg/home1.svg +0 -3
- package/src/assets/svg/menu-bar.svg +0 -4
- package/src/assets/svg/my-space.svg +0 -14
- package/src/assets/svg/play-icon-with-bg.svg +0 -5
- package/src/assets/svg/profile.svg +0 -4
- package/src/assets/svg/search.svg +0 -5
- package/src/assets/svg/search1.svg +0 -4
- package/src/assets/svg/server-error.svg +0 -139
- package/src/components/Account/Account.tsx +0 -367
- package/src/components/Account/index.ts +0 -1
- package/src/components/Alert/AlertDialog.tsx +0 -247
- package/src/components/Alert/UAAlert.tsx +0 -170
- package/src/components/Alert/index.ts +0 -2
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -419
- package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -324
- package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -455
- package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -306
- package/src/components/Auth/One/OTP/OTP.tsx +0 -465
- package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/One/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/One/SignUp/SignUp.tsx +0 -479
- package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -249
- package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -103
- package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -174
- package/src/components/Auth/One/index.ts +0 -24
- package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -108
- package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -335
- package/src/components/Auth/Two/Login/AuthLoginShell.tsx +0 -173
- package/src/components/Auth/Two/Login/LoginWithEmail.tsx +0 -279
- package/src/components/Auth/Two/Login/LoginWithPhone.tsx +0 -188
- package/src/components/Auth/Two/OTP/OTP.tsx +0 -465
- package/src/components/Auth/Two/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/Two/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -472
- package/src/components/Auth/Two/SplashScreen/SplashScreen.tsx +0 -248
- package/src/components/Auth/Two/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
- package/src/components/Auth/Two/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/Two/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -178
- package/src/components/Auth/Two/index.ts +0 -28
- package/src/components/Auth/index.ts +0 -11
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +0 -174
- package/src/components/BackgroundLayout/BackgroundLayoutOne.tsx +0 -56
- package/src/components/BlogView/BlogView.tsx +0 -276
- package/src/components/BlogView/index.ts +0 -8
- package/src/components/BlurView/BlurView.tsx +0 -199
- package/src/components/BlurView/index.ts +0 -7
- package/src/components/BottomSheet/BottomSheet.tsx +0 -200
- package/src/components/BottomSheet/BottomSheetOne.tsx +0 -220
- package/src/components/BottomSheet/index.ts +0 -4
- package/src/components/Button/BackBtn.tsx +0 -168
- package/src/components/Button/MenuBtn.tsx +0 -229
- package/src/components/Button/PrimaryBtn.tsx +0 -134
- package/src/components/Button/SecondaryBtn.tsx +0 -132
- package/src/components/Button/TextButton.tsx +0 -145
- package/src/components/Button/index.ts +0 -18
- package/src/components/Content/Card/Category/Category.tsx +0 -436
- package/src/components/Content/Card/Category/CategroyTwo.tsx +0 -429
- package/src/components/Content/Card/NowWatching/NowWatching.tsx +0 -624
- package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
- package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -935
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -391
- package/src/components/Content/Card/Sliders/index.ts +0 -17
- package/src/components/Content/Card/Styles/Five.tsx +0 -385
- package/src/components/Content/Card/Styles/Four.tsx +0 -379
- package/src/components/Content/Card/Styles/One.tsx +0 -386
- package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
- package/src/components/Content/Card/Styles/Six.tsx +0 -392
- package/src/components/Content/Card/Styles/Three.tsx +0 -314
- package/src/components/Content/Card/Styles/TopTen.tsx +0 -412
- package/src/components/Content/Card/Styles/Two.tsx +0 -416
- package/src/components/Content/Card/components/AdsPoster.tsx +0 -202
- package/src/components/Content/Card/components/CardPoster.tsx +0 -377
- package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -129
- package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
- package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -234
- package/src/components/Content/Card/components/index.ts +0 -1
- package/src/components/Content/Card/index.ts +0 -30
- package/src/components/Content/Content.tsx +0 -315
- package/src/components/Content/Sections.tsx +0 -238
- package/src/components/Content/types.ts +0 -176
- package/src/components/ContentView/MoreContentList.tsx +0 -327
- package/src/components/ContentView/One/ContentViewOne.tsx +0 -243
- package/src/components/ContentView/One/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/One/components/CastCard.tsx +0 -265
- package/src/components/ContentView/One/components/EpisodeCard.tsx +0 -535
- package/src/components/ContentView/One/components/GenreTags.tsx +0 -132
- package/src/components/ContentView/One/components/HeroBanner.tsx +0 -357
- package/src/components/ContentView/One/components/MiniInfo.tsx +0 -356
- package/src/components/ContentView/One/components/PlayButton.tsx +0 -56
- package/src/components/ContentView/One/components/Title.tsx +0 -149
- package/src/components/ContentView/One/components/TrailerButton.tsx +0 -76
- package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -343
- package/src/components/ContentView/Two/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/Two/components/Details.tsx +0 -193
- package/src/components/ContentView/Two/components/EpisodeCard.tsx +0 -602
- package/src/components/ContentView/Two/components/GenreTags.tsx +0 -123
- package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -402
- package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
- package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -305
- package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -133
- package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -177
- package/src/components/ContentView/Two/components/Title.tsx +0 -226
- package/src/components/ContentView/Two/components/index.ts +0 -15
- package/src/components/ContentView/index.ts +0 -13
- package/src/components/Fallbacks/NoContentFallback.tsx +0 -176
- package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
- package/src/components/Fallbacks/index.ts +0 -2
- package/src/components/Headers/AppHeader.tsx +0 -150
- package/src/components/Headers/Four.tsx +0 -83
- package/src/components/Headers/One.tsx +0 -115
- package/src/components/Headers/Three.tsx +0 -135
- package/src/components/Headers/Two.tsx +0 -100
- package/src/components/Headers/index.ts +0 -18
- package/src/components/Input/Input.ts +0 -20
- package/src/components/Input/InputOne.tsx +0 -259
- package/src/components/Input/InputThree.tsx +0 -212
- package/src/components/Input/InputTwo.tsx +0 -212
- package/src/components/Input/PhoneNumberInput.tsx +0 -431
- package/src/components/Input/PhoneNumberInputTwo.tsx +0 -418
- package/src/components/Keyboard/HideKeyboard.tsx +0 -88
- package/src/components/Loader/Loader.tsx +0 -44
- package/src/components/Logo/Logo.tsx +0 -145
- package/src/components/NewRelease/NewReleaseSheet.tsx +0 -250
- package/src/components/NewRelease/index.ts +0 -1
- package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -221
- package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -314
- package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -196
- package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -95
- package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -163
- package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -210
- package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -146
- package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -154
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -264
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -494
- package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -184
- package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -154
- package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -41
- package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -40
- package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -79
- package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -332
- package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -187
- package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -80
- package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -2
- package/src/components/Reels/ReelsSeries/types.ts +0 -54
- package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -85
- package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -48
- package/src/components/Reels/index.ts +0 -9
- package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -42
- package/src/components/Reels/utils/Controls/index.ts +0 -4
- package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -35
- package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -25
- package/src/components/Reels/utils/Controls/videoRef.ts +0 -4
- package/src/components/Reels/utils/index.ts +0 -1
- package/src/components/Reels/utils/timeoutUtils.ts +0 -29
- package/src/components/Search/One.tsx +0 -256
- package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
- package/src/components/Search/components/SearchCard.tsx +0 -275
- package/src/components/Search/index.ts +0 -16
- package/src/components/Settings/AppSettings.tsx +0 -428
- package/src/components/Settings/index.ts +0 -1
- package/src/components/Subscription/SubOne.tsx +0 -874
- package/src/components/Subscription/index.ts +0 -12
- package/src/components/TabBar/One.tsx +0 -148
- package/src/components/TabBar/Three.tsx +0 -169
- package/src/components/TabBar/Two.tsx +0 -189
- package/src/components/TabBar/index.ts +0 -20
- package/src/components/Text/Text.tsx +0 -85
- package/src/components/Text/index.ts +0 -5
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -278
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -494
- package/src/components/User/WatchHistory/WatchHistory.tsx +0 -227
- package/src/components/User/WatchLater/WatchLater.tsx +0 -397
- package/src/components/User/components/UserAvatar.tsx +0 -120
- package/src/components/User/components/UserSection.tsx +0 -228
- package/src/components/User/index.ts +0 -18
- package/src/components/View/View.tsx +0 -37
- package/src/components/View/index.ts +0 -5
- package/src/components/common/AppStatusBar.tsx +0 -57
- package/src/components/index.ts +0 -29
- package/src/components/layout/SafeAreaWrapper.tsx +0 -45
- package/src/components/layout/index.ts +0 -1
- package/src/constants/dummySections.ts +0 -98
- package/src/hooks/Images/index.ts +0 -2
- package/src/hooks/Images/useImageLoader.ts +0 -206
- package/src/hooks/Images/useImageValidation.ts +0 -36
- package/src/hooks/index.ts +0 -17
- package/src/hooks/useAdTracking.ts +0 -349
- package/src/hooks/useCards.ts +0 -228
- package/src/hooks/useDebounce.ts +0 -35
- package/src/hooks/useKeyboard.ts +0 -43
- package/src/hooks/useNavigationMode.ts +0 -46
- package/src/hooks/usePaginatedSection.ts +0 -101
- package/src/hooks/usePrevious.ts +0 -28
- package/src/hooks/useSafeCallback.ts +0 -43
- package/src/hooks/useSkeletonItems.ts +0 -30
- package/src/hooks/useSplashCache.ts +0 -186
- package/src/hooks/useThemeColors.ts +0 -51
- package/src/index.tsx +0 -8
- package/src/store/RecentSearchesStore.ts +0 -78
- package/src/store/splashStore.ts +0 -91
- package/src/store/themeStore.ts +0 -43
- package/src/theme/ThemeProvider.tsx +0 -112
- package/src/theme/hook/index.ts +0 -1
- package/src/theme/hook/useInternalTheme.ts +0 -98
- package/src/theme/index.ts +0 -7
- package/src/theme/themes.ts +0 -336
- package/src/theme/utils/validateColor.ts +0 -127
- package/src/types/content/content-view.types.ts +0 -206
- package/src/types/hook/index.ts +0 -5
- package/src/types/hook/usePaginatedSetion.ts +0 -19
- package/src/types/index.ts +0 -7
- package/src/types/sections/index.ts +0 -84
- package/src/utils/Display.ts +0 -14
- package/src/utils/Formater.ts +0 -14
- package/src/utils/PlatformSelector.ts +0 -29
- package/src/utils/SizeMatters.ts +0 -7
- package/src/utils/Spacing.ts +0 -27
- package/src/utils/colorUtils.ts +0 -70
|
@@ -1,314 +0,0 @@
|
|
|
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
|
-
import { videoRef } from '../../utils/Controls';
|
|
23
|
-
import { DEFAULT_QUALITIES, getVideoQualities } from '../utils/quality';
|
|
24
|
-
|
|
25
|
-
export interface ContentProps {
|
|
26
|
-
series: ISeriesItem;
|
|
27
|
-
episode: ISeriesEpisode;
|
|
28
|
-
activeIndex: number;
|
|
29
|
-
}
|
|
30
|
-
export interface UnlockProps {
|
|
31
|
-
isVisible: boolean;
|
|
32
|
-
onClose: () => void;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface VideoProps {
|
|
36
|
-
currentTime: number;
|
|
37
|
-
duration: number;
|
|
38
|
-
paused: boolean;
|
|
39
|
-
buffering: boolean;
|
|
40
|
-
showCenterControls: boolean;
|
|
41
|
-
isLocked: boolean;
|
|
42
|
-
hasError: boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface LikeProps {
|
|
46
|
-
liked: boolean;
|
|
47
|
-
count: number;
|
|
48
|
-
showAnimation: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ActionsProps {
|
|
52
|
-
onLike?: (ep: ISeriesEpisode) => void;
|
|
53
|
-
onUnlockPress?: (ep: ISeriesEpisode) => void;
|
|
54
|
-
onEpisodeSelect?: (ep: ISeriesEpisode) => void;
|
|
55
|
-
onLikeMore?: (item: ILikeMoreData) => void;
|
|
56
|
-
onShare?: () => void;
|
|
57
|
-
onUnLock?: () => void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface NavigationProps {
|
|
61
|
-
onBack?: () => void;
|
|
62
|
-
onSearch?: () => void;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface SettingsProps {
|
|
66
|
-
playbackRate: number;
|
|
67
|
-
quality: string;
|
|
68
|
-
onPlaybackRateChange: (rate: number) => void;
|
|
69
|
-
onQualityChange: (q: string) => void;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface MediaControlsProps {
|
|
73
|
-
children: React.ReactNode;
|
|
74
|
-
content: ContentProps;
|
|
75
|
-
video: VideoProps;
|
|
76
|
-
likes: LikeProps;
|
|
77
|
-
actions: ActionsProps;
|
|
78
|
-
navigation: NavigationProps;
|
|
79
|
-
isFullScreen: boolean;
|
|
80
|
-
settings: SettingsProps;
|
|
81
|
-
modal?: ModalState;
|
|
82
|
-
setModal?: (m: ModalState) => void;
|
|
83
|
-
unlock: UnlockProps;
|
|
84
|
-
theme: ITheme;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const MediaControlsProvider: React.FC<MediaControlsProps> = ({
|
|
88
|
-
children,
|
|
89
|
-
content,
|
|
90
|
-
video,
|
|
91
|
-
likes,
|
|
92
|
-
actions,
|
|
93
|
-
navigation,
|
|
94
|
-
settings,
|
|
95
|
-
modal,
|
|
96
|
-
isFullScreen,
|
|
97
|
-
unlock,
|
|
98
|
-
setModal,
|
|
99
|
-
theme,
|
|
100
|
-
}) => {
|
|
101
|
-
const { series, episode, activeIndex } = content;
|
|
102
|
-
const isSeries = series?.episodes ? true : false;
|
|
103
|
-
|
|
104
|
-
const {
|
|
105
|
-
currentTime,
|
|
106
|
-
duration,
|
|
107
|
-
paused,
|
|
108
|
-
buffering,
|
|
109
|
-
showCenterControls,
|
|
110
|
-
isLocked,
|
|
111
|
-
hasError,
|
|
112
|
-
} = video;
|
|
113
|
-
|
|
114
|
-
const { liked, count, showAnimation } = likes;
|
|
115
|
-
|
|
116
|
-
const {
|
|
117
|
-
onLike,
|
|
118
|
-
onEpisodeSelect,
|
|
119
|
-
onLikeMore,
|
|
120
|
-
onUnlockPress,
|
|
121
|
-
onShare,
|
|
122
|
-
onUnLock,
|
|
123
|
-
} = actions;
|
|
124
|
-
|
|
125
|
-
const { onBack, onSearch } = navigation;
|
|
126
|
-
|
|
127
|
-
const { playbackRate, quality, onPlaybackRateChange, onQualityChange } =
|
|
128
|
-
settings;
|
|
129
|
-
|
|
130
|
-
// Qualities state is managed outside of the modal for smoother UX and to
|
|
131
|
-
// avoid performing API calls inside modal components.
|
|
132
|
-
const [qualities, setQualities] = React.useState<string[]>(DEFAULT_QUALITIES);
|
|
133
|
-
const [qualitiesLoading, setQualitiesLoading] = React.useState(false);
|
|
134
|
-
const lastLoadedUrlRef = React.useRef<string | null>(null);
|
|
135
|
-
|
|
136
|
-
React.useEffect(() => {
|
|
137
|
-
// Only fetch when settings modal is requested, and let the shared util
|
|
138
|
-
// handle caching per m3u8 URL to avoid repeated network calls.
|
|
139
|
-
if (modal?.type !== 'settings') {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const videoUrl = episode.videoUrl;
|
|
144
|
-
|
|
145
|
-
// If we've already loaded qualities for this URL once, don't toggle
|
|
146
|
-
// loading again or refetch – this prevents repeated "open/close" feel
|
|
147
|
-
// and keeps the modal content stable.
|
|
148
|
-
if (videoUrl && lastLoadedUrlRef.current === videoUrl) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
let isCancelled = false;
|
|
153
|
-
|
|
154
|
-
const fetchQualities = async () => {
|
|
155
|
-
if (!videoUrl || !videoUrl.includes('.m3u8')) {
|
|
156
|
-
if (!isCancelled) {
|
|
157
|
-
setQualities(DEFAULT_QUALITIES);
|
|
158
|
-
setQualitiesLoading(false);
|
|
159
|
-
lastLoadedUrlRef.current = videoUrl ?? null;
|
|
160
|
-
}
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
setQualitiesLoading(true);
|
|
165
|
-
|
|
166
|
-
try {
|
|
167
|
-
const qualityOptions = await getVideoQualities(videoUrl);
|
|
168
|
-
if (isCancelled) return;
|
|
169
|
-
|
|
170
|
-
if (qualityOptions.length > 0) {
|
|
171
|
-
const qualityStrings = [
|
|
172
|
-
'Auto',
|
|
173
|
-
...qualityOptions
|
|
174
|
-
.map((q) => q.quality)
|
|
175
|
-
.filter((v, i, self) => self.indexOf(v) === i)
|
|
176
|
-
.sort((a, b) => parseInt(b, 10) - parseInt(a, 10)),
|
|
177
|
-
];
|
|
178
|
-
setQualities(qualityStrings);
|
|
179
|
-
} else {
|
|
180
|
-
setQualities(DEFAULT_QUALITIES);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
lastLoadedUrlRef.current = videoUrl;
|
|
184
|
-
} catch (err) {
|
|
185
|
-
if (!isCancelled) {
|
|
186
|
-
setQualities(DEFAULT_QUALITIES);
|
|
187
|
-
lastLoadedUrlRef.current = videoUrl ?? null;
|
|
188
|
-
}
|
|
189
|
-
} finally {
|
|
190
|
-
if (!isCancelled) {
|
|
191
|
-
setQualitiesLoading(false);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
fetchQualities();
|
|
197
|
-
|
|
198
|
-
return () => {
|
|
199
|
-
isCancelled = true;
|
|
200
|
-
};
|
|
201
|
-
}, [episode.videoUrl, modal?.type]);
|
|
202
|
-
|
|
203
|
-
const episodeLabel = React.useMemo(() => {
|
|
204
|
-
return series.episodes.length > 0
|
|
205
|
-
? `Ep ${activeIndex + 1}/${series.episodes.length}`
|
|
206
|
-
: undefined;
|
|
207
|
-
}, [activeIndex, series.episodes.length]);
|
|
208
|
-
|
|
209
|
-
return (
|
|
210
|
-
<View style={styles.root}>
|
|
211
|
-
{/* ❤️ Like Animation */}
|
|
212
|
-
<Like visible={showAnimation} />
|
|
213
|
-
|
|
214
|
-
{/* Video behind controls */}
|
|
215
|
-
{children}
|
|
216
|
-
|
|
217
|
-
{/* Gradient overlay */}
|
|
218
|
-
<GradientOverlay />
|
|
219
|
-
|
|
220
|
-
{/* UI Controls */}
|
|
221
|
-
<View style={StyleSheet.absoluteFillObject}>
|
|
222
|
-
{/* TOP */}
|
|
223
|
-
<TopControls
|
|
224
|
-
theme={theme}
|
|
225
|
-
onBack={onBack}
|
|
226
|
-
episodeLabel={episodeLabel}
|
|
227
|
-
onSettings={() => setModal?.({ type: 'settings', isVisible: true })}
|
|
228
|
-
onSearch={onSearch}
|
|
229
|
-
/>
|
|
230
|
-
|
|
231
|
-
{/* CENTER */}
|
|
232
|
-
<MiddleControls
|
|
233
|
-
isLocked={isLocked}
|
|
234
|
-
theme={theme}
|
|
235
|
-
onUnLock={onUnLock}
|
|
236
|
-
isVisible={showCenterControls}
|
|
237
|
-
isPaused={paused}
|
|
238
|
-
isBuffering={buffering}
|
|
239
|
-
hasError={hasError}
|
|
240
|
-
/>
|
|
241
|
-
|
|
242
|
-
{/* RIGHT ACTIONS */}
|
|
243
|
-
<RightControls
|
|
244
|
-
episode={episode}
|
|
245
|
-
isLiked={liked}
|
|
246
|
-
likeCount={count}
|
|
247
|
-
onLike={onLike}
|
|
248
|
-
showEpisodesButton={isSeries}
|
|
249
|
-
onDetailsPress={() =>
|
|
250
|
-
setModal?.({ type: 'details', isVisible: true })
|
|
251
|
-
}
|
|
252
|
-
onShare={onShare}
|
|
253
|
-
/>
|
|
254
|
-
|
|
255
|
-
<BottomControls
|
|
256
|
-
theme={theme}
|
|
257
|
-
series={series}
|
|
258
|
-
episodeIndex={activeIndex}
|
|
259
|
-
videoCurrentTime={currentTime}
|
|
260
|
-
videoDuration={duration}
|
|
261
|
-
isFullScreen={isFullScreen}
|
|
262
|
-
onEpisodesPress={() =>
|
|
263
|
-
setModal?.({ type: 'details', isVisible: true })
|
|
264
|
-
}
|
|
265
|
-
onSeek={(time) => videoRef.current?.seek(time)}
|
|
266
|
-
/>
|
|
267
|
-
</View>
|
|
268
|
-
|
|
269
|
-
{/* DETAILS MODAL */}
|
|
270
|
-
{isSeries && (
|
|
271
|
-
<DetailsModal
|
|
272
|
-
reel={episode}
|
|
273
|
-
data={series}
|
|
274
|
-
activeEpisodeIndex={activeIndex}
|
|
275
|
-
theme={theme}
|
|
276
|
-
isVisible={modal?.type === 'details' && modal.isVisible}
|
|
277
|
-
onClose={() => setModal?.({ type: 'none', isVisible: false })}
|
|
278
|
-
onEpisodeSelect={onEpisodeSelect}
|
|
279
|
-
onLikeMorePress={onLikeMore}
|
|
280
|
-
/>
|
|
281
|
-
)}
|
|
282
|
-
|
|
283
|
-
{/* SETTINGS MODAL */}
|
|
284
|
-
<SettingModal
|
|
285
|
-
theme={theme}
|
|
286
|
-
speed={playbackRate}
|
|
287
|
-
quality={quality}
|
|
288
|
-
qualities={qualities}
|
|
289
|
-
qualitiesLoading={qualitiesLoading}
|
|
290
|
-
onSpeedChange={onPlaybackRateChange}
|
|
291
|
-
onQualityChange={onQualityChange}
|
|
292
|
-
isVisible={modal?.type === 'settings' && modal.isVisible}
|
|
293
|
-
onClose={() => setModal?.({ type: 'none', isVisible: false })}
|
|
294
|
-
/>
|
|
295
|
-
|
|
296
|
-
<UnLockModal
|
|
297
|
-
isVisible={unlock.isVisible}
|
|
298
|
-
onClose={() => unlock.onClose()}
|
|
299
|
-
theme={theme}
|
|
300
|
-
episode={episode}
|
|
301
|
-
data={series}
|
|
302
|
-
onUnlockPress={onUnlockPress}
|
|
303
|
-
/>
|
|
304
|
-
</View>
|
|
305
|
-
);
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
export default MediaControlsProvider;
|
|
309
|
-
|
|
310
|
-
const styles = StyleSheet.create({
|
|
311
|
-
root: {
|
|
312
|
-
flex: 1,
|
|
313
|
-
},
|
|
314
|
-
});
|
|
@@ -1,196 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
import { formatCount } from '../../../../utils/Formater';
|
|
8
|
-
|
|
9
|
-
interface RightControlsProps {
|
|
10
|
-
episode: ISeriesEpisode;
|
|
11
|
-
isLiked: boolean;
|
|
12
|
-
likeCount: number;
|
|
13
|
-
|
|
14
|
-
onLike?: (item: ISeriesEpisode) => void;
|
|
15
|
-
onDetailsPress?: () => void;
|
|
16
|
-
onShare?: () => void;
|
|
17
|
-
|
|
18
|
-
showEpisodesButton?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const RightControls: React.FC<RightControlsProps> = ({
|
|
22
|
-
episode,
|
|
23
|
-
isLiked,
|
|
24
|
-
likeCount,
|
|
25
|
-
onLike,
|
|
26
|
-
onShare,
|
|
27
|
-
onDetailsPress,
|
|
28
|
-
showEpisodesButton = true,
|
|
29
|
-
}) => {
|
|
30
|
-
return (
|
|
31
|
-
<View style={styles.container}>
|
|
32
|
-
{/* ❤️ Like */}
|
|
33
|
-
<TouchableOpacity
|
|
34
|
-
style={styles.actionButton}
|
|
35
|
-
onPress={() => onLike?.(episode)}
|
|
36
|
-
activeOpacity={0.7}
|
|
37
|
-
>
|
|
38
|
-
<Heart
|
|
39
|
-
size={moderateScale(26)}
|
|
40
|
-
color={isLiked ? 'red' : '#fff'}
|
|
41
|
-
fill={isLiked ? 'red' : 'none'}
|
|
42
|
-
/>
|
|
43
|
-
<Text style={styles.actionLabel}>
|
|
44
|
-
{formatCount(Number(likeCount) || 0)}
|
|
45
|
-
</Text>
|
|
46
|
-
</TouchableOpacity>
|
|
47
|
-
|
|
48
|
-
{/* 📺 Episodes / Details */}
|
|
49
|
-
{showEpisodesButton && (
|
|
50
|
-
<TouchableOpacity
|
|
51
|
-
style={styles.actionButton}
|
|
52
|
-
onPress={onDetailsPress}
|
|
53
|
-
activeOpacity={0.7}
|
|
54
|
-
>
|
|
55
|
-
<ListVideo color={'#fff'} size={moderateScale(26)} />
|
|
56
|
-
<Text style={styles.actionLabel}>Episodes</Text>
|
|
57
|
-
</TouchableOpacity>
|
|
58
|
-
)}
|
|
59
|
-
|
|
60
|
-
{/* 📤 Share */}
|
|
61
|
-
{onShare && (
|
|
62
|
-
<TouchableOpacity
|
|
63
|
-
style={styles.actionButton}
|
|
64
|
-
onPress={onShare}
|
|
65
|
-
activeOpacity={0.7}
|
|
66
|
-
>
|
|
67
|
-
<Forward color={'#fff'} size={moderateScale(26)} />
|
|
68
|
-
<Text style={styles.actionLabel}>Share</Text>
|
|
69
|
-
</TouchableOpacity>
|
|
70
|
-
)}
|
|
71
|
-
</View>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default RightControls;
|
|
76
|
-
|
|
77
|
-
const styles = StyleSheet.create({
|
|
78
|
-
container: {
|
|
79
|
-
position: 'absolute',
|
|
80
|
-
bottom: verticalScale(120),
|
|
81
|
-
right: moderateScale(10),
|
|
82
|
-
flexDirection: 'column',
|
|
83
|
-
zIndex: 20,
|
|
84
|
-
},
|
|
85
|
-
actionButton: {
|
|
86
|
-
marginVertical: verticalScale(10),
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
},
|
|
89
|
-
actionLabel: {
|
|
90
|
-
marginTop: verticalScale(4),
|
|
91
|
-
fontSize: RFValue(10),
|
|
92
|
-
color: '#fff',
|
|
93
|
-
textAlign: 'center',
|
|
94
|
-
},
|
|
95
|
-
});
|