@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.
Files changed (337) hide show
  1. package/README.md +342 -85
  2. package/lib/module/AdsPlayer/AdsPlayer.js +244 -0
  3. package/lib/module/AdsPlayer/AdsPlayer.js.map +1 -0
  4. package/lib/module/AdsPlayer/MediaControls/AdBottomControls.js +176 -0
  5. package/lib/module/AdsPlayer/MediaControls/AdBottomControls.js.map +1 -0
  6. package/lib/module/AdsPlayer/MediaControls/AdMediaControls.js +96 -0
  7. package/lib/module/AdsPlayer/MediaControls/AdMediaControls.js.map +1 -0
  8. package/lib/module/AdsPlayer/MediaControls/AdMediaControlsProvider.js +34 -0
  9. package/lib/module/AdsPlayer/MediaControls/AdMediaControlsProvider.js.map +1 -0
  10. package/lib/module/AdsPlayer/MediaControls/AdMiddleControls.js +65 -0
  11. package/lib/module/AdsPlayer/MediaControls/AdMiddleControls.js.map +1 -0
  12. package/lib/module/AdsPlayer/MediaControls/AdTopControls.js +177 -0
  13. package/lib/module/AdsPlayer/MediaControls/AdTopControls.js.map +1 -0
  14. package/lib/module/AdsPlayer/MediaControls/index.js +8 -0
  15. package/lib/module/AdsPlayer/MediaControls/index.js.map +1 -0
  16. package/lib/module/AdsPlayer/components/RotatingLoader.js +55 -0
  17. package/lib/module/AdsPlayer/components/RotatingLoader.js.map +1 -0
  18. package/lib/module/AdsPlayer/index.js +6 -0
  19. package/lib/module/AdsPlayer/index.js.map +1 -0
  20. package/lib/module/AdsPlayer/store/adsPlayer.type.js +4 -0
  21. package/lib/module/AdsPlayer/store/adsPlayer.type.js.map +1 -0
  22. package/lib/module/AdsPlayer/store/adsPlayerStore.js +70 -0
  23. package/lib/module/AdsPlayer/store/adsPlayerStore.js.map +1 -0
  24. package/lib/module/AdsPlayer/store/index.js +5 -0
  25. package/lib/module/AdsPlayer/store/index.js.map +1 -0
  26. package/lib/module/AdsPlayer/utils/adStateReset.js +31 -0
  27. package/lib/module/AdsPlayer/utils/adStateReset.js.map +1 -0
  28. package/lib/module/AdsPlayer/utils/controls.js +63 -0
  29. package/lib/module/AdsPlayer/utils/controls.js.map +1 -0
  30. package/lib/module/AdsPlayer/utils/useAdControlsAutoHide.js +35 -0
  31. package/lib/module/AdsPlayer/utils/useAdControlsAutoHide.js.map +1 -0
  32. package/lib/module/AdsPlayer/utils/useAdInitialization.js +60 -0
  33. package/lib/module/AdsPlayer/utils/useAdInitialization.js.map +1 -0
  34. package/lib/module/AdsPlayer/utils/useAdTracking.js +50 -0
  35. package/lib/module/AdsPlayer/utils/useAdTracking.js.map +1 -0
  36. package/lib/module/AdsPlayer/utils/useAdsManager.js +165 -0
  37. package/lib/module/AdsPlayer/utils/useAdsManager.js.map +1 -0
  38. package/lib/module/VideoPlayer/MediaControls/BottomControls.js +32 -13
  39. package/lib/module/VideoPlayer/MediaControls/BottomControls.js.map +1 -1
  40. package/lib/module/VideoPlayer/MediaControls/MediaControls.js +4 -3
  41. package/lib/module/VideoPlayer/MediaControls/MediaControls.js.map +1 -1
  42. package/lib/module/VideoPlayer/MediaControls/MediaControlsProvider.js +31 -31
  43. package/lib/module/VideoPlayer/MediaControls/MediaControlsProvider.js.map +1 -1
  44. package/lib/module/VideoPlayer/MediaControls/MiddleControls.js +50 -40
  45. package/lib/module/VideoPlayer/MediaControls/MiddleControls.js.map +1 -1
  46. package/lib/module/VideoPlayer/MediaControls/TopControls.js +7 -12
  47. package/lib/module/VideoPlayer/MediaControls/TopControls.js.map +1 -1
  48. package/lib/module/VideoPlayer/{model → Settings}/AudioAndSubtitles.js +0 -14
  49. package/lib/module/VideoPlayer/Settings/AudioAndSubtitles.js.map +1 -0
  50. package/lib/module/VideoPlayer/{model → Settings}/Episodes.js +1 -1
  51. package/lib/module/VideoPlayer/Settings/Episodes.js.map +1 -0
  52. package/lib/module/VideoPlayer/{model → Settings}/SettingModal.js +0 -1
  53. package/lib/module/VideoPlayer/Settings/SettingModal.js.map +1 -0
  54. package/lib/module/VideoPlayer/{model → Settings}/SpeedControls.js +1 -9
  55. package/lib/module/VideoPlayer/Settings/SpeedControls.js.map +1 -0
  56. package/lib/module/VideoPlayer/{model → Settings}/VideoPlayerSettings.js +1 -1
  57. package/lib/module/VideoPlayer/Settings/VideoPlayerSettings.js.map +1 -0
  58. package/lib/module/VideoPlayer/VideoPlayerCore.js +244 -0
  59. package/lib/module/VideoPlayer/VideoPlayerCore.js.map +1 -0
  60. package/lib/module/VideoPlayer/components/ProgressBar.js +99 -24
  61. package/lib/module/VideoPlayer/components/ProgressBar.js.map +1 -1
  62. package/lib/module/VideoPlayer/components/SkipAndNextControls.js +1 -6
  63. package/lib/module/VideoPlayer/components/SkipAndNextControls.js.map +1 -1
  64. package/lib/module/VideoPlayer/components/SubtitleView.js +1 -1
  65. package/lib/module/VideoPlayer/components/SubtitleView.js.map +1 -1
  66. package/lib/module/VideoPlayer/components/Toast.js +57 -0
  67. package/lib/module/VideoPlayer/components/Toast.js.map +1 -0
  68. package/lib/module/VideoPlayer/index.js +1 -1
  69. package/lib/module/VideoPlayer/index.js.map +1 -1
  70. package/lib/module/VideoPlayer/store/videoPlayerStore.js +0 -4
  71. package/lib/module/VideoPlayer/store/videoPlayerStore.js.map +1 -1
  72. package/lib/module/VideoPlayer/{Styles → styles}/globalStyles.js +5 -6
  73. package/lib/module/VideoPlayer/styles/globalStyles.js.map +1 -0
  74. package/lib/module/VideoPlayer/utils/{Display.js → display/Display.js} +0 -4
  75. package/lib/module/VideoPlayer/utils/display/Display.js.map +1 -0
  76. package/lib/module/VideoPlayer/utils/display/index.js +4 -0
  77. package/lib/module/VideoPlayer/utils/display/index.js.map +1 -0
  78. package/lib/module/VideoPlayer/utils/format/index.js +4 -0
  79. package/lib/module/VideoPlayer/utils/format/index.js.map +1 -0
  80. package/lib/module/VideoPlayer/utils/{timeFormatter.js → format/timeFormatter.js} +0 -6
  81. package/lib/module/VideoPlayer/utils/format/timeFormatter.js.map +1 -0
  82. package/lib/module/VideoPlayer/utils/hooks/index.js +3 -0
  83. package/lib/module/VideoPlayer/utils/hooks/index.js.map +1 -1
  84. package/lib/module/VideoPlayer/utils/hooks/useAdEventHandler.js +56 -0
  85. package/lib/module/VideoPlayer/utils/hooks/useAdEventHandler.js.map +1 -0
  86. package/lib/module/VideoPlayer/utils/hooks/useOrientationLock.js +25 -0
  87. package/lib/module/VideoPlayer/utils/hooks/useOrientationLock.js.map +1 -0
  88. package/lib/module/VideoPlayer/utils/hooks/usePauseVideoOnAd.js +43 -0
  89. package/lib/module/VideoPlayer/utils/hooks/usePauseVideoOnAd.js.map +1 -0
  90. package/lib/module/VideoPlayer/utils/hooks/useVideoPlayerBack.js +3 -4
  91. package/lib/module/VideoPlayer/utils/hooks/useVideoPlayerBack.js.map +1 -1
  92. package/lib/module/VideoPlayer/utils/hooks/useVideoResolutions.js +12 -11
  93. package/lib/module/VideoPlayer/utils/hooks/useVideoResolutions.js.map +1 -1
  94. package/lib/module/VideoPlayer/utils/index.js +5 -6
  95. package/lib/module/VideoPlayer/utils/index.js.map +1 -1
  96. package/lib/module/VideoPlayer/utils/{PlatformSelector.js → platform/PlatformSelector.js} +0 -5
  97. package/lib/module/VideoPlayer/utils/platform/PlatformSelector.js.map +1 -0
  98. package/lib/module/VideoPlayer/utils/platform/index.js +5 -0
  99. package/lib/module/VideoPlayer/utils/platform/index.js.map +1 -0
  100. package/lib/module/VideoPlayer/utils/{lockOrientation.js → platform/lockOrientation.js} +13 -5
  101. package/lib/module/VideoPlayer/utils/platform/lockOrientation.js.map +1 -0
  102. package/lib/module/VideoPlayer/utils/player/index.js +5 -0
  103. package/lib/module/VideoPlayer/utils/player/index.js.map +1 -0
  104. package/lib/module/VideoPlayer/utils/{playerEvents.js → player/playerEvents.js} +3 -3
  105. package/lib/module/VideoPlayer/utils/player/playerEvents.js.map +1 -0
  106. package/lib/module/VideoPlayer/utils/{useWatchReporter.js → player/useWatchReporter.js} +3 -2
  107. package/lib/module/VideoPlayer/utils/player/useWatchReporter.js.map +1 -0
  108. package/lib/module/VideoPlayer/utils/video/index.js +8 -0
  109. package/lib/module/VideoPlayer/utils/video/index.js.map +1 -0
  110. package/lib/module/VideoPlayer/utils/{videoControl.js → video/videoControl.js} +1 -14
  111. package/lib/module/VideoPlayer/utils/video/videoControl.js.map +1 -0
  112. package/lib/module/VideoPlayer/utils/video/videoRef.js +20 -0
  113. package/lib/module/VideoPlayer/utils/video/videoRef.js.map +1 -0
  114. package/lib/module/VideoPlayer/utils/video/videoResume.js +29 -0
  115. package/lib/module/VideoPlayer/utils/video/videoResume.js.map +1 -0
  116. package/lib/module/VideoPlayer/utils/video/videoSource.js.map +1 -0
  117. package/lib/module/VideoPlayer.js +140 -0
  118. package/lib/module/VideoPlayer.js.map +1 -0
  119. package/lib/module/index.js +3 -1
  120. package/lib/module/index.js.map +1 -1
  121. package/lib/typescript/src/AdsPlayer/AdsPlayer.d.ts +22 -0
  122. package/lib/typescript/src/AdsPlayer/AdsPlayer.d.ts.map +1 -0
  123. package/lib/typescript/src/AdsPlayer/MediaControls/AdBottomControls.d.ts +4 -0
  124. package/lib/typescript/src/AdsPlayer/MediaControls/AdBottomControls.d.ts.map +1 -0
  125. package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControls.d.ts +8 -0
  126. package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControls.d.ts.map +1 -0
  127. package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControlsProvider.d.ts +26 -0
  128. package/lib/typescript/src/AdsPlayer/MediaControls/AdMediaControlsProvider.d.ts.map +1 -0
  129. package/lib/typescript/src/AdsPlayer/MediaControls/AdMiddleControls.d.ts +4 -0
  130. package/lib/typescript/src/AdsPlayer/MediaControls/AdMiddleControls.d.ts.map +1 -0
  131. package/lib/typescript/src/AdsPlayer/MediaControls/AdTopControls.d.ts +7 -0
  132. package/lib/typescript/src/AdsPlayer/MediaControls/AdTopControls.d.ts.map +1 -0
  133. package/lib/typescript/src/AdsPlayer/MediaControls/index.d.ts +6 -0
  134. package/lib/typescript/src/AdsPlayer/MediaControls/index.d.ts.map +1 -0
  135. package/lib/typescript/src/AdsPlayer/components/RotatingLoader.d.ts +12 -0
  136. package/lib/typescript/src/AdsPlayer/components/RotatingLoader.d.ts.map +1 -0
  137. package/lib/typescript/src/AdsPlayer/index.d.ts +5 -0
  138. package/lib/typescript/src/AdsPlayer/index.d.ts.map +1 -0
  139. package/lib/typescript/src/AdsPlayer/store/adsPlayer.type.d.ts +28 -0
  140. package/lib/typescript/src/AdsPlayer/store/adsPlayer.type.d.ts.map +1 -0
  141. package/lib/typescript/src/AdsPlayer/store/adsPlayerStore.d.ts +22 -0
  142. package/lib/typescript/src/AdsPlayer/store/adsPlayerStore.d.ts.map +1 -0
  143. package/lib/typescript/src/AdsPlayer/store/index.d.ts +3 -0
  144. package/lib/typescript/src/AdsPlayer/store/index.d.ts.map +1 -0
  145. package/lib/typescript/src/AdsPlayer/utils/adStateReset.d.ts +6 -0
  146. package/lib/typescript/src/AdsPlayer/utils/adStateReset.d.ts.map +1 -0
  147. package/lib/typescript/src/AdsPlayer/utils/controls.d.ts +13 -0
  148. package/lib/typescript/src/AdsPlayer/utils/controls.d.ts.map +1 -0
  149. package/lib/typescript/src/AdsPlayer/utils/useAdControlsAutoHide.d.ts +3 -0
  150. package/lib/typescript/src/AdsPlayer/utils/useAdControlsAutoHide.d.ts.map +1 -0
  151. package/lib/typescript/src/AdsPlayer/utils/useAdInitialization.d.ts +20 -0
  152. package/lib/typescript/src/AdsPlayer/utils/useAdInitialization.d.ts.map +1 -0
  153. package/lib/typescript/src/AdsPlayer/utils/useAdTracking.d.ts +23 -0
  154. package/lib/typescript/src/AdsPlayer/utils/useAdTracking.d.ts.map +1 -0
  155. package/lib/typescript/src/AdsPlayer/utils/useAdsManager.d.ts +9 -0
  156. package/lib/typescript/src/AdsPlayer/utils/useAdsManager.d.ts.map +1 -0
  157. package/lib/typescript/src/VideoPlayer/MediaControls/BottomControls.d.ts.map +1 -1
  158. package/lib/typescript/src/VideoPlayer/MediaControls/MediaControlsProvider.d.ts +3 -1
  159. package/lib/typescript/src/VideoPlayer/MediaControls/MediaControlsProvider.d.ts.map +1 -1
  160. package/lib/typescript/src/VideoPlayer/MediaControls/MiddleControls.d.ts +2 -1
  161. package/lib/typescript/src/VideoPlayer/MediaControls/MiddleControls.d.ts.map +1 -1
  162. package/lib/typescript/src/VideoPlayer/MediaControls/TopControls.d.ts.map +1 -1
  163. package/lib/typescript/src/VideoPlayer/Settings/AudioAndSubtitles.d.ts.map +1 -0
  164. package/lib/typescript/src/VideoPlayer/{model → Settings}/Episodes.d.ts +1 -1
  165. package/lib/typescript/src/VideoPlayer/Settings/Episodes.d.ts.map +1 -0
  166. package/lib/typescript/src/VideoPlayer/{model → Settings}/SettingModal.d.ts +1 -1
  167. package/lib/typescript/src/VideoPlayer/Settings/SettingModal.d.ts.map +1 -0
  168. package/lib/typescript/src/VideoPlayer/Settings/SpeedControls.d.ts.map +1 -0
  169. package/lib/typescript/src/VideoPlayer/Settings/VideoPlayerSettings.d.ts.map +1 -0
  170. package/lib/typescript/src/VideoPlayer/{VideoPlayer.d.ts → VideoPlayerCore.d.ts} +10 -7
  171. package/lib/typescript/src/VideoPlayer/VideoPlayerCore.d.ts.map +1 -0
  172. package/lib/typescript/src/VideoPlayer/components/ProgressBar.d.ts +3 -1
  173. package/lib/typescript/src/VideoPlayer/components/ProgressBar.d.ts.map +1 -1
  174. package/lib/typescript/src/VideoPlayer/components/SkipAndNextControls.d.ts +1 -1
  175. package/lib/typescript/src/VideoPlayer/components/SkipAndNextControls.d.ts.map +1 -1
  176. package/lib/typescript/src/VideoPlayer/components/Toast.d.ts +12 -0
  177. package/lib/typescript/src/VideoPlayer/components/Toast.d.ts.map +1 -0
  178. package/lib/typescript/src/VideoPlayer/index.d.ts +1 -1
  179. package/lib/typescript/src/VideoPlayer/index.d.ts.map +1 -1
  180. package/lib/typescript/src/VideoPlayer/store/videoPlayer.type.d.ts +25 -5
  181. package/lib/typescript/src/VideoPlayer/store/videoPlayer.type.d.ts.map +1 -1
  182. package/lib/typescript/src/VideoPlayer/store/videoPlayerStore.d.ts.map +1 -1
  183. package/lib/typescript/src/VideoPlayer/{Styles → styles}/globalStyles.d.ts +16 -9
  184. package/lib/typescript/src/VideoPlayer/styles/globalStyles.d.ts.map +1 -0
  185. package/lib/typescript/src/VideoPlayer/utils/display/Display.d.ts.map +1 -0
  186. package/lib/typescript/src/VideoPlayer/utils/display/index.d.ts +2 -0
  187. package/lib/typescript/src/VideoPlayer/utils/display/index.d.ts.map +1 -0
  188. package/lib/typescript/src/VideoPlayer/utils/format/index.d.ts +2 -0
  189. package/lib/typescript/src/VideoPlayer/utils/format/index.d.ts.map +1 -0
  190. package/lib/typescript/src/VideoPlayer/utils/{timeFormatter.d.ts → format/timeFormatter.d.ts} +0 -5
  191. package/lib/typescript/src/VideoPlayer/utils/format/timeFormatter.d.ts.map +1 -0
  192. package/lib/typescript/src/VideoPlayer/utils/hooks/index.d.ts +3 -0
  193. package/lib/typescript/src/VideoPlayer/utils/hooks/index.d.ts.map +1 -1
  194. package/lib/typescript/src/VideoPlayer/utils/hooks/useAdEventHandler.d.ts +34 -0
  195. package/lib/typescript/src/VideoPlayer/utils/hooks/useAdEventHandler.d.ts.map +1 -0
  196. package/lib/typescript/src/VideoPlayer/utils/hooks/useOrientationLock.d.ts +11 -0
  197. package/lib/typescript/src/VideoPlayer/utils/hooks/useOrientationLock.d.ts.map +1 -0
  198. package/lib/typescript/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.d.ts +6 -0
  199. package/lib/typescript/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.d.ts.map +1 -0
  200. package/lib/typescript/src/VideoPlayer/utils/hooks/useVideoResolutions.d.ts.map +1 -1
  201. package/lib/typescript/src/VideoPlayer/utils/index.d.ts +5 -6
  202. package/lib/typescript/src/VideoPlayer/utils/index.d.ts.map +1 -1
  203. package/lib/typescript/src/VideoPlayer/utils/{PlatformSelector.d.ts → platform/PlatformSelector.d.ts} +0 -4
  204. package/lib/typescript/src/VideoPlayer/utils/platform/PlatformSelector.d.ts.map +1 -0
  205. package/lib/typescript/src/VideoPlayer/utils/platform/index.d.ts +3 -0
  206. package/lib/typescript/src/VideoPlayer/utils/platform/index.d.ts.map +1 -0
  207. package/lib/typescript/src/VideoPlayer/utils/platform/lockOrientation.d.ts.map +1 -0
  208. package/lib/typescript/src/VideoPlayer/utils/player/index.d.ts +3 -0
  209. package/lib/typescript/src/VideoPlayer/utils/player/index.d.ts.map +1 -0
  210. package/lib/typescript/src/VideoPlayer/utils/{playerEvents.d.ts → player/playerEvents.d.ts} +1 -1
  211. package/lib/typescript/src/VideoPlayer/utils/player/playerEvents.d.ts.map +1 -0
  212. package/lib/typescript/src/VideoPlayer/utils/{useWatchReporter.d.ts → player/useWatchReporter.d.ts} +1 -6
  213. package/lib/typescript/src/VideoPlayer/utils/player/useWatchReporter.d.ts.map +1 -0
  214. package/lib/typescript/src/VideoPlayer/utils/video/index.d.ts +6 -0
  215. package/lib/typescript/src/VideoPlayer/utils/video/index.d.ts.map +1 -0
  216. package/lib/typescript/src/VideoPlayer/utils/{videoControl.d.ts → video/videoControl.d.ts} +1 -1
  217. package/lib/typescript/src/VideoPlayer/utils/video/videoControl.d.ts.map +1 -0
  218. package/lib/typescript/src/VideoPlayer/utils/video/videoRef.d.ts +19 -0
  219. package/lib/typescript/src/VideoPlayer/utils/video/videoRef.d.ts.map +1 -0
  220. package/lib/typescript/src/VideoPlayer/utils/video/videoResume.d.ts +6 -0
  221. package/lib/typescript/src/VideoPlayer/utils/video/videoResume.d.ts.map +1 -0
  222. package/lib/typescript/src/VideoPlayer/utils/{videoSource.d.ts → video/videoSource.d.ts} +1 -1
  223. package/lib/typescript/src/VideoPlayer/utils/video/videoSource.d.ts.map +1 -0
  224. package/lib/typescript/src/VideoPlayer.d.ts +31 -0
  225. package/lib/typescript/src/VideoPlayer.d.ts.map +1 -0
  226. package/lib/typescript/src/index.d.ts +3 -1
  227. package/lib/typescript/src/index.d.ts.map +1 -1
  228. package/package.json +128 -101
  229. package/src/AdsPlayer/AdsPlayer.tsx +311 -0
  230. package/src/AdsPlayer/MediaControls/AdBottomControls.tsx +191 -0
  231. package/src/AdsPlayer/MediaControls/AdMediaControls.tsx +104 -0
  232. package/src/AdsPlayer/MediaControls/AdMediaControlsProvider.tsx +62 -0
  233. package/src/AdsPlayer/MediaControls/AdMiddleControls.tsx +63 -0
  234. package/src/AdsPlayer/MediaControls/AdTopControls.tsx +191 -0
  235. package/src/AdsPlayer/MediaControls/index.ts +5 -0
  236. package/src/AdsPlayer/components/RotatingLoader.tsx +79 -0
  237. package/src/AdsPlayer/index.ts +4 -0
  238. package/src/AdsPlayer/store/adsPlayer.type.ts +29 -0
  239. package/src/AdsPlayer/store/adsPlayerStore.ts +59 -0
  240. package/src/AdsPlayer/store/index.ts +2 -0
  241. package/src/AdsPlayer/utils/adStateReset.ts +29 -0
  242. package/src/AdsPlayer/utils/controls.ts +69 -0
  243. package/src/AdsPlayer/utils/useAdControlsAutoHide.ts +32 -0
  244. package/src/AdsPlayer/utils/useAdInitialization.ts +86 -0
  245. package/src/AdsPlayer/utils/useAdTracking.ts +89 -0
  246. package/src/AdsPlayer/utils/useAdsManager.ts +215 -0
  247. package/src/VideoPlayer/MediaControls/BottomControls.tsx +34 -9
  248. package/src/VideoPlayer/MediaControls/MediaControls.tsx +4 -3
  249. package/src/VideoPlayer/MediaControls/MediaControlsProvider.tsx +40 -35
  250. package/src/VideoPlayer/MediaControls/MiddleControls.tsx +87 -60
  251. package/src/VideoPlayer/MediaControls/TopControls.tsx +16 -8
  252. package/src/VideoPlayer/{model → Settings}/AudioAndSubtitles.tsx +0 -7
  253. package/src/VideoPlayer/{model → Settings}/Episodes.tsx +6 -3
  254. package/src/VideoPlayer/{model → Settings}/SettingModal.tsx +1 -2
  255. package/src/VideoPlayer/{model → Settings}/SpeedControls.tsx +1 -5
  256. package/src/VideoPlayer/{model → Settings}/VideoPlayerSettings.tsx +1 -1
  257. package/src/VideoPlayer/VideoPlayerCore.tsx +356 -0
  258. package/src/VideoPlayer/components/ProgressBar.tsx +135 -22
  259. package/src/VideoPlayer/components/SkipAndNextControls.tsx +2 -5
  260. package/src/VideoPlayer/components/SubtitleView.tsx +1 -1
  261. package/src/VideoPlayer/components/Toast.tsx +61 -0
  262. package/src/VideoPlayer/index.ts +1 -1
  263. package/src/VideoPlayer/store/videoPlayer.type.ts +28 -6
  264. package/src/VideoPlayer/store/videoPlayerStore.ts +0 -4
  265. package/src/VideoPlayer/{Styles → styles}/globalStyles.ts +5 -6
  266. package/src/VideoPlayer/utils/{Display.ts → display/Display.ts} +0 -4
  267. package/src/VideoPlayer/utils/display/index.ts +1 -0
  268. package/src/VideoPlayer/utils/format/index.ts +1 -0
  269. package/src/VideoPlayer/utils/{timeFormatter.ts → format/timeFormatter.ts} +4 -7
  270. package/src/VideoPlayer/utils/hooks/index.ts +3 -0
  271. package/src/VideoPlayer/utils/hooks/useAdEventHandler.ts +95 -0
  272. package/src/VideoPlayer/utils/hooks/useOrientationLock.ts +29 -0
  273. package/src/VideoPlayer/utils/hooks/usePauseVideoOnAd.ts +46 -0
  274. package/src/VideoPlayer/utils/hooks/useVideoPlayerBack.ts +3 -3
  275. package/src/VideoPlayer/utils/hooks/useVideoResolutions.ts +18 -12
  276. package/src/VideoPlayer/utils/index.ts +5 -6
  277. package/src/VideoPlayer/utils/{PlatformSelector.ts → platform/PlatformSelector.ts} +0 -5
  278. package/src/VideoPlayer/utils/platform/index.ts +2 -0
  279. package/src/VideoPlayer/utils/{lockOrientation.ts → platform/lockOrientation.ts} +11 -5
  280. package/src/VideoPlayer/utils/player/index.ts +2 -0
  281. package/src/VideoPlayer/utils/{playerEvents.ts → player/playerEvents.ts} +4 -4
  282. package/src/VideoPlayer/utils/{useWatchReporter.ts → player/useWatchReporter.ts} +4 -3
  283. package/src/VideoPlayer/utils/video/index.ts +5 -0
  284. package/src/VideoPlayer/utils/{videoControl.ts → video/videoControl.ts} +2 -9
  285. package/src/VideoPlayer/utils/video/videoRef.ts +21 -0
  286. package/src/VideoPlayer/utils/video/videoResume.ts +23 -0
  287. package/src/VideoPlayer/utils/{videoSource.ts → video/videoSource.ts} +1 -1
  288. package/src/VideoPlayer.tsx +181 -0
  289. package/src/index.tsx +3 -1
  290. package/lib/module/VideoPlayer/Styles/fonts.js +0 -58
  291. package/lib/module/VideoPlayer/Styles/fonts.js.map +0 -1
  292. package/lib/module/VideoPlayer/Styles/globalStyles.js.map +0 -1
  293. package/lib/module/VideoPlayer/VideoPlayer.js +0 -180
  294. package/lib/module/VideoPlayer/VideoPlayer.js.map +0 -1
  295. package/lib/module/VideoPlayer/model/AudioAndSubtitles.js.map +0 -1
  296. package/lib/module/VideoPlayer/model/Episodes.js.map +0 -1
  297. package/lib/module/VideoPlayer/model/SettingModal.js.map +0 -1
  298. package/lib/module/VideoPlayer/model/SpeedControls.js.map +0 -1
  299. package/lib/module/VideoPlayer/model/VideoPlayerSettings.js.map +0 -1
  300. package/lib/module/VideoPlayer/utils/Display.js.map +0 -1
  301. package/lib/module/VideoPlayer/utils/PlatformSelector.js.map +0 -1
  302. package/lib/module/VideoPlayer/utils/lockOrientation.js.map +0 -1
  303. package/lib/module/VideoPlayer/utils/playerEvents.js.map +0 -1
  304. package/lib/module/VideoPlayer/utils/timeFormatter.js.map +0 -1
  305. package/lib/module/VideoPlayer/utils/useWatchReporter.js.map +0 -1
  306. package/lib/module/VideoPlayer/utils/videoControl.js.map +0 -1
  307. package/lib/module/VideoPlayer/utils/videoRef.js +0 -5
  308. package/lib/module/VideoPlayer/utils/videoRef.js.map +0 -1
  309. package/lib/module/VideoPlayer/utils/videoSource.js.map +0 -1
  310. package/lib/typescript/src/VideoPlayer/Styles/fonts.d.ts +0 -54
  311. package/lib/typescript/src/VideoPlayer/Styles/fonts.d.ts.map +0 -1
  312. package/lib/typescript/src/VideoPlayer/Styles/globalStyles.d.ts.map +0 -1
  313. package/lib/typescript/src/VideoPlayer/VideoPlayer.d.ts.map +0 -1
  314. package/lib/typescript/src/VideoPlayer/model/AudioAndSubtitles.d.ts.map +0 -1
  315. package/lib/typescript/src/VideoPlayer/model/Episodes.d.ts.map +0 -1
  316. package/lib/typescript/src/VideoPlayer/model/SettingModal.d.ts.map +0 -1
  317. package/lib/typescript/src/VideoPlayer/model/SpeedControls.d.ts.map +0 -1
  318. package/lib/typescript/src/VideoPlayer/model/VideoPlayerSettings.d.ts.map +0 -1
  319. package/lib/typescript/src/VideoPlayer/utils/Display.d.ts.map +0 -1
  320. package/lib/typescript/src/VideoPlayer/utils/PlatformSelector.d.ts.map +0 -1
  321. package/lib/typescript/src/VideoPlayer/utils/lockOrientation.d.ts.map +0 -1
  322. package/lib/typescript/src/VideoPlayer/utils/playerEvents.d.ts.map +0 -1
  323. package/lib/typescript/src/VideoPlayer/utils/timeFormatter.d.ts.map +0 -1
  324. package/lib/typescript/src/VideoPlayer/utils/useWatchReporter.d.ts.map +0 -1
  325. package/lib/typescript/src/VideoPlayer/utils/videoControl.d.ts.map +0 -1
  326. package/lib/typescript/src/VideoPlayer/utils/videoRef.d.ts +0 -3
  327. package/lib/typescript/src/VideoPlayer/utils/videoRef.d.ts.map +0 -1
  328. package/lib/typescript/src/VideoPlayer/utils/videoSource.d.ts.map +0 -1
  329. package/src/VideoPlayer/Styles/fonts.ts +0 -106
  330. package/src/VideoPlayer/VideoPlayer.tsx +0 -217
  331. package/src/VideoPlayer/utils/videoRef.ts +0 -4
  332. /package/lib/module/VideoPlayer/utils/{videoSource.js → video/videoSource.js} +0 -0
  333. /package/lib/typescript/src/VideoPlayer/{model → Settings}/AudioAndSubtitles.d.ts +0 -0
  334. /package/lib/typescript/src/VideoPlayer/{model → Settings}/SpeedControls.d.ts +0 -0
  335. /package/lib/typescript/src/VideoPlayer/{model → Settings}/VideoPlayerSettings.d.ts +0 -0
  336. /package/lib/typescript/src/VideoPlayer/utils/{Display.d.ts → display/Display.d.ts} +0 -0
  337. /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 **ZezoOTT Video Player** is a powerful React Native component crafted for OTT platforms.
