@zezosoft/zezo-ott-react-native-video-player 1.0.1 → 1.0.2

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