@zezosoft/zezo-ott-react-native-video-player 1.0.1 → 1.0.3
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/README.md +342 -85
- package/lib/module/AdsPlayer/AdsPlayer.js +244 -0
- package/lib/module/AdsPlayer/AdsPlayer.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/AdBottomControls.js +176 -0
- package/lib/module/AdsPlayer/MediaControls/AdBottomControls.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/AdMediaControls.js +96 -0
- package/lib/module/AdsPlayer/MediaControls/AdMediaControls.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/AdMediaControlsProvider.js +34 -0
- package/lib/module/AdsPlayer/MediaControls/AdMediaControlsProvider.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/AdMiddleControls.js +65 -0
- package/lib/module/AdsPlayer/MediaControls/AdMiddleControls.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/AdTopControls.js +177 -0
- package/lib/module/AdsPlayer/MediaControls/AdTopControls.js.map +1 -0
- package/lib/module/AdsPlayer/MediaControls/index.js +8 -0
- package/lib/module/AdsPlayer/MediaControls/index.js.map +1 -0
- package/lib/module/AdsPlayer/components/RotatingLoader.js +55 -0
- package/lib/module/AdsPlayer/components/RotatingLoader.js.map +1 -0
- package/lib/module/AdsPlayer/index.js +6 -0
- package/lib/module/AdsPlayer/index.js.map +1 -0
- package/lib/module/AdsPlayer/store/adsPlayer.type.js +4 -0
- package/lib/module/AdsPlayer/store/adsPlayer.type.js.map +1 -0
- package/lib/module/AdsPlayer/store/adsPlayerStore.js +70 -0
- package/lib/module/AdsPlayer/store/adsPlayerStore.js.map +1 -0
- package/lib/module/AdsPlayer/store/index.js +5 -0
- package/lib/module/AdsPlayer/store/index.js.map +1 -0
- package/lib/module/AdsPlayer/utils/adStateReset.js +31 -0
- package/lib/module/AdsPlayer/utils/adStateReset.js.map +1 -0
- package/lib/module/AdsPlayer/utils/controls.js +63 -0
- package/lib/module/AdsPlayer/utils/controls.js.map +1 -0
- package/lib/module/AdsPlayer/utils/useAdControlsAutoHide.js +35 -0
- package/lib/module/AdsPlayer/utils/useAdControlsAutoHide.js.map +1 -0
- package/lib/module/AdsPlayer/utils/useAdInitialization.js +60 -0
- package/lib/module/AdsPlayer/utils/useAdInitialization.js.map +1 -0
- package/lib/module/AdsPlayer/utils/useAdTracking.js +50 -0
- package/lib/module/AdsPlayer/utils/useAdTracking.js.map +1 -0
- package/lib/module/AdsPlayer/utils/useAdsManager.js +165 -0
- package/lib/module/AdsPlayer/utils/useAdsManager.js.map +1 -0
- package/lib/module/VideoPlayer/MediaControls/BottomControls.js +32 -13
- package/lib/module/VideoPlayer/MediaControls/BottomControls.js.map +1 -1
- package/lib/module/VideoPlayer/MediaControls/MediaControls.js +4 -3
- package/lib/module/VideoPlayer/MediaControls/MediaControls.js.map +1 -1
- package/lib/module/VideoPlayer/MediaControls/MediaControlsProvider.js +31 -31
- package/lib/module/VideoPlayer/MediaControls/MediaControlsProvider.js.map +1 -1
- package/lib/module/VideoPlayer/MediaControls/MiddleControls.js +50 -40
- package/lib/module/VideoPlayer/MediaControls/MiddleControls.js.map +1 -1
- package/lib/module/VideoPlayer/MediaControls/TopControls.js +7 -12
- package/lib/module/VideoPlayer/MediaControls/TopControls.js.map +1 -1
- package/lib/module/VideoPlayer/{model → Settings}/AudioAndSubtitles.js +0 -14
- package/lib/module/VideoPlayer/Settings/AudioAndSubtitles.js.map +1 -0
- package/lib/module/VideoPlayer/{model → Settings}/Episodes.js +1 -1
- package/lib/module/VideoPlayer/Settings/Episodes.js.map +1 -0
- package/lib/module/VideoPlayer/{model → Settings}/SettingModal.js +0 -1
- package/lib/module/VideoPlayer/Settings/SettingModal.js.map +1 -0
- package/lib/module/VideoPlayer/{model → Settings}/SpeedControls.js +1 -9
- package/lib/module/VideoPlayer/Settings/SpeedControls.js.map +1 -0
- package/lib/module/VideoPlayer/{model → Settings}/VideoPlayerSettings.js +1 -1
- package/lib/module/VideoPlayer/Settings/VideoPlayerSettings.js.map +1 -0
- package/lib/module/VideoPlayer/VideoPlayerCore.js +244 -0
- package/lib/module/VideoPlayer/VideoPlayerCore.js.map +1 -0
- package/lib/module/VideoPlayer/components/ProgressBar.js +99 -24
- package/lib/module/VideoPlayer/components/ProgressBar.js.map +1 -1
- package/lib/module/VideoPlayer/components/SkipAndNextControls.js +1 -6
- package/lib/module/VideoPlayer/components/SkipAndNextControls.js.map +1 -1
- package/lib/module/VideoPlayer/components/SubtitleView.js +1 -1
- package/lib/module/VideoPlayer/components/SubtitleView.js.map +1 -1
- package/lib/module/VideoPlayer/components/Toast.js +57 -0
- package/lib/module/VideoPlayer/components/Toast.js.map +1 -0
- package/lib/module/VideoPlayer/index.js +1 -1
- package/lib/module/VideoPlayer/index.js.map +1 -1
- package/lib/module/VideoPlayer/store/videoPlayerStore.js +0 -4
- package/lib/module/VideoPlayer/store/videoPlayerStore.js.map +1 -1
- package/lib/module/VideoPlayer/{Styles → styles}/globalStyles.js +5 -6
- package/lib/module/VideoPlayer/styles/globalStyles.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{Display.js → display/Display.js} +0 -4
- package/lib/module/VideoPlayer/utils/display/Display.js.map +1 -0
- package/lib/module/VideoPlayer/utils/display/index.js +4 -0
- package/lib/module/VideoPlayer/utils/display/index.js.map +1 -0
- package/lib/module/VideoPlayer/utils/format/index.js +4 -0
- package/lib/module/VideoPlayer/utils/format/index.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{timeFormatter.js → format/timeFormatter.js} +0 -6
- package/lib/module/VideoPlayer/utils/format/timeFormatter.js.map +1 -0
- package/lib/module/VideoPlayer/utils/hooks/index.js +3 -0
- package/lib/module/VideoPlayer/utils/hooks/index.js.map +1 -1
- package/lib/module/VideoPlayer/utils/hooks/useAdEventHandler.js +56 -0
- package/lib/module/VideoPlayer/utils/hooks/useAdEventHandler.js.map +1 -0
- package/lib/module/VideoPlayer/utils/hooks/useOrientationLock.js +25 -0
- package/lib/module/VideoPlayer/utils/hooks/useOrientationLock.js.map +1 -0
- package/lib/module/VideoPlayer/utils/hooks/usePauseVideoOnAd.js +43 -0
- package/lib/module/VideoPlayer/utils/hooks/usePauseVideoOnAd.js.map +1 -0
- package/lib/module/VideoPlayer/utils/hooks/useVideoPlayerBack.js +3 -4
- package/lib/module/VideoPlayer/utils/hooks/useVideoPlayerBack.js.map +1 -1
- package/lib/module/VideoPlayer/utils/hooks/useVideoResolutions.js +12 -11
- package/lib/module/VideoPlayer/utils/hooks/useVideoResolutions.js.map +1 -1
- package/lib/module/VideoPlayer/utils/index.js +5 -6
- package/lib/module/VideoPlayer/utils/index.js.map +1 -1
- package/lib/module/VideoPlayer/utils/{PlatformSelector.js → platform/PlatformSelector.js} +0 -5
- package/lib/module/VideoPlayer/utils/platform/PlatformSelector.js.map +1 -0
- package/lib/module/VideoPlayer/utils/platform/index.js +5 -0
- package/lib/module/VideoPlayer/utils/platform/index.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{lockOrientation.js → platform/lockOrientation.js} +13 -5
- package/lib/module/VideoPlayer/utils/platform/lockOrientation.js.map +1 -0
- package/lib/module/VideoPlayer/utils/player/index.js +5 -0
- package/lib/module/VideoPlayer/utils/player/index.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{playerEvents.js → player/playerEvents.js} +3 -3
- package/lib/module/VideoPlayer/utils/player/playerEvents.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{useWatchReporter.js → player/useWatchReporter.js} +3 -2
- package/lib/module/VideoPlayer/utils/player/useWatchReporter.js.map +1 -0
- package/lib/module/VideoPlayer/utils/video/index.js +8 -0
- package/lib/module/VideoPlayer/utils/video/index.js.map +1 -0
- package/lib/module/VideoPlayer/utils/{videoControl.js → video/videoControl.js} +1 -14
- package/lib/module/VideoPlayer/utils/video/videoControl.js.map +1 -0
- package/lib/module/VideoPlayer/utils/video/videoRef.js +20 -0
- package/lib/module/VideoPlayer/utils/video/videoRef.js.map +1 -0
- package/lib/module/VideoPlayer/utils/video/videoResume.js +29 -0
- package/lib/module/VideoPlayer/utils/video/videoResume.js.map +1 -0
- package/lib/module/VideoPlayer/utils/video/videoSource.js.map +1 -0
- package/lib/module/VideoPlayer.js +140 -0
- package/lib/module/VideoPlayer.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/AdsPlayer/AdsPlayer.d.ts +22 -0
- package/lib/typescript/src/AdsPlayer/AdsPlayer.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdBottomControls.d.ts +4 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdBottomControls.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControls.d.ts +8 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControls.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControlsProvider.d.ts +26 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControlsProvider.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMiddleControls.d.ts +4 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdMiddleControls.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdTopControls.d.ts +7 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/AdTopControls.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/index.d.ts +6 -0
- package/lib/typescript/src/AdsPlayer/MediaControls/index.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/components/RotatingLoader.d.ts +12 -0
- package/lib/typescript/src/AdsPlayer/components/RotatingLoader.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/index.d.ts +5 -0
- package/lib/typescript/src/AdsPlayer/index.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/store/adsPlayer.type.d.ts +28 -0
- package/lib/typescript/src/AdsPlayer/store/adsPlayer.type.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/store/adsPlayerStore.d.ts +22 -0
- package/lib/typescript/src/AdsPlayer/store/adsPlayerStore.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/store/index.d.ts +3 -0
- package/lib/typescript/src/AdsPlayer/store/index.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/adStateReset.d.ts +6 -0
- package/lib/typescript/src/AdsPlayer/utils/adStateReset.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/controls.d.ts +13 -0
- package/lib/typescript/src/AdsPlayer/utils/controls.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdControlsAutoHide.d.ts +3 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdControlsAutoHide.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdInitialization.d.ts +20 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdInitialization.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdTracking.d.ts +23 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdTracking.d.ts.map +1 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdsManager.d.ts +9 -0
- package/lib/typescript/src/AdsPlayer/utils/useAdsManager.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/MediaControls/BottomControls.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/MediaControls/MediaControlsProvider.d.ts +3 -1
- package/lib/typescript/src/VideoPlayer/MediaControls/MediaControlsProvider.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/MediaControls/MiddleControls.d.ts +2 -1
- package/lib/typescript/src/VideoPlayer/MediaControls/MiddleControls.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/MediaControls/TopControls.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/Settings/AudioAndSubtitles.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/{model → Settings}/Episodes.d.ts +1 -1
- package/lib/typescript/src/VideoPlayer/Settings/Episodes.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/{model → Settings}/SettingModal.d.ts +1 -1
- package/lib/typescript/src/VideoPlayer/Settings/SettingModal.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/Settings/SpeedControls.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/Settings/VideoPlayerSettings.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/{VideoPlayer.d.ts → VideoPlayerCore.d.ts} +10 -7
- package/lib/typescript/src/VideoPlayer/VideoPlayerCore.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/components/ProgressBar.d.ts +3 -1
- package/lib/typescript/src/VideoPlayer/components/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/components/SkipAndNextControls.d.ts +1 -1
- package/lib/typescript/src/VideoPlayer/components/SkipAndNextControls.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/components/Toast.d.ts +12 -0
- package/lib/typescript/src/VideoPlayer/components/Toast.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/index.d.ts +1 -1
- package/lib/typescript/src/VideoPlayer/index.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/store/videoPlayer.type.d.ts +25 -5
- package/lib/typescript/src/VideoPlayer/store/videoPlayer.type.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/store/videoPlayerStore.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/{Styles → styles}/globalStyles.d.ts +16 -9
- package/lib/typescript/src/VideoPlayer/styles/globalStyles.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/display/Display.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/display/index.d.ts +2 -0
- package/lib/typescript/src/VideoPlayer/utils/display/index.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/format/index.d.ts +2 -0
- package/lib/typescript/src/VideoPlayer/utils/format/index.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/{timeFormatter.d.ts → format/timeFormatter.d.ts} +0 -5
- package/lib/typescript/src/VideoPlayer/utils/format/timeFormatter.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/index.d.ts +3 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/utils/hooks/useAdEventHandler.d.ts +34 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/useAdEventHandler.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/useOrientationLock.d.ts +11 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/useOrientationLock.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.d.ts +6 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/hooks/useVideoResolutions.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/utils/index.d.ts +5 -6
- package/lib/typescript/src/VideoPlayer/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/VideoPlayer/utils/{PlatformSelector.d.ts → platform/PlatformSelector.d.ts} +0 -4
- package/lib/typescript/src/VideoPlayer/utils/platform/PlatformSelector.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/platform/index.d.ts +3 -0
- package/lib/typescript/src/VideoPlayer/utils/platform/index.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/platform/lockOrientation.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/player/index.d.ts +3 -0
- package/lib/typescript/src/VideoPlayer/utils/player/index.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/{playerEvents.d.ts → player/playerEvents.d.ts} +1 -1
- package/lib/typescript/src/VideoPlayer/utils/player/playerEvents.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/{useWatchReporter.d.ts → player/useWatchReporter.d.ts} +1 -6
- package/lib/typescript/src/VideoPlayer/utils/player/useWatchReporter.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/video/index.d.ts +6 -0
- package/lib/typescript/src/VideoPlayer/utils/video/index.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/{videoControl.d.ts → video/videoControl.d.ts} +1 -1
- package/lib/typescript/src/VideoPlayer/utils/video/videoControl.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/video/videoRef.d.ts +19 -0
- package/lib/typescript/src/VideoPlayer/utils/video/videoRef.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/video/videoResume.d.ts +6 -0
- package/lib/typescript/src/VideoPlayer/utils/video/videoResume.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer/utils/{videoSource.d.ts → video/videoSource.d.ts} +1 -1
- package/lib/typescript/src/VideoPlayer/utils/video/videoSource.d.ts.map +1 -0
- package/lib/typescript/src/VideoPlayer.d.ts +31 -0
- package/lib/typescript/src/VideoPlayer.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +128 -101
- package/src/AdsPlayer/AdsPlayer.tsx +311 -0
- package/src/AdsPlayer/MediaControls/AdBottomControls.tsx +191 -0
- package/src/AdsPlayer/MediaControls/AdMediaControls.tsx +104 -0
- package/src/AdsPlayer/MediaControls/AdMediaControlsProvider.tsx +62 -0
- package/src/AdsPlayer/MediaControls/AdMiddleControls.tsx +63 -0
- package/src/AdsPlayer/MediaControls/AdTopControls.tsx +191 -0
- package/src/AdsPlayer/MediaControls/index.ts +5 -0
- package/src/AdsPlayer/components/RotatingLoader.tsx +79 -0
- package/src/AdsPlayer/index.ts +4 -0
- package/src/AdsPlayer/store/adsPlayer.type.ts +29 -0
- package/src/AdsPlayer/store/adsPlayerStore.ts +59 -0
- package/src/AdsPlayer/store/index.ts +2 -0
- package/src/AdsPlayer/utils/adStateReset.ts +29 -0
- package/src/AdsPlayer/utils/controls.ts +69 -0
- package/src/AdsPlayer/utils/useAdControlsAutoHide.ts +32 -0
- package/src/AdsPlayer/utils/useAdInitialization.ts +86 -0
- package/src/AdsPlayer/utils/useAdTracking.ts +89 -0
- package/src/AdsPlayer/utils/useAdsManager.ts +215 -0
- package/src/VideoPlayer/MediaControls/BottomControls.tsx +34 -9
- package/src/VideoPlayer/MediaControls/MediaControls.tsx +4 -3
- package/src/VideoPlayer/MediaControls/MediaControlsProvider.tsx +40 -35
- package/src/VideoPlayer/MediaControls/MiddleControls.tsx +87 -60
- package/src/VideoPlayer/MediaControls/TopControls.tsx +16 -8
- package/src/VideoPlayer/{model → Settings}/AudioAndSubtitles.tsx +0 -7
- package/src/VideoPlayer/{model → Settings}/Episodes.tsx +6 -3
- package/src/VideoPlayer/{model → Settings}/SettingModal.tsx +1 -2
- package/src/VideoPlayer/{model → Settings}/SpeedControls.tsx +1 -5
- package/src/VideoPlayer/{model → Settings}/VideoPlayerSettings.tsx +1 -1
- package/src/VideoPlayer/VideoPlayerCore.tsx +356 -0
- package/src/VideoPlayer/components/ProgressBar.tsx +135 -22
- package/src/VideoPlayer/components/SkipAndNextControls.tsx +2 -5
- package/src/VideoPlayer/components/SubtitleView.tsx +1 -1
- package/src/VideoPlayer/components/Toast.tsx +61 -0
- package/src/VideoPlayer/index.ts +1 -1
- package/src/VideoPlayer/store/videoPlayer.type.ts +28 -6
- package/src/VideoPlayer/store/videoPlayerStore.ts +0 -4
- package/src/VideoPlayer/{Styles → styles}/globalStyles.ts +5 -6
- package/src/VideoPlayer/utils/{Display.ts → display/Display.ts} +0 -4
- package/src/VideoPlayer/utils/display/index.ts +1 -0
- package/src/VideoPlayer/utils/format/index.ts +1 -0
- package/src/VideoPlayer/utils/{timeFormatter.ts → format/timeFormatter.ts} +4 -7
- package/src/VideoPlayer/utils/hooks/index.ts +3 -0
- package/src/VideoPlayer/utils/hooks/useAdEventHandler.ts +95 -0
- package/src/VideoPlayer/utils/hooks/useOrientationLock.ts +29 -0
- package/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.ts +46 -0
- package/src/VideoPlayer/utils/hooks/useVideoPlayerBack.ts +3 -3
- package/src/VideoPlayer/utils/hooks/useVideoResolutions.ts +18 -12
- package/src/VideoPlayer/utils/index.ts +5 -6
- package/src/VideoPlayer/utils/{PlatformSelector.ts → platform/PlatformSelector.ts} +0 -5
- package/src/VideoPlayer/utils/platform/index.ts +2 -0
- package/src/VideoPlayer/utils/{lockOrientation.ts → platform/lockOrientation.ts} +11 -5
- package/src/VideoPlayer/utils/player/index.ts +2 -0
- package/src/VideoPlayer/utils/{playerEvents.ts → player/playerEvents.ts} +4 -4
- package/src/VideoPlayer/utils/{useWatchReporter.ts → player/useWatchReporter.ts} +4 -3
- package/src/VideoPlayer/utils/video/index.ts +5 -0
- package/src/VideoPlayer/utils/{videoControl.ts → video/videoControl.ts} +2 -9
- package/src/VideoPlayer/utils/video/videoRef.ts +21 -0
- package/src/VideoPlayer/utils/video/videoResume.ts +23 -0
- package/src/VideoPlayer/utils/{videoSource.ts → video/videoSource.ts} +1 -1
- package/src/VideoPlayer.tsx +181 -0
- package/src/index.tsx +3 -1
- package/lib/module/VideoPlayer/Styles/fonts.js +0 -58
- package/lib/module/VideoPlayer/Styles/fonts.js.map +0 -1
- package/lib/module/VideoPlayer/Styles/globalStyles.js.map +0 -1
- package/lib/module/VideoPlayer/VideoPlayer.js +0 -180
- package/lib/module/VideoPlayer/VideoPlayer.js.map +0 -1
- package/lib/module/VideoPlayer/model/AudioAndSubtitles.js.map +0 -1
- package/lib/module/VideoPlayer/model/Episodes.js.map +0 -1
- package/lib/module/VideoPlayer/model/SettingModal.js.map +0 -1
- package/lib/module/VideoPlayer/model/SpeedControls.js.map +0 -1
- package/lib/module/VideoPlayer/model/VideoPlayerSettings.js.map +0 -1
- package/lib/module/VideoPlayer/utils/Display.js.map +0 -1
- package/lib/module/VideoPlayer/utils/PlatformSelector.js.map +0 -1
- package/lib/module/VideoPlayer/utils/lockOrientation.js.map +0 -1
- package/lib/module/VideoPlayer/utils/playerEvents.js.map +0 -1
- package/lib/module/VideoPlayer/utils/timeFormatter.js.map +0 -1
- package/lib/module/VideoPlayer/utils/useWatchReporter.js.map +0 -1
- package/lib/module/VideoPlayer/utils/videoControl.js.map +0 -1
- package/lib/module/VideoPlayer/utils/videoRef.js +0 -5
- package/lib/module/VideoPlayer/utils/videoRef.js.map +0 -1
- package/lib/module/VideoPlayer/utils/videoSource.js.map +0 -1
- package/lib/typescript/src/VideoPlayer/Styles/fonts.d.ts +0 -54
- package/lib/typescript/src/VideoPlayer/Styles/fonts.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/Styles/globalStyles.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/VideoPlayer.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/model/AudioAndSubtitles.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/model/Episodes.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/model/SettingModal.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/model/SpeedControls.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/model/VideoPlayerSettings.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/Display.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/PlatformSelector.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/lockOrientation.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/playerEvents.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/timeFormatter.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/useWatchReporter.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/videoControl.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/videoRef.d.ts +0 -3
- package/lib/typescript/src/VideoPlayer/utils/videoRef.d.ts.map +0 -1
- package/lib/typescript/src/VideoPlayer/utils/videoSource.d.ts.map +0 -1
- package/src/VideoPlayer/Styles/fonts.ts +0 -106
- package/src/VideoPlayer/VideoPlayer.tsx +0 -217
- package/src/VideoPlayer/utils/videoRef.ts +0 -4
- /package/lib/module/VideoPlayer/utils/{videoSource.js → video/videoSource.js} +0 -0
- /package/lib/typescript/src/VideoPlayer/{model → Settings}/AudioAndSubtitles.d.ts +0 -0
- /package/lib/typescript/src/VideoPlayer/{model → Settings}/SpeedControls.d.ts +0 -0
- /package/lib/typescript/src/VideoPlayer/{model → Settings}/VideoPlayerSettings.d.ts +0 -0
- /package/lib/typescript/src/VideoPlayer/utils/{Display.d.ts → display/Display.d.ts} +0 -0
- /package/lib/typescript/src/VideoPlayer/utils/{lockOrientation.d.ts → platform/lockOrientation.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,20 +1,71 @@
|
|
|
1
1
|
# 🎬 ZezoOTT Video Player
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
|
|
3
|
+
A powerful, production-ready React Native video player component designed specifically for OTT (Over-The-Top) platforms. Built with TypeScript and featuring a centralized state management system, it delivers a seamless full-screen video playback experience with comprehensive support for playlists, seasons, ads, analytics, and custom controls.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Features](#-features)
|
|
10
|
+
- [Requirements](#-requirements)
|
|
11
|
+
- [Installation](#-installation)
|
|
12
|
+
- [Quick Start](#-quick-start)
|
|
13
|
+
- [API Reference](#-api-reference)
|
|
14
|
+
- [VideoPlayer Props](#-videoplayer-props)
|
|
15
|
+
- [VideoAd Interface](#-videoad-interface)
|
|
16
|
+
- [Usage Examples](#-usage-examples)
|
|
17
|
+
- [Basic Example](#-basic-example)
|
|
18
|
+
- [Auto-Next Episodes](#-auto-next-episodes)
|
|
19
|
+
- [Custom Theming](#-custom-theming)
|
|
20
|
+
- [Playlist & Seasons](#-playlist--seasons)
|
|
21
|
+
- [Ads Player](#-ads-player)
|
|
22
|
+
- [Video Player Store](#-video-player-store)
|
|
23
|
+
- [Best Practices](#-best-practices)
|
|
24
|
+
- [Troubleshooting](#-troubleshooting)
|
|
25
|
+
- [Demo App](#-demo-app)
|
|
26
|
+
- [License](#-license)
|
|
5
27
|
|
|
6
28
|
---
|
|
7
29
|
|
|
8
30
|
## ✨ Features
|
|
9
31
|
|
|
10
|
-
- 📺 **Episode
|
|
11
|
-
- 📊 **Watch
|
|
12
|
-
- 🎨 **Custom
|
|
13
|
-
- 🔄 **Auto-next
|
|
14
|
-
- 🎬 **Playlist
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
32
|
+
- 📺 **Episode Navigation & Seasons** - Seamless navigation between episodes and seasons
|
|
33
|
+
- 📊 **Watch Progress Tracking** - Built-in analytics for watch time and progress
|
|
34
|
+
- 🎨 **Custom Theming** - Fully customizable UI colors and metrics
|
|
35
|
+
- 🔄 **Auto-Next Playback** - Automatically plays next episode/video
|
|
36
|
+
- 🎬 **Playlist Integration** - Support for playlists and multi-season content
|
|
37
|
+
- 📝 **Subtitles (SRT/VTT)** - Built-in subtitle support with track selection
|
|
38
|
+
- 🗄️ **Centralized Store** - Zustand-powered state management for playback, tracks & UI
|
|
39
|
+
- 📱 **React Native Optimized** - Built specifically for React Native OTT apps
|
|
40
|
+
- 📢 **Ads Player** - Pre-roll, mid-roll, and post-roll ads with comprehensive tracking
|
|
41
|
+
- 🎯 **Production Ready** - Minimal configuration, battle-tested in production
|
|
42
|
+
- 🔒 **TypeScript** - Full TypeScript support with comprehensive type definitions
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 📦 Requirements
|
|
47
|
+
|
|
48
|
+
### Peer Dependencies
|
|
49
|
+
|
|
50
|
+
This package requires the following peer dependencies to be installed in your project:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
yarn add react react-native react-native-video react-native-safe-area-context \
|
|
54
|
+
react-native-gesture-handler react-native-reanimated react-native-fast-image \
|
|
55
|
+
react-native-linear-gradient react-native-svg react-native-system-navigation-bar
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
or
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install react react-native react-native-video react-native-safe-area-context \
|
|
62
|
+
react-native-gesture-handler react-native-reanimated react-native-fast-image \
|
|
63
|
+
react-native-linear-gradient react-native-svg react-native-system-navigation-bar
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Fullscreen & Orientation
|
|
67
|
+
|
|
68
|
+
`react-native-orientation-locker` is included as a dependency. For fullscreen and orientation lock to work, ensure native setup is complete. See [Troubleshooting](#-troubleshooting) for details.
|
|
18
69
|
|
|
19
70
|
---
|
|
20
71
|
|
|
@@ -32,19 +83,91 @@ npm install @zezosoft/zezo-ott-react-native-video-player
|
|
|
32
83
|
|
|
33
84
|
---
|
|
34
85
|
|
|
35
|
-
##
|
|
86
|
+
## 🚀 Quick Start
|
|
36
87
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
88
|
+
```tsx
|
|
89
|
+
import React from 'react';
|
|
90
|
+
import { VideoPlayer } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
91
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
92
|
+
|
|
93
|
+
export default function VideoPlayerScreen() {
|
|
94
|
+
const insets = useSafeAreaInsets();
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<VideoPlayer
|
|
98
|
+
insets={insets}
|
|
99
|
+
isFocused={true}
|
|
100
|
+
mode="fullscreen"
|
|
101
|
+
autoNext={true}
|
|
102
|
+
onClose={() => console.log('Player closed')}
|
|
103
|
+
onWatchProgress={(progress) => {
|
|
104
|
+
console.log('Watch Progress:', progress);
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
> **Note:** Make sure you've set up the video player store with your content before rendering the player. See [Playlist & Seasons](#-playlist--seasons) section for details.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 📚 API Reference
|
|
116
|
+
|
|
117
|
+
### ⚙️ VideoPlayer Props
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Required | Default | Description |
|
|
120
|
+
| ------------------- | ------------------------------------------------------------------------------------------- | -------- | -------------- | -------------------------------------------------------------------------------------- |
|
|
121
|
+
| **insets** | `EdgeInsets` | ✅ Yes | - | Safe area insets from `react-native-safe-area-context` (use `useSafeAreaInsets()`). |
|
|
122
|
+
| **onClose** | `() => void` | ❌ No | - | Callback triggered when the player is closed. |
|
|
123
|
+
| **isFocused** | `boolean` | ❌ No | `true` | Controls playback focus. Automatically pauses when the screen is not active. |
|
|
124
|
+
| **seekTime** | `number \| null` | ❌ No | `null` | Starts playback from a given time (in seconds). |
|
|
125
|
+
| **mode** | `'fullscreen' \| 'normal'` | ❌ No | `'fullscreen'` | Sets the display mode of the player. |
|
|
126
|
+
| **autoNext** | `boolean` | ❌ No | `true` | Automatically plays the next episode/video after completion. |
|
|
127
|
+
| **event** | `{ onPressEpisode?: ({ episode }: { episode: MediaEpisode }) => Promise<boolean> }` | ❌ No | - | Event hooks for custom handling (e.g. episode selection, subscription checks). |
|
|
128
|
+
| **theme** | `Partial<VideoPlayerTheme>` | ❌ No | - | Customize the look & feel of the player (colors, metrics, etc.). |
|
|
129
|
+
| **onWatchProgress** | `(progress: ExtendedWatchProgress) => void` | ❌ No | - | Reports playback analytics such as watch time, current time, and completion. |
|
|
130
|
+
| **ads** | `VideoAd[]` | ❌ No | `[]` | Array of video ads to display (pre-roll, mid-roll, post-roll). |
|
|
131
|
+
| **onAdEnd** | `(ad: VideoAd) => void` | ❌ No | - | Callback fired when an ad finishes playing. |
|
|
132
|
+
| **onAdError** | `(error: Error, ad: VideoAd) => void` | ❌ No | - | Callback fired when an ad encounters an error. |
|
|
133
|
+
| **onAdTracking** | `({ ad, trackingUrl, event }: { ad: VideoAd; trackingUrl: string; event: string }) => void` | ❌ No | - | Callback for ad tracking events (impression, start, quartiles, complete, skip, click). |
|
|
134
|
+
|
|
135
|
+
### 📢 VideoAd Interface
|
|
136
|
+
|
|
137
|
+
The `VideoAd` interface defines the structure for video advertisements:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
interface VideoAd {
|
|
141
|
+
id: string; // Unique identifier for the ad
|
|
142
|
+
title: string; // Ad title
|
|
143
|
+
description: string; // Ad description
|
|
144
|
+
position: 'pre' | 'mid' | 'post'; // Ad position: pre-roll, mid-roll, or post-roll
|
|
145
|
+
source: string; // Video source URL (MP4 or HLS)
|
|
146
|
+
duration: number; // Ad duration in seconds
|
|
147
|
+
time?: number; // For mid-roll ads: time in seconds when ad should play
|
|
148
|
+
skippable: boolean; // Whether the ad can be skipped
|
|
149
|
+
skipAfter: number; // Seconds after which skip button appears (if skippable)
|
|
150
|
+
clickThroughUrl?: string; // Optional URL to open when ad is clicked
|
|
151
|
+
tracking?: AdTracking; // Optional tracking URLs for ad events
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface AdTracking {
|
|
155
|
+
impression?: string; // Fired when ad is displayed
|
|
156
|
+
start?: string; // Fired when ad playback starts
|
|
157
|
+
firstQuartile?: string; // Fired at 25% of ad duration
|
|
158
|
+
midpoint?: string; // Fired at 50% of ad duration
|
|
159
|
+
thirdQuartile?: string; // Fired at 75% of ad duration
|
|
160
|
+
complete?: string; // Fired when ad completes
|
|
161
|
+
skip?: string; // Fired when ad is skipped
|
|
162
|
+
click?: string; // Fired when ad is clicked
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Ad Position Types:**
|
|
167
|
+
|
|
168
|
+
- `'pre'` - Pre-roll ad: Plays before the main video content
|
|
169
|
+
- `'mid'` - Mid-roll ad: Plays during the video at the specified `time`
|
|
170
|
+
- `'post'` - Post-roll ad: Plays after the main video content completes
|
|
48
171
|
|
|
49
172
|
---
|
|
50
173
|
|
|
@@ -55,10 +178,14 @@ npm install @zezosoft/zezo-ott-react-native-video-player
|
|
|
55
178
|
```tsx
|
|
56
179
|
import React from 'react';
|
|
57
180
|
import { VideoPlayer } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
181
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
58
182
|
|
|
59
183
|
export default function App() {
|
|
184
|
+
const insets = useSafeAreaInsets();
|
|
185
|
+
|
|
60
186
|
return (
|
|
61
187
|
<VideoPlayer
|
|
188
|
+
insets={insets}
|
|
62
189
|
isFocused={true}
|
|
63
190
|
onClose={() => console.log('Player closed')}
|
|
64
191
|
autoNext={true}
|
|
@@ -73,32 +200,56 @@ export default function App() {
|
|
|
73
200
|
### 🔄 Auto-Next Episodes
|
|
74
201
|
|
|
75
202
|
```tsx
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
203
|
+
import React from 'react';
|
|
204
|
+
import { VideoPlayer } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
205
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
206
|
+
|
|
207
|
+
export default function VideoPlayerScreen() {
|
|
208
|
+
const insets = useSafeAreaInsets();
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<VideoPlayer
|
|
212
|
+
insets={insets}
|
|
213
|
+
autoNext={true}
|
|
214
|
+
event={{
|
|
215
|
+
onPressEpisode: async ({ episode }) => {
|
|
216
|
+
console.log('Next episode:', episode.title);
|
|
217
|
+
// Add your custom logic here (e.g., subscription check)
|
|
218
|
+
// return false to block playback
|
|
219
|
+
return true;
|
|
220
|
+
},
|
|
221
|
+
}}
|
|
222
|
+
/>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
85
225
|
```
|
|
86
226
|
|
|
87
|
-
### 🎨 Theming
|
|
227
|
+
### 🎨 Custom Theming
|
|
88
228
|
|
|
89
229
|
```tsx
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
230
|
+
import React from 'react';
|
|
231
|
+
import { VideoPlayer } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
232
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
233
|
+
|
|
234
|
+
export default function ThemedPlayer() {
|
|
235
|
+
const insets = useSafeAreaInsets();
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<VideoPlayer
|
|
239
|
+
insets={insets}
|
|
240
|
+
theme={{
|
|
241
|
+
colors: {
|
|
242
|
+
primary: '#E50914',
|
|
243
|
+
background: '#000000',
|
|
244
|
+
onBackground: '#FFFFFF',
|
|
245
|
+
},
|
|
246
|
+
metrics: {
|
|
247
|
+
controlButtonSize: 42,
|
|
248
|
+
},
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
102
253
|
```
|
|
103
254
|
|
|
104
255
|
### 📺 Playlist & Seasons Setup
|
|
@@ -120,10 +271,14 @@ export default function ContentDetailsScreen({ contentData }) {
|
|
|
120
271
|
const navigation = useNavigation();
|
|
121
272
|
|
|
122
273
|
const handlePlay = () => {
|
|
274
|
+
// Always reset store before loading new content
|
|
123
275
|
resetStore();
|
|
276
|
+
|
|
277
|
+
// Set seasons data
|
|
124
278
|
setContentSeasons(contentData.seasons);
|
|
125
279
|
setActiveSeason(contentData.seasons[0]);
|
|
126
280
|
|
|
281
|
+
// Create playlist from episodes
|
|
127
282
|
const playlist = contentData.seasons[0].episodes.map((ep) => ({
|
|
128
283
|
id: ep.id,
|
|
129
284
|
title: ep.name,
|
|
@@ -132,10 +287,12 @@ export default function ContentDetailsScreen({ contentData }) {
|
|
|
132
287
|
type: contentData.type,
|
|
133
288
|
}));
|
|
134
289
|
|
|
290
|
+
// Set playlist and active track
|
|
135
291
|
setPlayList(playlist);
|
|
136
292
|
setCurrentTrackIndex(0);
|
|
137
293
|
setActiveTrack(playlist[0]);
|
|
138
294
|
|
|
295
|
+
// Navigate to player screen
|
|
139
296
|
navigation.navigate('VideoPlayerScreen');
|
|
140
297
|
};
|
|
141
298
|
|
|
@@ -146,36 +303,123 @@ export default function ContentDetailsScreen({ contentData }) {
|
|
|
146
303
|
```tsx
|
|
147
304
|
// VideoPlayerScreen.tsx
|
|
148
305
|
import { VideoPlayer } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
306
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
149
307
|
|
|
150
308
|
export default function VideoPlayerScreen() {
|
|
151
|
-
|
|
309
|
+
const insets = useSafeAreaInsets();
|
|
310
|
+
|
|
311
|
+
return <VideoPlayer insets={insets} isFocused={true} autoNext={true} />;
|
|
152
312
|
}
|
|
153
313
|
```
|
|
154
314
|
|
|
155
|
-
|
|
315
|
+
### 📢 Ads Player
|
|
156
316
|
|
|
157
|
-
|
|
317
|
+
```tsx
|
|
318
|
+
import React from 'react';
|
|
319
|
+
import {
|
|
320
|
+
VideoPlayer,
|
|
321
|
+
type VideoAd,
|
|
322
|
+
} from '@zezosoft/zezo-ott-react-native-video-player';
|
|
323
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
324
|
+
|
|
325
|
+
export default function VideoPlayerWithAds() {
|
|
326
|
+
const insets = useSafeAreaInsets();
|
|
327
|
+
|
|
328
|
+
const ads: VideoAd[] = [
|
|
329
|
+
{
|
|
330
|
+
id: 'ad1',
|
|
331
|
+
title: 'Pre-roll Ad',
|
|
332
|
+
description: 'Advertisement',
|
|
333
|
+
position: 'pre',
|
|
334
|
+
source: 'https://example.com/ad.mp4',
|
|
335
|
+
duration: 30,
|
|
336
|
+
skippable: true,
|
|
337
|
+
skipAfter: 5,
|
|
338
|
+
clickThroughUrl: 'https://example.com',
|
|
339
|
+
tracking: {
|
|
340
|
+
impression: 'https://example.com/track/impression',
|
|
341
|
+
start: 'https://example.com/track/start',
|
|
342
|
+
firstQuartile: 'https://example.com/track/firstQuartile',
|
|
343
|
+
midpoint: 'https://example.com/track/midpoint',
|
|
344
|
+
thirdQuartile: 'https://example.com/track/thirdQuartile',
|
|
345
|
+
complete: 'https://example.com/track/complete',
|
|
346
|
+
skip: 'https://example.com/track/skip',
|
|
347
|
+
click: 'https://example.com/track/click',
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: 'ad2',
|
|
352
|
+
title: 'Mid-roll Ad',
|
|
353
|
+
description: 'Advertisement',
|
|
354
|
+
position: 'mid',
|
|
355
|
+
source: 'https://example.com/mid-ad.mp4',
|
|
356
|
+
duration: 15,
|
|
357
|
+
time: 300, // Show at 5 minutes (300 seconds)
|
|
358
|
+
skippable: false,
|
|
359
|
+
skipAfter: 0,
|
|
360
|
+
tracking: {
|
|
361
|
+
impression: 'https://example.com/track/mid/impression',
|
|
362
|
+
complete: 'https://example.com/track/mid/complete',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: 'ad3',
|
|
367
|
+
title: 'Post-roll Ad',
|
|
368
|
+
description: 'Advertisement',
|
|
369
|
+
position: 'post',
|
|
370
|
+
source: 'https://example.com/post-ad.mp4',
|
|
371
|
+
duration: 20,
|
|
372
|
+
skippable: true,
|
|
373
|
+
skipAfter: 10,
|
|
374
|
+
tracking: {
|
|
375
|
+
impression: 'https://example.com/track/post/impression',
|
|
376
|
+
complete: 'https://example.com/track/post/complete',
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
];
|
|
158
380
|
|
|
159
|
-
|
|
160
|
-
|
|
381
|
+
return (
|
|
382
|
+
<VideoPlayer
|
|
383
|
+
insets={insets}
|
|
384
|
+
isFocused={true}
|
|
385
|
+
ads={ads}
|
|
386
|
+
onAdEnd={(ad) => {
|
|
387
|
+
console.log('Ad finished:', ad.title);
|
|
388
|
+
}}
|
|
389
|
+
onAdError={(error, ad) => {
|
|
390
|
+
console.error('Ad error:', error, ad.title);
|
|
391
|
+
}}
|
|
392
|
+
onAdTracking={({ ad, trackingUrl, event }) => {
|
|
393
|
+
console.log('Ad tracking:', event, trackingUrl);
|
|
394
|
+
// Make tracking request to your ad server
|
|
395
|
+
fetch(trackingUrl).catch(console.error);
|
|
396
|
+
}}
|
|
397
|
+
onClose={() => console.log('Player closed')}
|
|
398
|
+
/>
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
```
|
|
161
402
|
|
|
162
403
|
---
|
|
163
404
|
|
|
164
|
-
##
|
|
405
|
+
## 🗄️ Video Player Store
|
|
165
406
|
|
|
166
|
-
|
|
167
|
-
- Handle **tracks**: audio, subtitles, video quality
|
|
168
|
-
- Control **UI state**: controls visibility, settings modal, skip/next episode
|
|
169
|
-
- Track **content structure**: playlists, seasons, active season/episode
|
|
170
|
-
- Support **analytics**: watch time, view count, error handling
|
|
407
|
+
The **VideoPlayerStore** is a centralized Zustand store that powers the ZezoOTT Video Player. It manages playback state, tracks, UI controls, analytics, and content navigation.
|
|
171
408
|
|
|
172
|
-
|
|
409
|
+
### 🚀 Store Features
|
|
173
410
|
|
|
174
|
-
|
|
411
|
+
- **Playback State**: current time, duration, buffering, playback rate
|
|
412
|
+
- **Tracks Management**: audio tracks, subtitles, video quality
|
|
413
|
+
- **UI State**: controls visibility, settings modal, skip/next episode indicators
|
|
414
|
+
- **Content Structure**: playlists, seasons, active season/episode
|
|
415
|
+
- **Analytics**: watch time tracking, view count, error handling
|
|
416
|
+
|
|
417
|
+
### ⚡ Store Usage Example
|
|
175
418
|
|
|
176
419
|
```tsx
|
|
177
420
|
import { useVideoPlayerStore } from '@zezosoft/zezo-ott-react-native-video-player';
|
|
178
421
|
import React from 'react';
|
|
422
|
+
import { View, Pressable, Text, FlatList } from 'react-native';
|
|
179
423
|
|
|
180
424
|
export default function VideoPlayerExample() {
|
|
181
425
|
const {
|
|
@@ -234,61 +478,74 @@ export default function VideoPlayerExample() {
|
|
|
234
478
|
};
|
|
235
479
|
|
|
236
480
|
return (
|
|
237
|
-
<
|
|
238
|
-
<
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
481
|
+
<View>
|
|
482
|
+
<Pressable onPress={setupPlayer}>
|
|
483
|
+
<Text>Load Series</Text>
|
|
484
|
+
</Pressable>
|
|
485
|
+
<Text>Active Season: {activeSeason?.name}</Text>
|
|
486
|
+
<FlatList
|
|
487
|
+
data={playList}
|
|
488
|
+
keyExtractor={(track) => track.id}
|
|
489
|
+
renderItem={({ item: track }) => (
|
|
490
|
+
<Text>
|
|
243
491
|
{track.title} {activeTrack?.id === track.id ? '(Playing)' : ''}
|
|
244
|
-
</
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
</
|
|
492
|
+
</Text>
|
|
493
|
+
)}
|
|
494
|
+
/>
|
|
495
|
+
</View>
|
|
248
496
|
);
|
|
249
497
|
}
|
|
250
498
|
```
|
|
251
499
|
|
|
252
500
|
---
|
|
253
501
|
|
|
254
|
-
## 📝
|
|
502
|
+
## 📝 Best Practices
|
|
255
503
|
|
|
256
|
-
- 🔄 **Always call `resetStore()`** before loading new content
|
|
257
|
-
- 🎚️ **Playback rate** requires both `rate` and `label` in sync
|
|
258
|
-
- 🕹️ **Controls auto-hide** is managed by `controlsTimer
|
|
259
|
-
- 🌐 **Track selections** depend on available `OnLoadData` — always null-check
|
|
260
|
-
- 📊 **Analytics props** integrate with your analytics pipeline
|
|
261
|
-
- ⚠️ **Error handling**: Use `setError` for surfacing playback issues
|
|
262
|
-
- 🎬 **Seasons & episodes**: Update both `contentSeasons` and `activeSeason` before setting playlist
|
|
504
|
+
- 🔄 **Always call `resetStore()`** before loading new content to prevent state conflicts
|
|
505
|
+
- 🎚️ **Playback rate** requires both `rate` and `label` to be in sync
|
|
506
|
+
- 🕹️ **Controls auto-hide** is managed by `controlsTimer` in the store
|
|
507
|
+
- 🌐 **Track selections** depend on available `OnLoadData` — always null-check before using
|
|
508
|
+
- 📊 **Analytics props** integrate seamlessly with your analytics pipeline
|
|
509
|
+
- ⚠️ **Error handling**: Use `setError` from the store for surfacing playback issues
|
|
510
|
+
- 🎬 **Seasons & episodes**: Update both `contentSeasons` and `activeSeason` before setting playlist
|
|
511
|
+
- 📢 **Ads**: Ensure ad sources are valid and tracking URLs are properly configured
|
|
512
|
+
- 🔒 **Type safety**: Leverage TypeScript types for better development experience
|
|
263
513
|
|
|
264
514
|
---
|
|
265
515
|
|
|
266
|
-
##
|
|
516
|
+
## 🔧 Troubleshooting
|
|
267
517
|
|
|
268
|
-
|
|
518
|
+
### Fullscreen Not Working
|
|
269
519
|
|
|
270
|
-
|
|
271
|
-
yarn add react-native-orientation-locker
|
|
272
|
-
# or
|
|
273
|
-
npm install react-native-orientation-locker
|
|
274
|
-
```
|
|
520
|
+
**react-native-orientation-locker** is included in this package. If fullscreen or orientation lock doesn't work:
|
|
275
521
|
|
|
276
|
-
|
|
522
|
+
1. Rebuild the native app after installing the library.
|
|
523
|
+
2. On Android, ensure your `AndroidManifest.xml` allows the orientations you need.
|
|
524
|
+
3. If you use a custom native setup, link the library per its documentation.
|
|
277
525
|
|
|
278
|
-
|
|
526
|
+
#### Known Issues
|
|
279
527
|
|
|
280
528
|
If you encounter any problems with react-native-orientation-locker, check the official issues page:
|
|
281
529
|
[View Known Issues](https://github.com/wonday/react-native-orientation-locker/issues)
|
|
282
530
|
|
|
283
|
-
|
|
531
|
+
#### Setup & Installation
|
|
284
532
|
|
|
285
533
|
Follow the official guide to properly set up react-native-orientation-locker:
|
|
286
534
|
[View Setup Guide](https://github.com/wonday/react-native-orientation-locker)
|
|
287
535
|
|
|
536
|
+
### Common Issues
|
|
537
|
+
|
|
538
|
+
1. **Player not showing**: Ensure you've set up the store with `activeTrack` before rendering
|
|
539
|
+
2. **Ads not playing**: Verify ad sources are accessible and `position` is correctly set
|
|
540
|
+
3. **Controls not visible**: Check `isFocused` prop and ensure screen is active
|
|
541
|
+
4. **TypeScript errors**: Make sure all peer dependencies are installed
|
|
542
|
+
|
|
288
543
|
---
|
|
289
544
|
|
|
290
545
|
## 🔗 Demo App
|
|
291
546
|
|
|
547
|
+
Check out our demo app to see the player in action:
|
|
548
|
+
|
|
292
549
|
👉 [Zezo OTT Demo App](https://github.com/Zezo-Soft/zezo-ott-demo-app)
|
|
293
550
|
|
|
294
551
|
---
|