4
- It delivers a **seamless full-screen video playback experience**, powered by a centralized **VideoPlayer Store** for state management.
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 navigation & Seasons support**
11
- - 📊 **Watch progress tracking & analytics**
12
- - 🎨 **Custom theming**
13
- - 🔄 **Auto-next playback**
14
- - 🎬 **Playlist & seasons integration**
15
- - 🗄️ **Centralized store for playback state, tracks & UI**
16
- - 📱 **Optimized for React Native OTT apps**
17
- - 🛠 **Minimal configuration, production-ready**
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
- ## ⚙️ VideoPlayer Props
86
+ ## 🚀 Quick Start
36
87
 
37
- | Prop | Type | Description |
38
- | ------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
39
- | **onClose** | `() => void` | Triggered when the player is closed. |
40
- | **isFocused** | `boolean` | Controls playback focus. Automatically pauses when the screen is not active. |
41
- | **seekTime** | `number \| null` | Starts playback from a given time (in seconds). |
42
- | **mode** | `'fullscreen' \| 'normal'` | Sets the display mode of the player. |
43
- | **onSeek** | `(time: number) => void` | Fired when the user manually seeks to a new playback position. |
44
- | **autoNext** | `boolean` | Automatically plays the next episode/video after completion. |
45
- | **event** | `{ onPressEpisode?: ({ episode }: { episode: MediaEpisode }) => Promise<boolean> }` | Event hooks (e.g. custom handling for episode selection). |
46
- | **theme** | `Partial<VideoPlayerTheme>` | Customize the look & feel of the player (colors, metrics, etc.). |
47
- | **onWatchProgress** | `(progress: ExtendedWatchProgress) => void` | Reports playback analytics such as watch time, current time, and completion. |
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
- <VideoPlayer
77
- autoNext={true}
78
- event={{
79
- onPressEpisode: async ({ episode }) => {
80
- console.log('Next episode:', episode.title);
81
- return true; // return false to block playback
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 Example
227
+ ### 🎨 Custom Theming
88
228
 
89
229
  ```tsx
90
- <VideoPlayer
91
- theme={{
92
- colors: {
93
- primary: '#E50914',
94
- background: '#000000',
95
- onBackground: '#FFFFFF',
96
- },
97
- metrics: {
98
- controlButtonSize: 42,
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
- return <VideoPlayer isFocused={true} autoNext={true} />;
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
- # 🗄️ Video Player Store
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
- The **VideoPlayerStore** is a centralized state store that powers the ZezoOTT Video Player.
160
- It manages **playback state, tracks, UI controls, analytics, and content navigation**.
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
- ## 🚀 Store Features
405
+ ## 🗄️ Video Player Store
165
406
 
166
- - Manage **playback state**: current time, duration, buffering, playback rate
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
- ## Store Usage Example
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
- <div>
238
- <button onClick={setupPlayer}>Load Series</button>
239
- <h3>Active Season: {activeSeason?.name}</h3>
240
- <ul>
241
- {playList.map((track) => (
242
- <li key={track.id}>
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
- </li>
245
- ))}
246
- </ul>
247
- </div>
492
+ </Text>
493
+ )}
494
+ />
495
+ </View>
248
496
  );
249
497
  }
250
498
  ```
251
499
 
252
500
  ---
253
501
 
254
- ## 📝 Notes & Best Practices
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
- ## 📌 Fullscreen Notes
516
+ ## 🔧 Troubleshooting
267
517
 
268
- If fullscreen doesn’t work, ensure you install **react-native-orientation-locker**:
518
+ ### Fullscreen Not Working
269
519
 
270
- ```bash
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
- ## React Native Orientation Locker
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
- ### 🔹 Known Issues
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
- ### 🔹 Setup & Installation
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
  ---