bitmovin-player-react-native 0.44.1-alpha.0 → 1.0.0-alpha.0

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 (497) hide show
  1. package/.eslintignore +11 -0
  2. package/.eslintrc.js +7 -0
  3. package/.gitattributes +3 -0
  4. package/.prettierignore +11 -0
  5. package/.ruby-version +1 -0
  6. package/.swiftlint.yml +171 -0
  7. package/Brewfile +2 -0
  8. package/CHANGELOG.md +627 -0
  9. package/CONTRIBUTING.md +255 -0
  10. package/TODO.md +0 -0
  11. package/android/.editorconfig +8 -0
  12. package/android/build.gradle +78 -75
  13. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  14. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  15. package/android/gradle.properties +1 -0
  16. package/android/gradlew +248 -0
  17. package/android/gradlew.bat +92 -0
  18. package/android/ktlint.gradle +31 -0
  19. package/android/src/main/java/com/bitmovin/player/reactnative/ActivityLifecycleListener.kt +51 -0
  20. package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinCastManagerModule.kt +32 -55
  21. package/android/src/main/java/com/bitmovin/player/reactnative/BufferModule.kt +33 -45
  22. package/android/src/main/java/com/bitmovin/player/reactnative/CustomMessageHandlerModule.kt +84 -0
  23. package/android/src/main/java/com/bitmovin/player/reactnative/DebugModule.kt +6 -14
  24. package/android/src/main/java/com/bitmovin/player/reactnative/DecoderConfigModule.kt +89 -44
  25. package/android/src/main/java/com/bitmovin/player/reactnative/DrmModule.kt +80 -99
  26. package/android/src/main/java/com/bitmovin/player/reactnative/EventSubscription.kt +22 -0
  27. package/android/src/main/java/com/bitmovin/player/reactnative/FullscreenHandlerModule.kt +100 -0
  28. package/android/src/main/java/com/bitmovin/player/reactnative/MediaSessionPlaybackManager.kt +5 -5
  29. package/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt +98 -56
  30. package/android/src/main/java/com/bitmovin/player/reactnative/OfflineModule.kt +132 -186
  31. package/android/src/main/java/com/bitmovin/player/reactnative/PlayerAnalyticsModule.kt +37 -36
  32. package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +252 -528
  33. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerPackage.kt +11 -0
  34. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +558 -213
  35. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +99 -286
  36. package/android/src/main/java/com/bitmovin/player/reactnative/ResultWaiter.kt +58 -0
  37. package/android/src/main/java/com/bitmovin/player/reactnative/SourceModule.kt +77 -151
  38. package/android/src/main/java/com/bitmovin/player/reactnative/Types.kt +44 -0
  39. package/android/src/main/java/com/bitmovin/player/reactnative/UuidModule.kt +12 -15
  40. package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +296 -456
  41. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ListExtension.kt +89 -0
  42. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/MapExtension.kt +95 -0
  43. package/android/src/main/java/com/bitmovin/player/reactnative/offline/OfflineContentManagerBridge.kt +20 -52
  44. package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerBridge.kt +10 -20
  45. package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerBridge.kt +4 -9
  46. package/app.plugin.js +21 -0
  47. package/build/BitmovinPlayerReactNative.types.d.ts +18 -0
  48. package/build/BitmovinPlayerReactNative.types.d.ts.map +1 -0
  49. package/build/BitmovinPlayerReactNative.types.js +2 -0
  50. package/build/BitmovinPlayerReactNative.types.js.map +1 -0
  51. package/build/adaptationConfig.d.ts +18 -0
  52. package/build/adaptationConfig.d.ts.map +1 -0
  53. package/build/adaptationConfig.js +2 -0
  54. package/build/adaptationConfig.js.map +1 -0
  55. package/build/advertising.d.ts +175 -0
  56. package/build/advertising.d.ts.map +1 -0
  57. package/build/advertising.js +37 -0
  58. package/build/advertising.js.map +1 -0
  59. package/build/analytics/config.d.ts +194 -0
  60. package/build/analytics/config.d.ts.map +1 -0
  61. package/build/analytics/config.js +2 -0
  62. package/build/analytics/config.js.map +1 -0
  63. package/build/analytics/index.d.ts +3 -0
  64. package/build/analytics/index.d.ts.map +1 -0
  65. package/build/analytics/index.js +3 -0
  66. package/build/analytics/index.js.map +1 -0
  67. package/build/analytics/player.d.ts +24 -0
  68. package/build/analytics/player.d.ts.map +1 -0
  69. package/build/analytics/player.js +30 -0
  70. package/build/analytics/player.js.map +1 -0
  71. package/build/analytics/playerAnalyticsModule.d.ts +13 -0
  72. package/build/analytics/playerAnalyticsModule.d.ts.map +1 -0
  73. package/build/analytics/playerAnalyticsModule.js +3 -0
  74. package/build/analytics/playerAnalyticsModule.js.map +1 -0
  75. package/build/audioSession.d.ts +33 -0
  76. package/build/audioSession.d.ts.map +1 -0
  77. package/build/audioSession.js +21 -0
  78. package/build/audioSession.js.map +1 -0
  79. package/build/audioTrack.d.ts +39 -0
  80. package/build/audioTrack.d.ts.map +1 -0
  81. package/build/audioTrack.js +2 -0
  82. package/build/audioTrack.js.map +1 -0
  83. package/build/bitmovinCastManager.d.ts +58 -0
  84. package/build/bitmovinCastManager.d.ts.map +1 -0
  85. package/build/bitmovinCastManager.js +64 -0
  86. package/build/bitmovinCastManager.js.map +1 -0
  87. package/build/bufferApi.d.ts +85 -0
  88. package/build/bufferApi.d.ts.map +1 -0
  89. package/build/bufferApi.js +60 -0
  90. package/build/bufferApi.js.map +1 -0
  91. package/build/bufferConfig.d.ts +42 -0
  92. package/build/bufferConfig.d.ts.map +1 -0
  93. package/build/bufferConfig.js +2 -0
  94. package/build/bufferConfig.js.map +1 -0
  95. package/build/components/PlayerView/events.d.ts +310 -0
  96. package/build/components/PlayerView/events.d.ts.map +1 -0
  97. package/build/components/PlayerView/events.js +2 -0
  98. package/build/components/PlayerView/events.js.map +1 -0
  99. package/build/components/PlayerView/index.d.ts +10 -0
  100. package/build/components/PlayerView/index.d.ts.map +1 -0
  101. package/build/components/PlayerView/index.js +72 -0
  102. package/build/components/PlayerView/index.js.map +1 -0
  103. package/build/components/PlayerView/native.d.ts +30 -0
  104. package/build/components/PlayerView/native.d.ts.map +1 -0
  105. package/build/components/PlayerView/native.js +6 -0
  106. package/build/components/PlayerView/native.js.map +1 -0
  107. package/build/components/PlayerView/nativeEvents.d.ts +437 -0
  108. package/build/components/PlayerView/nativeEvents.d.ts.map +1 -0
  109. package/build/components/PlayerView/nativeEvents.js +2 -0
  110. package/build/components/PlayerView/nativeEvents.js.map +1 -0
  111. package/build/components/PlayerView/pictureInPictureConfig.d.ts +22 -0
  112. package/build/components/PlayerView/pictureInPictureConfig.d.ts.map +1 -0
  113. package/build/components/PlayerView/pictureInPictureConfig.js +2 -0
  114. package/build/components/PlayerView/pictureInPictureConfig.js.map +1 -0
  115. package/build/components/PlayerView/playerViewConfig.d.ts +111 -0
  116. package/build/components/PlayerView/playerViewConfig.d.ts.map +1 -0
  117. package/build/components/PlayerView/playerViewConfig.js +51 -0
  118. package/build/components/PlayerView/playerViewConfig.js.map +1 -0
  119. package/build/components/PlayerView/properties.d.ts +61 -0
  120. package/build/components/PlayerView/properties.d.ts.map +1 -0
  121. package/build/components/PlayerView/properties.js +2 -0
  122. package/build/components/PlayerView/properties.js.map +1 -0
  123. package/build/components/index.d.ts +5 -0
  124. package/build/components/index.d.ts.map +1 -0
  125. package/build/components/index.js +5 -0
  126. package/build/components/index.js.map +1 -0
  127. package/build/debug.d.ts +46 -0
  128. package/build/debug.d.ts.map +1 -0
  129. package/build/debug.js +52 -0
  130. package/build/debug.js.map +1 -0
  131. package/build/decoder/decoderConfig.d.ts +96 -0
  132. package/build/decoder/decoderConfig.d.ts.map +1 -0
  133. package/build/decoder/decoderConfig.js +6 -0
  134. package/build/decoder/decoderConfig.js.map +1 -0
  135. package/build/decoder/decoderConfigModule.d.ts +14 -0
  136. package/build/decoder/decoderConfigModule.d.ts.map +1 -0
  137. package/build/decoder/decoderConfigModule.js +31 -0
  138. package/build/decoder/decoderConfigModule.js.map +1 -0
  139. package/build/decoder/index.d.ts +26 -0
  140. package/build/decoder/index.d.ts.map +1 -0
  141. package/build/decoder/index.js +50 -0
  142. package/build/decoder/index.js.map +1 -0
  143. package/build/drm/drmModule.d.ts +55 -0
  144. package/build/drm/drmModule.d.ts.map +1 -0
  145. package/build/drm/drmModule.js +3 -0
  146. package/build/drm/drmModule.js.map +1 -0
  147. package/build/drm/fairplayConfig.d.ts +91 -0
  148. package/build/drm/fairplayConfig.d.ts.map +1 -0
  149. package/build/drm/fairplayConfig.js +2 -0
  150. package/build/drm/fairplayConfig.js.map +1 -0
  151. package/build/drm/index.d.ts +112 -0
  152. package/build/drm/index.d.ts.map +1 -0
  153. package/build/drm/index.js +191 -0
  154. package/build/drm/index.js.map +1 -0
  155. package/build/drm/widevineConfig.d.ts +58 -0
  156. package/build/drm/widevineConfig.d.ts.map +1 -0
  157. package/build/drm/widevineConfig.js +2 -0
  158. package/build/drm/widevineConfig.js.map +1 -0
  159. package/build/events.d.ts +692 -0
  160. package/build/events.d.ts.map +1 -0
  161. package/build/events.js +2 -0
  162. package/build/events.js.map +1 -0
  163. package/build/hooks/index.d.ts +2 -0
  164. package/build/hooks/index.d.ts.map +1 -0
  165. package/build/hooks/index.js +2 -0
  166. package/build/hooks/index.js.map +1 -0
  167. package/build/hooks/usePlayer.d.ts +8 -0
  168. package/build/hooks/usePlayer.d.ts.map +1 -0
  169. package/build/hooks/usePlayer.js +10 -0
  170. package/build/hooks/usePlayer.js.map +1 -0
  171. package/build/hooks/useProxy.d.ts +18 -0
  172. package/build/hooks/useProxy.d.ts.map +1 -0
  173. package/build/hooks/useProxy.js +16 -0
  174. package/build/hooks/useProxy.js.map +1 -0
  175. package/build/index.d.ts +32 -0
  176. package/build/index.d.ts.map +1 -0
  177. package/build/index.js +32 -0
  178. package/build/index.js.map +1 -0
  179. package/build/liveConfig.d.ts +13 -0
  180. package/build/liveConfig.d.ts.map +1 -0
  181. package/build/liveConfig.js +2 -0
  182. package/build/liveConfig.js.map +1 -0
  183. package/build/media.d.ts +85 -0
  184. package/build/media.d.ts.map +1 -0
  185. package/build/media.js +2 -0
  186. package/build/media.js.map +1 -0
  187. package/build/mediaControlConfig.d.ts +62 -0
  188. package/build/mediaControlConfig.d.ts.map +1 -0
  189. package/build/mediaControlConfig.js +2 -0
  190. package/build/mediaControlConfig.js.map +1 -0
  191. package/build/mediaTrackRole.d.ts +28 -0
  192. package/build/mediaTrackRole.d.ts.map +1 -0
  193. package/build/mediaTrackRole.js +2 -0
  194. package/build/mediaTrackRole.js.map +1 -0
  195. package/build/modules/AudioSessionModule.d.ts +8 -0
  196. package/build/modules/AudioSessionModule.d.ts.map +1 -0
  197. package/build/modules/AudioSessionModule.js +7 -0
  198. package/build/modules/AudioSessionModule.js.map +1 -0
  199. package/build/modules/BitmovinCastManagerModule.d.ts +11 -0
  200. package/build/modules/BitmovinCastManagerModule.d.ts.map +1 -0
  201. package/build/modules/BitmovinCastManagerModule.js +3 -0
  202. package/build/modules/BitmovinCastManagerModule.js.map +1 -0
  203. package/build/modules/BufferModule.d.ts +16 -0
  204. package/build/modules/BufferModule.d.ts.map +1 -0
  205. package/build/modules/BufferModule.js +3 -0
  206. package/build/modules/BufferModule.js.map +1 -0
  207. package/build/modules/DebugModule.d.ts +8 -0
  208. package/build/modules/DebugModule.d.ts.map +1 -0
  209. package/build/modules/DebugModule.js +3 -0
  210. package/build/modules/DebugModule.js.map +1 -0
  211. package/build/modules/PlayerModule.d.ts +188 -0
  212. package/build/modules/PlayerModule.d.ts.map +1 -0
  213. package/build/modules/PlayerModule.js +3 -0
  214. package/build/modules/PlayerModule.js.map +1 -0
  215. package/build/modules/SourceModule.d.ts +51 -0
  216. package/build/modules/SourceModule.d.ts.map +1 -0
  217. package/build/modules/SourceModule.js +3 -0
  218. package/build/modules/SourceModule.js.map +1 -0
  219. package/build/modules/UuidModule.d.ts +8 -0
  220. package/build/modules/UuidModule.d.ts.map +1 -0
  221. package/build/modules/UuidModule.js +3 -0
  222. package/build/modules/UuidModule.js.map +1 -0
  223. package/build/nativeInstance.d.ts +49 -0
  224. package/build/nativeInstance.d.ts.map +1 -0
  225. package/build/nativeInstance.js +20 -0
  226. package/build/nativeInstance.js.map +1 -0
  227. package/build/network/index.d.ts +50 -0
  228. package/build/network/index.d.ts.map +1 -0
  229. package/build/network/index.js +102 -0
  230. package/build/network/index.js.map +1 -0
  231. package/build/network/networkConfig.d.ts +151 -0
  232. package/build/network/networkConfig.d.ts.map +1 -0
  233. package/build/network/networkConfig.js +21 -0
  234. package/build/network/networkConfig.js.map +1 -0
  235. package/build/network/networkModule.d.ts +29 -0
  236. package/build/network/networkModule.d.ts.map +1 -0
  237. package/build/network/networkModule.js +3 -0
  238. package/build/network/networkModule.js.map +1 -0
  239. package/build/offline/index.d.ts +8 -0
  240. package/build/offline/index.d.ts.map +1 -0
  241. package/build/offline/index.js +8 -0
  242. package/build/offline/index.js.map +1 -0
  243. package/build/offline/offlineContentConfig.d.ts +18 -0
  244. package/build/offline/offlineContentConfig.d.ts.map +1 -0
  245. package/build/offline/offlineContentConfig.js +2 -0
  246. package/build/offline/offlineContentConfig.js.map +1 -0
  247. package/build/offline/offlineContentManager.d.ts +90 -0
  248. package/build/offline/offlineContentManager.d.ts.map +1 -0
  249. package/build/offline/offlineContentManager.js +177 -0
  250. package/build/offline/offlineContentManager.js.map +1 -0
  251. package/build/offline/offlineContentManagerListener.d.ts +174 -0
  252. package/build/offline/offlineContentManagerListener.d.ts.map +1 -0
  253. package/build/offline/offlineContentManagerListener.js +17 -0
  254. package/build/offline/offlineContentManagerListener.js.map +1 -0
  255. package/build/offline/offlineContentOptions.d.ts +29 -0
  256. package/build/offline/offlineContentOptions.d.ts.map +1 -0
  257. package/build/offline/offlineContentOptions.js +2 -0
  258. package/build/offline/offlineContentOptions.js.map +1 -0
  259. package/build/offline/offlineDownloadRequest.d.ts +19 -0
  260. package/build/offline/offlineDownloadRequest.d.ts.map +1 -0
  261. package/build/offline/offlineDownloadRequest.js +2 -0
  262. package/build/offline/offlineDownloadRequest.js.map +1 -0
  263. package/build/offline/offlineModule.d.ts +32 -0
  264. package/build/offline/offlineModule.d.ts.map +1 -0
  265. package/build/offline/offlineModule.js +3 -0
  266. package/build/offline/offlineModule.js.map +1 -0
  267. package/build/offline/offlineSourceOptions.d.ts +12 -0
  268. package/build/offline/offlineSourceOptions.d.ts.map +1 -0
  269. package/build/offline/offlineSourceOptions.js +2 -0
  270. package/build/offline/offlineSourceOptions.js.map +1 -0
  271. package/build/offline/offlineState.d.ts +23 -0
  272. package/build/offline/offlineState.d.ts.map +1 -0
  273. package/build/offline/offlineState.js +24 -0
  274. package/build/offline/offlineState.js.map +1 -0
  275. package/build/playbackConfig.d.ts +88 -0
  276. package/build/playbackConfig.d.ts.map +1 -0
  277. package/build/playbackConfig.js +2 -0
  278. package/build/playbackConfig.js.map +1 -0
  279. package/build/player.d.ts +308 -0
  280. package/build/player.d.ts.map +1 -0
  281. package/build/player.js +445 -0
  282. package/build/player.js.map +1 -0
  283. package/build/playerConfig.d.ts +83 -0
  284. package/build/playerConfig.d.ts.map +1 -0
  285. package/build/playerConfig.js +2 -0
  286. package/build/playerConfig.js.map +1 -0
  287. package/build/remoteControlConfig.d.ts +38 -0
  288. package/build/remoteControlConfig.d.ts.map +1 -0
  289. package/build/remoteControlConfig.js +2 -0
  290. package/build/remoteControlConfig.js.map +1 -0
  291. package/build/source.d.ts +216 -0
  292. package/build/source.d.ts.map +1 -0
  293. package/build/source.js +167 -0
  294. package/build/source.js.map +1 -0
  295. package/build/styleConfig.d.ts +120 -0
  296. package/build/styleConfig.d.ts.map +1 -0
  297. package/build/styleConfig.js +38 -0
  298. package/build/styleConfig.js.map +1 -0
  299. package/build/subtitleFormat.d.ts +27 -0
  300. package/build/subtitleFormat.d.ts.map +1 -0
  301. package/build/subtitleFormat.js +28 -0
  302. package/build/subtitleFormat.js.map +1 -0
  303. package/build/subtitleTrack.d.ts +55 -0
  304. package/build/subtitleTrack.d.ts.map +1 -0
  305. package/build/subtitleTrack.js +2 -0
  306. package/build/subtitleTrack.js.map +1 -0
  307. package/build/thumbnail.d.ts +38 -0
  308. package/build/thumbnail.d.ts.map +1 -0
  309. package/build/thumbnail.js +2 -0
  310. package/build/thumbnail.js.map +1 -0
  311. package/build/tweaksConfig.d.ts +197 -0
  312. package/build/tweaksConfig.d.ts.map +1 -0
  313. package/build/tweaksConfig.js +25 -0
  314. package/build/tweaksConfig.js.map +1 -0
  315. package/build/ui/customMessageHandlerModule.d.ts +27 -0
  316. package/build/ui/customMessageHandlerModule.d.ts.map +1 -0
  317. package/build/ui/customMessageHandlerModule.js +3 -0
  318. package/build/ui/customMessageHandlerModule.js.map +1 -0
  319. package/build/ui/custommessagehandler.d.ts +56 -0
  320. package/build/ui/custommessagehandler.d.ts.map +1 -0
  321. package/build/ui/custommessagehandler.js +54 -0
  322. package/build/ui/custommessagehandler.js.map +1 -0
  323. package/build/ui/custommessagehandlerbridge.d.ts +33 -0
  324. package/build/ui/custommessagehandlerbridge.d.ts.map +1 -0
  325. package/build/ui/custommessagehandlerbridge.js +72 -0
  326. package/build/ui/custommessagehandlerbridge.js.map +1 -0
  327. package/build/ui/custommessagesender.d.ts +5 -0
  328. package/build/ui/custommessagesender.d.ts.map +1 -0
  329. package/build/ui/custommessagesender.js +2 -0
  330. package/build/ui/custommessagesender.js.map +1 -0
  331. package/build/ui/fullscreenHandlerModule.d.ts +20 -0
  332. package/build/ui/fullscreenHandlerModule.d.ts.map +1 -0
  333. package/build/ui/fullscreenHandlerModule.js +3 -0
  334. package/build/ui/fullscreenHandlerModule.js.map +1 -0
  335. package/build/ui/fullscreenhandler.d.ts +18 -0
  336. package/build/ui/fullscreenhandler.d.ts.map +1 -0
  337. package/build/ui/fullscreenhandler.js +2 -0
  338. package/build/ui/fullscreenhandler.js.map +1 -0
  339. package/build/ui/fullscreenhandlerbridge.d.ts +26 -0
  340. package/build/ui/fullscreenhandlerbridge.d.ts.map +1 -0
  341. package/build/ui/fullscreenhandlerbridge.js +67 -0
  342. package/build/ui/fullscreenhandlerbridge.js.map +1 -0
  343. package/build/ui/index.d.ts +3 -0
  344. package/build/ui/index.d.ts.map +1 -0
  345. package/build/ui/index.js +3 -0
  346. package/build/ui/index.js.map +1 -0
  347. package/expo-module.config.json +40 -0
  348. package/ios/AppLifecycleDelegate.swift +25 -0
  349. package/ios/AudioSessionModule.swift +14 -40
  350. package/ios/BitmovinCastManagerModule.swift +30 -69
  351. package/ios/BufferModule.swift +26 -62
  352. package/ios/CustomMessageHandlerBridge.swift +11 -18
  353. package/ios/CustomMessageHandlerModule.swift +61 -63
  354. package/ios/DebugModule.swift +6 -27
  355. package/ios/DrmModule.swift +105 -379
  356. package/ios/Event+JSON.swift +1 -0
  357. package/ios/FullscreenHandlerBridge.swift +12 -5
  358. package/ios/FullscreenHandlerModule.swift +73 -57
  359. package/ios/LockedBox.swift +21 -0
  360. package/ios/ModuleRegistry+Generics.swift +11 -0
  361. package/ios/NetworkModule.swift +78 -82
  362. package/ios/OfflineContentManagerBridge.swift +11 -38
  363. package/ios/OfflineModule.swift +136 -454
  364. package/ios/PlayerAnalyticsModule.swift +24 -52
  365. package/ios/PlayerModule.swift +192 -770
  366. package/ios/RCTConvert+BitmovinPlayer.swift +38 -312
  367. package/ios/RNBitmovinPlayer.h +1 -8
  368. package/ios/RNBitmovinPlayer.podspec +47 -0
  369. package/ios/RNPlayerView.swift +600 -77
  370. package/ios/RNPlayerViewManager.swift +96 -210
  371. package/ios/Registry.swift +2 -2
  372. package/ios/ResultWaiter.swift +66 -0
  373. package/ios/SourceModule.swift +104 -223
  374. package/ios/UuidModule.swift +9 -18
  375. package/package.json +67 -71
  376. package/plugin/build/FeatureFlags.d.ts +24 -0
  377. package/plugin/build/FeatureFlags.js +2 -0
  378. package/plugin/build/index.d.ts +7 -0
  379. package/plugin/build/index.js +10 -0
  380. package/plugin/build/withAppGradleDependencies.d.ts +7 -0
  381. package/plugin/build/withAppGradleDependencies.js +49 -0
  382. package/plugin/build/withBitmovinAndroidConfig.d.ts +7 -0
  383. package/plugin/build/withBitmovinAndroidConfig.js +159 -0
  384. package/plugin/build/withBitmovinConfig.d.ts +7 -0
  385. package/plugin/build/withBitmovinConfig.js +21 -0
  386. package/plugin/build/withBitmovinIosConfig.d.ts +7 -0
  387. package/plugin/build/withBitmovinIosConfig.js +53 -0
  388. package/plugin/src/FeatureFlags.ts +21 -0
  389. package/plugin/src/index.ts +9 -0
  390. package/plugin/src/withAppGradleDependencies.ts +80 -0
  391. package/plugin/src/withBitmovinAndroidConfig.ts +224 -0
  392. package/plugin/src/withBitmovinConfig.ts +24 -0
  393. package/plugin/src/withBitmovinIosConfig.ts +71 -0
  394. package/plugin/tsconfig.json +9 -0
  395. package/plugin/tsconfig.tsbuildinfo +1 -0
  396. package/prettier.config.js +7 -0
  397. package/scripts/format-android.sh +2 -0
  398. package/scripts/format-swift.sh +3 -0
  399. package/scripts/lint-android.sh +2 -0
  400. package/scripts/lint-swift.sh +3 -0
  401. package/scripts/pre-commit.sh +14 -0
  402. package/scripts/setup-hooks.sh +58 -0
  403. package/src/BitmovinPlayerReactNative.types.ts +19 -0
  404. package/src/adaptationConfig.ts +1 -1
  405. package/src/advertising.ts +1 -1
  406. package/src/analytics/config.ts +4 -4
  407. package/src/analytics/player.ts +4 -6
  408. package/src/analytics/playerAnalyticsModule.ts +19 -0
  409. package/src/audioSession.ts +4 -6
  410. package/src/audioTrack.ts +1 -1
  411. package/src/bitmovinCastManager.ts +14 -10
  412. package/src/bufferApi.ts +1 -3
  413. package/src/bufferConfig.ts +2 -2
  414. package/src/components/PlayerView/events.ts +92 -94
  415. package/src/components/PlayerView/index.tsx +109 -159
  416. package/src/components/PlayerView/native.ts +24 -11
  417. package/src/components/PlayerView/nativeEvents.ts +113 -94
  418. package/src/components/PlayerView/pictureInPictureConfig.ts +1 -1
  419. package/src/components/PlayerView/playerViewConfig.ts +4 -8
  420. package/src/components/PlayerView/properties.ts +23 -22
  421. package/src/debug.ts +1 -3
  422. package/src/decoder/decoderConfig.ts +3 -3
  423. package/src/decoder/decoderConfigModule.ts +62 -0
  424. package/src/decoder/index.ts +32 -16
  425. package/src/drm/drmModule.ts +84 -0
  426. package/src/drm/fairplayConfig.ts +1 -1
  427. package/src/drm/index.ts +130 -40
  428. package/src/drm/widevineConfig.ts +5 -5
  429. package/src/events.ts +47 -41
  430. package/src/hooks/useProxy.ts +13 -20
  431. package/src/mediaControlConfig.ts +1 -1
  432. package/src/modules/AudioSessionModule.ts +13 -0
  433. package/src/modules/BitmovinCastManagerModule.ts +14 -0
  434. package/src/modules/BufferModule.ts +18 -0
  435. package/src/modules/DebugModule.ts +9 -0
  436. package/src/modules/PlayerModule.ts +251 -0
  437. package/src/modules/SourceModule.ts +74 -0
  438. package/src/modules/UuidModule.ts +9 -0
  439. package/src/nativeInstance.ts +3 -3
  440. package/src/network/index.ts +42 -15
  441. package/src/network/networkConfig.ts +3 -3
  442. package/src/network/networkModule.ts +51 -0
  443. package/src/offline/offlineContentConfig.ts +1 -1
  444. package/src/offline/offlineContentManager.ts +15 -50
  445. package/src/offline/offlineContentManagerListener.ts +20 -23
  446. package/src/offline/offlineContentOptions.ts +2 -2
  447. package/src/offline/offlineDownloadRequest.ts +1 -1
  448. package/src/offline/offlineModule.ts +46 -0
  449. package/src/offline/offlineSourceOptions.ts +2 -2
  450. package/src/offline/offlineState.ts +1 -1
  451. package/src/playbackConfig.ts +5 -6
  452. package/src/player.ts +53 -48
  453. package/src/source.ts +15 -14
  454. package/src/styleConfig.ts +5 -5
  455. package/src/subtitleFormat.ts +5 -5
  456. package/src/subtitleTrack.ts +1 -1
  457. package/src/tweaksConfig.ts +16 -16
  458. package/src/ui/customMessageHandlerModule.ts +46 -0
  459. package/src/ui/custommessagehandlerbridge.ts +45 -18
  460. package/src/ui/fullscreenHandlerModule.ts +35 -0
  461. package/src/ui/fullscreenhandlerbridge.ts +35 -15
  462. package/tsconfig.json +9 -0
  463. package/typedoc.json +23 -0
  464. package/RNBitmovinPlayer.podspec +0 -26
  465. package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinBaseModule.kt +0 -114
  466. package/android/src/main/java/com/bitmovin/player/reactnative/EventRelay.kt +0 -47
  467. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewPackage.kt +0 -48
  468. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReactContextExtension.kt +0 -24
  469. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableArray.kt +0 -20
  470. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMap.kt +0 -15
  471. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMapExtension.kt +0 -57
  472. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/WritableMap.kt +0 -27
  473. package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerModule.kt +0 -86
  474. package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerModule.kt +0 -78
  475. package/ios/AudioSessionModule.m +0 -10
  476. package/ios/BitmovinCastManagerModule.m +0 -14
  477. package/ios/BufferModule.m +0 -8
  478. package/ios/CustomMessageHandlerModule.m +0 -10
  479. package/ios/DebugModule.m +0 -7
  480. package/ios/DrmModule.m +0 -16
  481. package/ios/FullscreenHandlerModule.m +0 -10
  482. package/ios/NetworkModule.m +0 -10
  483. package/ios/OfflineModule.m +0 -19
  484. package/ios/PlayerAnalyticsModule.m +0 -8
  485. package/ios/PlayerModule.m +0 -130
  486. package/ios/PreprocessHttpRequestDelegateBridge.swift +0 -30
  487. package/ios/RCTBridge+Generics.swift +0 -6
  488. package/ios/RNBitmovinPlayer.xcodeproj/project.pbxproj +0 -303
  489. package/ios/RNPlayerView+PlayerListener.swift +0 -229
  490. package/ios/RNPlayerView+UserInterfaceListener.swift +0 -35
  491. package/ios/RNPlayerViewManager.m +0 -79
  492. package/ios/SourceModule.m +0 -42
  493. package/ios/UuidModule.m +0 -9
  494. package/lib/index.d.mts +0 -4303
  495. package/lib/index.d.ts +0 -4303
  496. package/lib/index.js +0 -1895
  497. package/lib/index.mjs +0 -1836
package/lib/index.mjs DELETED
@@ -1,1836 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
-
8
- // src/advertising.ts
9
- var AdQuartile = /* @__PURE__ */ ((AdQuartile2) => {
10
- AdQuartile2["FIRST"] = "first";
11
- AdQuartile2["MID_POINT"] = "mid_point";
12
- AdQuartile2["THIRD"] = "third";
13
- return AdQuartile2;
14
- })(AdQuartile || {});
15
- var AdSourceType = /* @__PURE__ */ ((AdSourceType2) => {
16
- AdSourceType2["IMA"] = "ima";
17
- AdSourceType2["UNKNOWN"] = "unknown";
18
- AdSourceType2["PROGRESSIVE"] = "progressive";
19
- return AdSourceType2;
20
- })(AdSourceType || {});
21
-
22
- // src/analytics/player.ts
23
- import { NativeModules } from "react-native";
24
- var PlayerAnalyticsModule = NativeModules.PlayerAnalyticsModule;
25
- var AnalyticsApi = class {
26
- constructor(playerId) {
27
- /**
28
- * The native player id that this analytics api is attached to.
29
- */
30
- __publicField(this, "playerId");
31
- /**
32
- * Sends a sample with the provided custom data.
33
- * Does not change the configured custom data of the collector or source.
34
- */
35
- __publicField(this, "sendCustomDataEvent", (customData) => {
36
- PlayerAnalyticsModule.sendCustomDataEvent(this.playerId, customData);
37
- });
38
- /**
39
- * Gets the current user id used by the bundled analytics instance.
40
- *
41
- * @returns The current user id.
42
- */
43
- __publicField(this, "getUserId", async () => {
44
- return PlayerAnalyticsModule.getUserId(this.playerId);
45
- });
46
- this.playerId = playerId;
47
- }
48
- };
49
-
50
- // src/audioSession.ts
51
- import { NativeModules as NativeModules2 } from "react-native";
52
- var AudioSessionModule = NativeModules2.AudioSessionModule;
53
- var AudioSession = {
54
- /**
55
- * Sets the audio session's category.
56
- *
57
- * @platform iOS
58
- * @see https://developer.apple.com/documentation/avfaudio/avaudiosession/1616583-setcategory
59
- */
60
- setCategory: async (category) => {
61
- if (AudioSessionModule) {
62
- await AudioSessionModule.setCategory(category);
63
- }
64
- }
65
- };
66
-
67
- // src/components/PlayerView/index.tsx
68
- import React, { useRef, useEffect, useCallback as useCallback2 } from "react";
69
- import {
70
- Platform,
71
- UIManager,
72
- StyleSheet,
73
- findNodeHandle as findNodeHandle2
74
- } from "react-native";
75
-
76
- // src/components/PlayerView/native.ts
77
- import { requireNativeComponent } from "react-native";
78
- var NativePlayerView = requireNativeComponent("NativePlayerView");
79
-
80
- // src/hooks/useProxy.ts
81
- import omit from "lodash.omit";
82
- import { useCallback } from "react";
83
- import { findNodeHandle } from "react-native";
84
- function unwrapNativeEvent(event) {
85
- return omit(event.nativeEvent, ["target"]);
86
- }
87
- function useProxy(viewRef) {
88
- return useCallback(
89
- (callback) => (event) => {
90
- const node = event.target._nativeTag;
91
- if (node === findNodeHandle(viewRef.current)) {
92
- callback?.(unwrapNativeEvent(event));
93
- }
94
- },
95
- [viewRef]
96
- );
97
- }
98
-
99
- // src/ui/fullscreenhandlerbridge.ts
100
- import { NativeModules as NativeModules3 } from "react-native";
101
- import BatchedBridge from "react-native/Libraries/BatchedBridge/BatchedBridge";
102
- var Uuid = NativeModules3.UuidModule;
103
- var FullscreenHandlerModule = NativeModules3.FullscreenHandlerModule;
104
- var FullscreenHandlerBridge = class {
105
- constructor(nativeId) {
106
- __publicField(this, "nativeId");
107
- __publicField(this, "fullscreenHandler");
108
- __publicField(this, "isDestroyed");
109
- this.nativeId = nativeId ?? Uuid.generate();
110
- this.isDestroyed = false;
111
- BatchedBridge.registerCallableModule(
112
- `FullscreenBridge-${this.nativeId}`,
113
- this
114
- );
115
- FullscreenHandlerModule.registerHandler(this.nativeId);
116
- }
117
- setFullscreenHandler(fullscreenHandler) {
118
- if (this.fullscreenHandler === fullscreenHandler) {
119
- return;
120
- }
121
- this.fullscreenHandler = fullscreenHandler;
122
- FullscreenHandlerModule.setIsFullscreenActive(
123
- this.nativeId,
124
- fullscreenHandler?.isFullscreenActive ?? false
125
- );
126
- }
127
- /**
128
- * Destroys the native FullscreenHandler
129
- */
130
- destroy() {
131
- if (!this.isDestroyed) {
132
- FullscreenHandlerModule.destroy(this.nativeId);
133
- this.isDestroyed = true;
134
- }
135
- }
136
- // noinspection JSUnusedGlobalSymbols
137
- /**
138
- * Called by native code, when the UI should enter fullscreen.
139
- */
140
- enterFullscreen() {
141
- this.fullscreenHandler?.enterFullscreen();
142
- FullscreenHandlerModule.onFullscreenChanged(
143
- this.nativeId,
144
- this.fullscreenHandler?.isFullscreenActive ?? false
145
- );
146
- }
147
- // noinspection JSUnusedGlobalSymbols
148
- /**
149
- * Called by native code, when the UI should exit fullscreen.
150
- */
151
- exitFullscreen() {
152
- this.fullscreenHandler?.exitFullscreen();
153
- FullscreenHandlerModule.onFullscreenChanged(
154
- this.nativeId,
155
- this.fullscreenHandler?.isFullscreenActive ?? false
156
- );
157
- }
158
- };
159
-
160
- // src/ui/custommessagehandlerbridge.ts
161
- import { NativeModules as NativeModules4 } from "react-native";
162
- import BatchedBridge2 from "react-native/Libraries/BatchedBridge/BatchedBridge";
163
- var Uuid2 = NativeModules4.UuidModule;
164
- var CustomMessageHandlerModule = NativeModules4.CustomMessageHandlerModule;
165
- var CustomMessageHandlerBridge = class {
166
- constructor(nativeId) {
167
- __publicField(this, "nativeId");
168
- __publicField(this, "customMessageHandler");
169
- __publicField(this, "isDestroyed");
170
- this.nativeId = nativeId ?? Uuid2.generate();
171
- this.isDestroyed = false;
172
- BatchedBridge2.registerCallableModule(
173
- `CustomMessageBridge-${this.nativeId}`,
174
- this
175
- );
176
- CustomMessageHandlerModule.registerHandler(this.nativeId);
177
- }
178
- setCustomMessageHandler(customMessageHandler) {
179
- this.customMessageHandler = customMessageHandler;
180
- this.customMessageHandler.customMessageSender = this;
181
- }
182
- /**
183
- * Destroys the native CustomMessageHandler
184
- */
185
- destroy() {
186
- if (!this.isDestroyed) {
187
- CustomMessageHandlerModule.destroy(this.nativeId);
188
- this.isDestroyed = true;
189
- }
190
- }
191
- // noinspection JSUnusedGlobalSymbols
192
- /**
193
- * Called by native code, when the UI sends a synchronous message.
194
- * @internal
195
- */
196
- receivedSynchronousMessage(message, data) {
197
- const result = this.customMessageHandler?.receivedSynchronousMessage(
198
- message,
199
- data
200
- );
201
- CustomMessageHandlerModule.onReceivedSynchronousMessageResult(
202
- this.nativeId,
203
- result
204
- );
205
- }
206
- // noinspection JSUnusedGlobalSymbols
207
- /**
208
- * Called by native code, when the UI sends an asynchronous message.
209
- * @internal
210
- */
211
- receivedAsynchronousMessage(message, data) {
212
- this.customMessageHandler?.receivedAsynchronousMessage(message, data);
213
- }
214
- // noinspection JSUnusedGlobalSymbols
215
- /**
216
- * Called by CustomMessageHandler, when sending a message to the UI.
217
- */
218
- sendMessage(message, data) {
219
- CustomMessageHandlerModule.sendMessage(this.nativeId, message, data);
220
- }
221
- };
222
-
223
- // src/components/PlayerView/index.tsx
224
- var styles = StyleSheet.create({
225
- baseStyle: {
226
- alignSelf: "stretch"
227
- }
228
- });
229
- function dispatch(command, node, ...args) {
230
- const commandId = Platform.OS === "android" ? UIManager.NativePlayerView.Commands[command].toString() : UIManager.getViewManagerConfig("NativePlayerView").Commands[command];
231
- UIManager.dispatchViewManagerCommand(
232
- node,
233
- commandId,
234
- Platform.select({ ios: args, android: [node, ...args] })
235
- );
236
- }
237
- function PlayerView({
238
- viewRef,
239
- style,
240
- player,
241
- config,
242
- fullscreenHandler,
243
- customMessageHandler,
244
- isFullscreenRequested = false,
245
- scalingMode,
246
- isPictureInPictureRequested = false,
247
- ...props
248
- }) {
249
- const workaroundViewManagerCommandNotSent = useCallback2(() => {
250
- setTimeout(() => player.getDuration(), 100);
251
- }, [player]);
252
- const nativeView = useRef(viewRef?.current || null);
253
- const proxy = useProxy(nativeView);
254
- const nativeViewStyle = StyleSheet.flatten([styles.baseStyle, style]);
255
- const fullscreenBridge = useRef(void 0);
256
- if (fullscreenHandler && !fullscreenBridge.current) {
257
- fullscreenBridge.current = new FullscreenHandlerBridge();
258
- }
259
- if (fullscreenBridge.current) {
260
- fullscreenBridge.current.setFullscreenHandler(fullscreenHandler);
261
- }
262
- const customMessageHandlerBridge = useRef(void 0);
263
- if (customMessageHandler && !customMessageHandlerBridge.current) {
264
- customMessageHandlerBridge.current = new CustomMessageHandlerBridge();
265
- }
266
- if (customMessageHandlerBridge.current && customMessageHandler) {
267
- customMessageHandlerBridge.current.setCustomMessageHandler(
268
- customMessageHandler
269
- );
270
- }
271
- useEffect(() => {
272
- player.initialize();
273
- const node = findNodeHandle2(nativeView.current);
274
- if (node) {
275
- if (customMessageHandlerBridge.current) {
276
- dispatch(
277
- "setCustomMessageHandlerBridgeId",
278
- node,
279
- customMessageHandlerBridge.current.nativeId
280
- );
281
- }
282
- dispatch("attachPlayer", node, player.nativeId, player.config);
283
- if (fullscreenBridge.current) {
284
- dispatch(
285
- "attachFullscreenBridge",
286
- node,
287
- fullscreenBridge.current.nativeId
288
- );
289
- }
290
- workaroundViewManagerCommandNotSent();
291
- }
292
- return () => {
293
- fullscreenBridge.current?.destroy();
294
- fullscreenBridge.current = void 0;
295
- customMessageHandlerBridge.current?.destroy();
296
- customMessageHandlerBridge.current = void 0;
297
- };
298
- }, [player, workaroundViewManagerCommandNotSent]);
299
- useEffect(() => {
300
- const node = findNodeHandle2(nativeView.current);
301
- if (node) {
302
- dispatch("setFullscreen", node, isFullscreenRequested);
303
- }
304
- }, [isFullscreenRequested, nativeView]);
305
- useEffect(() => {
306
- const node = findNodeHandle2(nativeView.current);
307
- if (node && scalingMode) {
308
- dispatch("setScalingMode", node, scalingMode);
309
- }
310
- }, [scalingMode, nativeView]);
311
- useEffect(() => {
312
- const node = findNodeHandle2(nativeView.current);
313
- if (node) {
314
- dispatch("setPictureInPicture", node, isPictureInPictureRequested);
315
- }
316
- }, [isPictureInPictureRequested, nativeView]);
317
- useEffect(() => {
318
- if (viewRef) {
319
- viewRef.current = nativeView.current;
320
- }
321
- }, [viewRef, nativeView]);
322
- return /* @__PURE__ */ React.createElement(
323
- NativePlayerView,
324
- {
325
- ref: nativeView,
326
- style: nativeViewStyle,
327
- fullscreenBridge: fullscreenBridge.current,
328
- customMessageHandlerBridge: customMessageHandlerBridge.current,
329
- config,
330
- onBmpAdBreakFinished: proxy(props.onAdBreakFinished),
331
- onBmpAdBreakStarted: proxy(props.onAdBreakStarted),
332
- onBmpAdClicked: proxy(props.onAdClicked),
333
- onBmpAdError: proxy(props.onAdError),
334
- onBmpAdFinished: proxy(props.onAdFinished),
335
- onBmpAdManifestLoad: proxy(props.onAdManifestLoad),
336
- onBmpAdManifestLoaded: proxy(props.onAdManifestLoaded),
337
- onBmpAdQuartile: proxy(props.onAdQuartile),
338
- onBmpAdScheduled: proxy(props.onAdScheduled),
339
- onBmpAdSkipped: proxy(props.onAdSkipped),
340
- onBmpAdStarted: proxy(props.onAdStarted),
341
- onBmpCastAvailable: proxy(props.onCastAvailable),
342
- onBmpCastPaused: proxy(props.onCastPaused),
343
- onBmpCastPlaybackFinished: proxy(props.onCastPlaybackFinished),
344
- onBmpCastPlaying: proxy(props.onCastPlaying),
345
- onBmpCastStarted: proxy(props.onCastStarted),
346
- onBmpCastStart: proxy(props.onCastStart),
347
- onBmpCastStopped: proxy(props.onCastStopped),
348
- onBmpCastTimeUpdated: proxy(props.onCastTimeUpdated),
349
- onBmpCastWaitingForDevice: proxy(props.onCastWaitingForDevice),
350
- onBmpCueEnter: proxy(props.onCueEnter),
351
- onBmpCueExit: proxy(props.onCueExit),
352
- onBmpDestroy: proxy(props.onDestroy),
353
- onBmpEvent: proxy(props.onEvent),
354
- onBmpFullscreenEnabled: proxy(props.onFullscreenEnabled),
355
- onBmpFullscreenDisabled: proxy(props.onFullscreenDisabled),
356
- onBmpFullscreenEnter: proxy(props.onFullscreenEnter),
357
- onBmpFullscreenExit: proxy(props.onFullscreenExit),
358
- onBmpMuted: proxy(props.onMuted),
359
- onBmpPaused: proxy(props.onPaused),
360
- onBmpPictureInPictureAvailabilityChanged: proxy(
361
- props.onPictureInPictureAvailabilityChanged
362
- ),
363
- onBmpPictureInPictureEnter: proxy(props.onPictureInPictureEnter),
364
- onBmpPictureInPictureEntered: proxy(props.onPictureInPictureEntered),
365
- onBmpPictureInPictureExit: proxy(props.onPictureInPictureExit),
366
- onBmpPictureInPictureExited: proxy(props.onPictureInPictureExited),
367
- onBmpPlay: proxy(props.onPlay),
368
- onBmpPlaybackFinished: proxy(props.onPlaybackFinished),
369
- onBmpPlaybackSpeedChanged: proxy(props.onPlaybackSpeedChanged),
370
- onBmpPlayerActive: proxy(props.onPlayerActive),
371
- onBmpPlayerError: proxy(props.onPlayerError),
372
- onBmpPlayerWarning: proxy(props.onPlayerWarning),
373
- onBmpPlaying: proxy(props.onPlaying),
374
- onBmpReady: proxy(props.onReady),
375
- onBmpSeek: proxy(props.onSeek),
376
- onBmpSeeked: proxy(props.onSeeked),
377
- onBmpTimeShift: proxy(props.onTimeShift),
378
- onBmpTimeShifted: proxy(props.onTimeShifted),
379
- onBmpStallStarted: proxy(props.onStallStarted),
380
- onBmpStallEnded: proxy(props.onStallEnded),
381
- onBmpSourceError: proxy(props.onSourceError),
382
- onBmpSourceLoad: proxy(props.onSourceLoad),
383
- onBmpSourceLoaded: proxy(props.onSourceLoaded),
384
- onBmpSourceUnloaded: proxy(props.onSourceUnloaded),
385
- onBmpSourceWarning: proxy(props.onSourceWarning),
386
- onBmpAudioAdded: proxy(props.onAudioAdded),
387
- onBmpAudioChanged: proxy(props.onAudioChanged),
388
- onBmpAudioRemoved: proxy(props.onAudioRemoved),
389
- onBmpSubtitleAdded: proxy(props.onSubtitleAdded),
390
- onBmpSubtitleChanged: proxy(props.onSubtitleChanged),
391
- onBmpSubtitleRemoved: proxy(props.onSubtitleRemoved),
392
- onBmpTimeChanged: proxy(props.onTimeChanged),
393
- onBmpUnmuted: proxy(props.onUnmuted),
394
- onBmpVideoDownloadQualityChanged: proxy(
395
- props.onVideoDownloadQualityChanged
396
- ),
397
- onBmpVideoPlaybackQualityChanged: proxy(
398
- props.onVideoPlaybackQualityChanged
399
- ),
400
- onBmpDownloadFinished: proxy(props.onDownloadFinished)
401
- }
402
- );
403
- }
404
-
405
- // src/components/PlayerView/playerViewConfig.ts
406
- var Variant = class {
407
- /**
408
- * Specifies the function name that will be used to initialize the `UIManager`
409
- * for the Bitmovin Player Web UI.
410
- *
411
- * The function is called on the `window` object with the `Player` as the first argument and
412
- * the `UIConfig` as the second argument.
413
- *
414
- * Example:
415
- * When you added a new function or want to use a different function of our `UIFactory`,
416
- * you can specify the full qualifier name including namespaces.
417
- * e.g. `bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI` for the SmallScreenUi.
418
- * @see UIFactory https://github.com/bitmovin/bitmovin-player-ui/blob/develop/src/ts/uifactory.ts#L60
419
- *
420
- * Notes:
421
- * - It's not necessary to use our `UIFactory`. Any static function can be specified.
422
- */
423
- constructor(uiManagerFactoryFunction) {
424
- this.uiManagerFactoryFunction = uiManagerFactoryFunction;
425
- }
426
- };
427
- var SmallScreenUi = class extends Variant {
428
- constructor() {
429
- super("bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI");
430
- }
431
- };
432
- var TvUi = class extends Variant {
433
- constructor() {
434
- super("bitmovin.playerui.UIFactory.buildDefaultTvUI");
435
- }
436
- };
437
- var CustomUi = class extends Variant {
438
- constructor(uiManagerFactoryFunction) {
439
- super(uiManagerFactoryFunction);
440
- }
441
- };
442
- var SurfaceType = /* @__PURE__ */ ((SurfaceType2) => {
443
- SurfaceType2["SurfaceView"] = "SurfaceView";
444
- SurfaceType2["TextureView"] = "TextureView";
445
- return SurfaceType2;
446
- })(SurfaceType || {});
447
-
448
- // src/drm/index.ts
449
- import { NativeModules as NativeModules6, Platform as Platform2 } from "react-native";
450
- import BatchedBridge3 from "react-native/Libraries/BatchedBridge/BatchedBridge";
451
-
452
- // src/nativeInstance.ts
453
- import { NativeModules as NativeModules5 } from "react-native";
454
- var Uuid3 = NativeModules5.UuidModule;
455
- var NativeInstance = class {
456
- /**
457
- * Generate UUID in case the user-defined `nativeId` is empty.
458
- */
459
- constructor(config) {
460
- /**
461
- * Optionally user-defined string `id` for the native instance, or UUIDv4.
462
- */
463
- __publicField(this, "nativeId");
464
- /**
465
- * The configuration object used to initialize this instance.
466
- */
467
- __publicField(this, "config");
468
- this.config = config;
469
- this.nativeId = config?.nativeId ?? Uuid3.generate();
470
- }
471
- };
472
-
473
- // src/drm/index.ts
474
- var DrmModule = NativeModules6.DrmModule;
475
- var Drm = class extends NativeInstance {
476
- constructor() {
477
- super(...arguments);
478
- /**
479
- * Whether this object's native instance has been created.
480
- */
481
- __publicField(this, "isInitialized", false);
482
- /**
483
- * Whether this object's native instance has been disposed.
484
- */
485
- __publicField(this, "isDestroyed", false);
486
- /**
487
- * Allocates the DRM config instance and its resources natively.
488
- */
489
- __publicField(this, "initialize", () => {
490
- if (!this.isInitialized) {
491
- BatchedBridge3.registerCallableModule(`DRM-${this.nativeId}`, this);
492
- DrmModule.initWithConfig(this.nativeId, this.config);
493
- this.isInitialized = true;
494
- }
495
- });
496
- /**
497
- * Destroys the native DRM config and releases all of its allocated resources.
498
- */
499
- __publicField(this, "destroy", () => {
500
- if (!this.isDestroyed) {
501
- DrmModule.destroy(this.nativeId);
502
- this.isDestroyed = true;
503
- }
504
- });
505
- /**
506
- * iOS only.
507
- *
508
- * Applies the user-defined `prepareCertificate` function to native's `certificate` data and store
509
- * the result back in `DrmModule`.
510
- *
511
- * Called from native code when `FairplayConfig.prepareCertificate` is dispatched.
512
- *
513
- * @param certificate - Base64 encoded certificate data.
514
- */
515
- __publicField(this, "onPrepareCertificate", (certificate) => {
516
- if (this.config?.fairplay?.prepareCertificate) {
517
- DrmModule.setPreparedCertificate(
518
- this.nativeId,
519
- this.config?.fairplay?.prepareCertificate?.(certificate)
520
- );
521
- }
522
- });
523
- /**
524
- * Applies the user-defined `prepareMessage` function to native's `message` data and store
525
- * the result back in `DrmModule`.
526
- *
527
- * Called from native code when `prepareMessage` is dispatched.
528
- *
529
- * @param message - Base64 encoded message data.
530
- * @param assetId - Optional asset ID. Only sent by iOS.
531
- */
532
- __publicField(this, "onPrepareMessage", (message, assetId) => {
533
- const config = Platform2.OS === "ios" ? this.config?.fairplay : this.config?.widevine;
534
- if (config && config.prepareMessage) {
535
- DrmModule.setPreparedMessage(
536
- this.nativeId,
537
- Platform2.OS === "ios" ? config.prepareMessage?.(message, assetId) : config.prepareMessage?.(message)
538
- );
539
- }
540
- });
541
- /**
542
- * iOS only.
543
- *
544
- * Applies the user-defined `prepareSyncMessage` function to native's `syncMessage` data and
545
- * store the result back in `DrmModule`.
546
- *
547
- * Called from native code when `FairplayConfig.prepareSyncMessage` is dispatched.
548
- *
549
- * @param syncMessage - Base64 encoded sync SPC message data.
550
- */
551
- __publicField(this, "onPrepareSyncMessage", (syncMessage, assetId) => {
552
- if (this.config?.fairplay?.prepareSyncMessage) {
553
- DrmModule.setPreparedSyncMessage(
554
- this.nativeId,
555
- this.config?.fairplay?.prepareSyncMessage?.(syncMessage, assetId)
556
- );
557
- }
558
- });
559
- /**
560
- * Applies the user-defined `prepareLicense` function to native's `license` data and store
561
- * the result back in `DrmModule`.
562
- *
563
- * Called from native code when `prepareLicense` is dispatched.
564
- *
565
- * @param license - Base64 encoded license data.
566
- */
567
- __publicField(this, "onPrepareLicense", (license) => {
568
- const prepareLicense = Platform2.OS === "ios" ? this.config?.fairplay?.prepareLicense : this.config?.widevine?.prepareLicense;
569
- if (prepareLicense) {
570
- DrmModule.setPreparedLicense(this.nativeId, prepareLicense(license));
571
- }
572
- });
573
- /**
574
- * iOS only.
575
- *
576
- * Applies the user-defined `prepareLicenseServerUrl` function to native's `licenseServerUrl` data
577
- * and store the result back in `DrmModule`.
578
- *
579
- * Called from native code when `FairplayConfig.prepareLicenseServerUrl` is dispatched.
580
- *
581
- * @param licenseServerUrl - The license server URL string.
582
- */
583
- __publicField(this, "onPrepareLicenseServerUrl", (licenseServerUrl) => {
584
- if (this.config?.fairplay?.prepareLicenseServerUrl) {
585
- DrmModule.setPreparedLicenseServerUrl(
586
- this.nativeId,
587
- this.config?.fairplay?.prepareLicenseServerUrl?.(licenseServerUrl)
588
- );
589
- }
590
- });
591
- /**
592
- * iOS only.
593
- *
594
- * Applies the user-defined `prepareContentId` function to native's `contentId` string
595
- * and store the result back in `DrmModule`.
596
- *
597
- * Called from native code when `FairplayConfig.prepareContentId` is dispatched.
598
- *
599
- * @param contentId - The extracted contentId string.
600
- */
601
- __publicField(this, "onPrepareContentId", (contentId) => {
602
- if (this.config?.fairplay?.prepareContentId) {
603
- DrmModule.setPreparedContentId(
604
- this.nativeId,
605
- this.config?.fairplay?.prepareContentId?.(contentId)
606
- );
607
- }
608
- });
609
- }
610
- };
611
-
612
- // src/hooks/usePlayer.ts
613
- import { useRef as useRef2 } from "react";
614
-
615
- // src/player.ts
616
- import { NativeModules as NativeModules11, Platform as Platform3 } from "react-native";
617
-
618
- // src/source.ts
619
- import { NativeModules as NativeModules7 } from "react-native";
620
- var SourceModule = NativeModules7.SourceModule;
621
- var SourceType = /* @__PURE__ */ ((SourceType2) => {
622
- SourceType2["NONE"] = "none";
623
- SourceType2["HLS"] = "hls";
624
- SourceType2["DASH"] = "dash";
625
- SourceType2["PROGRESSIVE"] = "progressive";
626
- return SourceType2;
627
- })(SourceType || {});
628
- var LoadingState = /* @__PURE__ */ ((LoadingState2) => {
629
- LoadingState2[LoadingState2["UNLOADED"] = 0] = "UNLOADED";
630
- LoadingState2[LoadingState2["LOADING"] = 1] = "LOADING";
631
- LoadingState2[LoadingState2["LOADED"] = 2] = "LOADED";
632
- return LoadingState2;
633
- })(LoadingState || {});
634
- var TimelineReferencePoint = /* @__PURE__ */ ((TimelineReferencePoint2) => {
635
- TimelineReferencePoint2["START"] = "start";
636
- TimelineReferencePoint2["END"] = "end";
637
- return TimelineReferencePoint2;
638
- })(TimelineReferencePoint || {});
639
- var Source = class extends NativeInstance {
640
- constructor() {
641
- super(...arguments);
642
- /**
643
- * The native DRM config reference of this source.
644
- */
645
- __publicField(this, "drm");
646
- /**
647
- * The remote control config for this source.
648
- * This is only supported on iOS.
649
- *
650
- * @platform iOS
651
- */
652
- __publicField(this, "remoteControl", null);
653
- /**
654
- * Whether the native {@link Source} object has been created.
655
- */
656
- __publicField(this, "isInitialized", false);
657
- /**
658
- * Whether the native {@link Source} object has been disposed.
659
- */
660
- __publicField(this, "isDestroyed", false);
661
- /**
662
- * Allocates the native {@link Source} instance and its resources natively.
663
- */
664
- __publicField(this, "initialize", () => {
665
- if (!this.isInitialized) {
666
- const sourceMetadata = this.config?.analyticsSourceMetadata;
667
- if (this.config?.drmConfig) {
668
- this.drm = new Drm(this.config.drmConfig);
669
- this.drm.initialize();
670
- }
671
- if (sourceMetadata) {
672
- SourceModule.initWithAnalyticsConfig(
673
- this.nativeId,
674
- this.drm?.nativeId,
675
- this.config,
676
- this.remoteControl,
677
- sourceMetadata
678
- );
679
- } else {
680
- SourceModule.initWithConfig(
681
- this.nativeId,
682
- this.drm?.nativeId,
683
- this.config,
684
- this.remoteControl
685
- );
686
- }
687
- this.isInitialized = true;
688
- }
689
- });
690
- /**
691
- * Destroys the native {@link Source} and releases all of its allocated resources.
692
- */
693
- __publicField(this, "destroy", () => {
694
- if (!this.isDestroyed) {
695
- SourceModule.destroy(this.nativeId);
696
- this.drm?.destroy();
697
- this.isDestroyed = true;
698
- }
699
- });
700
- /**
701
- * The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.
702
- * Default value is `0` if the duration is not available or not known.
703
- */
704
- __publicField(this, "duration", async () => {
705
- return SourceModule.duration(this.nativeId);
706
- });
707
- /**
708
- * Whether the source is currently active in a player (i.e. playing back or paused).
709
- * Only one source can be active in the same player instance at any time.
710
- */
711
- __publicField(this, "isActive", async () => {
712
- return SourceModule.isActive(this.nativeId);
713
- });
714
- /**
715
- * Whether the source is currently attached to a player instance.
716
- */
717
- __publicField(this, "isAttachedToPlayer", async () => {
718
- return SourceModule.isAttachedToPlayer(this.nativeId);
719
- });
720
- /**
721
- * Metadata for the currently loaded source.
722
- */
723
- __publicField(this, "metadata", async () => {
724
- return SourceModule.getMetadata(this.nativeId);
725
- });
726
- /**
727
- * Set metadata for the currently loaded source.
728
- * Setting the metadata to `null` clears the metadata object in native source.
729
- *
730
- * @param metadata metadata to be set.
731
- */
732
- __publicField(this, "setMetadata", (metadata) => {
733
- SourceModule.setMetadata(this.nativeId, metadata);
734
- });
735
- /**
736
- * The current `LoadingState` of the source.
737
- */
738
- __publicField(this, "loadingState", async () => {
739
- return SourceModule.loadingState(this.nativeId);
740
- });
741
- /**
742
- * @returns a `Thumbnail` for the specified playback time if available.
743
- * Supported thumbnail formats are:
744
- * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms
745
- * - HLS `Image Media Playlist` in the multivariant playlist, Android-only
746
- * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only
747
- * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
748
- *
749
- * @param time - The time in seconds for which to retrieve the thumbnail.
750
- */
751
- __publicField(this, "getThumbnail", async (time) => {
752
- return SourceModule.getThumbnail(this.nativeId, time);
753
- });
754
- }
755
- };
756
-
757
- // src/bufferApi.ts
758
- import { NativeModules as NativeModules8 } from "react-native";
759
- var BufferModule = NativeModules8.BufferModule;
760
- var MediaType = /* @__PURE__ */ ((MediaType2) => {
761
- MediaType2["AUDIO"] = "audio";
762
- MediaType2["VIDEO"] = "video";
763
- return MediaType2;
764
- })(MediaType || {});
765
- var BufferType = /* @__PURE__ */ ((BufferType2) => {
766
- BufferType2["FORWARD_DURATION"] = "forwardDuration";
767
- BufferType2["BACKWARD_DURATION"] = "backwardDuration";
768
- return BufferType2;
769
- })(BufferType || {});
770
- var BufferApi = class {
771
- constructor(playerId) {
772
- /**
773
- * The native player id that this buffer api is attached to.
774
- */
775
- __publicField(this, "nativeId");
776
- /**
777
- * Gets the {@link BufferLevel|buffer level} from the Player
778
- * @param type The {@link BufferType} to return the level for.
779
- * @returns a {@link BufferLevels} that contains {@link BufferLevel} values for audio and video.
780
- */
781
- __publicField(this, "getLevel", async (type) => {
782
- return BufferModule.getLevel(this.nativeId, type);
783
- });
784
- /**
785
- * Sets the target buffer level for the chosen buffer {@link BufferType} across all {@link MediaType} options.
786
- *
787
- * @param type The {@link BufferType} to set the target level for. On iOS and tvOS, only {@link BufferType.FORWARD_DURATION} is supported.
788
- * @param value The value to set. On iOS and tvOS when passing `0`, the player will choose an appropriate forward buffer duration suitable for most use-cases. On Android setting to `0` will have no effect.
789
- */
790
- __publicField(this, "setTargetLevel", async (type, value) => {
791
- return BufferModule.setTargetLevel(this.nativeId, type, value);
792
- });
793
- this.nativeId = playerId;
794
- }
795
- };
796
-
797
- // src/network/index.ts
798
- import { NativeModules as NativeModules9 } from "react-native";
799
- import BatchedBridge4 from "react-native/Libraries/BatchedBridge/BatchedBridge";
800
-
801
- // src/network/networkConfig.ts
802
- var HttpRequestType = /* @__PURE__ */ ((HttpRequestType2) => {
803
- HttpRequestType2["ManifestDash"] = "manifest/dash";
804
- HttpRequestType2["ManifestHlsMaster"] = "manifest/hls/master";
805
- HttpRequestType2["ManifestHlsVariant"] = "manifest/hls/variant";
806
- HttpRequestType2["ManifestSmooth"] = "manifest/smooth";
807
- HttpRequestType2["MediaProgressive"] = "media/progressive";
808
- HttpRequestType2["MediaAudio"] = "media/audio";
809
- HttpRequestType2["MediaVideo"] = "media/video";
810
- HttpRequestType2["MediaSubtitles"] = "media/subtitles";
811
- HttpRequestType2["MediaThumbnails"] = "media/thumbnails";
812
- HttpRequestType2["DrmLicenseFairplay"] = "drm/license/fairplay";
813
- HttpRequestType2["DrmCertificateFairplay"] = "drm/certificate/fairplay";
814
- HttpRequestType2["DrmLicenseWidevine"] = "drm/license/widevine";
815
- HttpRequestType2["KeyHlsAes"] = "key/hls/aes";
816
- HttpRequestType2["Unknown"] = "unknown";
817
- return HttpRequestType2;
818
- })(HttpRequestType || {});
819
-
820
- // src/network/index.ts
821
- var NetworkModule = NativeModules9.NetworkModule;
822
- var Network = class extends NativeInstance {
823
- constructor() {
824
- super(...arguments);
825
- /**
826
- * Whether this object's native instance has been created.
827
- */
828
- __publicField(this, "isInitialized", false);
829
- /**
830
- * Whether this object's native instance has been disposed.
831
- */
832
- __publicField(this, "isDestroyed", false);
833
- /**
834
- * Allocates the Network config instance and its resources natively.
835
- */
836
- __publicField(this, "initialize", () => {
837
- if (!this.isInitialized) {
838
- BatchedBridge4.registerCallableModule(`Network-${this.nativeId}`, this);
839
- NetworkModule.initWithConfig(this.nativeId, this.config);
840
- this.isInitialized = true;
841
- }
842
- });
843
- /**
844
- * Destroys the native Network config and releases all of its allocated resources.
845
- */
846
- __publicField(this, "destroy", () => {
847
- if (!this.isDestroyed) {
848
- NetworkModule.destroy(this.nativeId);
849
- this.isDestroyed = true;
850
- }
851
- });
852
- /**
853
- * Applies the user-defined `preprocessHttpRequest` function to native's `type` and `request` data and store
854
- * the result back in `NetworkModule`.
855
- *
856
- * Called from native code when `NetworkConfig.preprocessHttpRequest` is dispatched.
857
- *
858
- * @param requestId Passed through to identify the completion handler of the request on native.
859
- * @param type Type of the request to be made.
860
- * @param request The HTTP request to process.
861
- */
862
- __publicField(this, "onPreprocessHttpRequest", (requestId, type, request) => {
863
- this.config?.preprocessHttpRequest?.(type, request).then((resultRequest) => {
864
- NetworkModule.setPreprocessedHttpRequest(requestId, resultRequest);
865
- }).catch(() => {
866
- NetworkModule.setPreprocessedHttpRequest(requestId, request);
867
- });
868
- });
869
- /**
870
- * Applies the user-defined `preprocessHttpResponse` function to native's `type` and `response` data and store
871
- * the result back in `NetworkModule`.
872
- *
873
- * Called from native code when `NetworkConfig.preprocessHttpResponse` is dispatched.
874
- *
875
- * @param responseId Passed through to identify the completion handler of the response on native.
876
- * @param type Type of the request to be made.
877
- * @param response The HTTP response to process.
878
- */
879
- __publicField(this, "onPreprocessHttpResponse", (responseId, type, response) => {
880
- this.config?.preprocessHttpResponse?.(type, response).then((resultResponse) => {
881
- NetworkModule.setPreprocessedHttpResponse(responseId, resultResponse);
882
- }).catch(() => {
883
- NetworkModule.setPreprocessedHttpResponse(responseId, response);
884
- });
885
- });
886
- }
887
- };
888
-
889
- // src/decoder/index.ts
890
- import { NativeModules as NativeModules10 } from "react-native";
891
- import BatchedBridge5 from "react-native/Libraries/BatchedBridge/BatchedBridge";
892
- var DecoderConfigModule = NativeModules10.DecoderConfigModule;
893
- var DecoderConfigBridge = class extends NativeInstance {
894
- constructor(decoderConfig) {
895
- super(decoderConfig);
896
- /**
897
- * Whether this object's native instance has been created.
898
- */
899
- __publicField(this, "isInitialized", false);
900
- /**
901
- * Whether this object's native instance has been disposed.
902
- */
903
- __publicField(this, "isDestroyed", false);
904
- }
905
- initialize() {
906
- if (!this.isInitialized) {
907
- BatchedBridge5.registerCallableModule(
908
- `DecoderConfigBridge-${this.nativeId}`,
909
- this
910
- );
911
- DecoderConfigModule.initWithConfig(this.nativeId, this.config);
912
- this.isInitialized = true;
913
- }
914
- }
915
- /**
916
- * Destroys the native `DecoderConfig`
917
- */
918
- destroy() {
919
- if (!this.isDestroyed) {
920
- DecoderConfigModule.destroy(this.nativeId);
921
- this.isDestroyed = true;
922
- }
923
- }
924
- // noinspection JSUnusedGlobalSymbols
925
- /**
926
- * Called by native code, when the decoder priority should be evaluated.
927
- */
928
- overrideDecodersPriority(context, preferredDecoders) {
929
- const orderedPriority = this.config?.decoderPriorityProvider?.overrideDecodersPriority(
930
- context,
931
- preferredDecoders
932
- ) ?? preferredDecoders;
933
- DecoderConfigModule.overrideDecoderPriorityProviderComplete(
934
- this.nativeId,
935
- orderedPriority
936
- );
937
- }
938
- };
939
-
940
- // src/player.ts
941
- var PlayerModule = NativeModules11.PlayerModule;
942
- var Player = class extends NativeInstance {
943
- constructor() {
944
- super(...arguments);
945
- /**
946
- * Whether the native `Player` object has been created.
947
- */
948
- __publicField(this, "isInitialized", false);
949
- /**
950
- * Whether the native `Player` object has been disposed.
951
- */
952
- __publicField(this, "isDestroyed", false);
953
- /**
954
- * Currently active source, or `null` if none is active.
955
- */
956
- __publicField(this, "source");
957
- /**
958
- * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.
959
- *
960
- * `undefined` if the player was created without analytics support.
961
- */
962
- __publicField(this, "analytics");
963
- /**
964
- * The {@link BufferApi} for interactions regarding the buffer.
965
- */
966
- __publicField(this, "buffer", new BufferApi(this.nativeId));
967
- __publicField(this, "network");
968
- __publicField(this, "decoderConfig");
969
- /**
970
- * Allocates the native `Player` instance and its resources natively.
971
- */
972
- __publicField(this, "initialize", () => {
973
- if (!this.isInitialized) {
974
- if (this.config?.networkConfig) {
975
- this.network = new Network(this.config.networkConfig);
976
- this.network.initialize();
977
- }
978
- this.maybeInitDecoderConfig();
979
- const analyticsConfig = this.config?.analyticsConfig;
980
- if (analyticsConfig) {
981
- PlayerModule.initWithAnalyticsConfig(
982
- this.nativeId,
983
- this.config,
984
- this.network?.nativeId,
985
- this.decoderConfig?.nativeId,
986
- analyticsConfig
987
- );
988
- this.analytics = new AnalyticsApi(this.nativeId);
989
- } else {
990
- PlayerModule.initWithConfig(
991
- this.nativeId,
992
- this.config,
993
- this.network?.nativeId,
994
- this.decoderConfig?.nativeId
995
- );
996
- }
997
- this.isInitialized = true;
998
- }
999
- });
1000
- /**
1001
- * Destroys the native `Player` and releases all of its allocated resources.
1002
- */
1003
- __publicField(this, "destroy", () => {
1004
- if (!this.isDestroyed) {
1005
- PlayerModule.destroy(this.nativeId);
1006
- this.source?.destroy();
1007
- this.network?.destroy();
1008
- this.decoderConfig?.destroy();
1009
- this.isDestroyed = true;
1010
- }
1011
- });
1012
- /**
1013
- * Loads a new {@link Source} from `sourceConfig` into the player.
1014
- */
1015
- __publicField(this, "load", (sourceConfig) => {
1016
- this.loadSource(new Source(sourceConfig));
1017
- });
1018
- /**
1019
- * Loads the downloaded content from {@link OfflineContentManager} into the player.
1020
- */
1021
- __publicField(this, "loadOfflineContent", (offlineContentManager, options) => {
1022
- PlayerModule.loadOfflineContent(
1023
- this.nativeId,
1024
- offlineContentManager.nativeId,
1025
- options
1026
- );
1027
- });
1028
- /**
1029
- * Loads the given {@link Source} into the player.
1030
- */
1031
- __publicField(this, "loadSource", (source) => {
1032
- source.initialize();
1033
- this.source = source;
1034
- PlayerModule.loadSource(this.nativeId, source.nativeId);
1035
- });
1036
- /**
1037
- * Unloads all {@link Source}s from the player.
1038
- */
1039
- __publicField(this, "unload", () => {
1040
- PlayerModule.unload(this.nativeId);
1041
- });
1042
- /**
1043
- * Starts or resumes playback after being paused. Has no effect if the player is already playing.
1044
- */
1045
- __publicField(this, "play", () => {
1046
- PlayerModule.play(this.nativeId);
1047
- });
1048
- /**
1049
- * Pauses the video if it is playing. Has no effect if the player is already paused.
1050
- */
1051
- __publicField(this, "pause", () => {
1052
- PlayerModule.pause(this.nativeId);
1053
- });
1054
- /**
1055
- * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be
1056
- * greater than the total duration of the video. Has no effect when watching a live stream since
1057
- * seeking is not possible.
1058
- *
1059
- * @param time - The time to seek to in seconds.
1060
- */
1061
- __publicField(this, "seek", (time) => {
1062
- PlayerModule.seek(this.nativeId, time);
1063
- });
1064
- /**
1065
- * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the
1066
- * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is
1067
- * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.
1068
- * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.
1069
- * Has no effect for VoD.
1070
- *
1071
- * Has no effect if no sources are loaded.
1072
- *
1073
- * @param offset - Target offset from the live edge in seconds.
1074
- */
1075
- __publicField(this, "timeShift", (offset) => {
1076
- PlayerModule.timeShift(this.nativeId, offset);
1077
- });
1078
- /**
1079
- * Mutes the player if an audio track is available. Has no effect if the player is already muted.
1080
- */
1081
- __publicField(this, "mute", () => {
1082
- PlayerModule.mute(this.nativeId);
1083
- });
1084
- /**
1085
- * Unmutes the player if it is muted. Has no effect if the player is already unmuted.
1086
- */
1087
- __publicField(this, "unmute", () => {
1088
- PlayerModule.unmute(this.nativeId);
1089
- });
1090
- /**
1091
- * Sets the player's volume between 0 (silent) and 100 (max volume).
1092
- *
1093
- * @param volume - The volume level to set.
1094
- */
1095
- __publicField(this, "setVolume", (volume) => {
1096
- PlayerModule.setVolume(this.nativeId, volume);
1097
- });
1098
- /**
1099
- * @returns The player's current volume level.
1100
- */
1101
- __publicField(this, "getVolume", async () => {
1102
- return PlayerModule.getVolume(this.nativeId);
1103
- });
1104
- /**
1105
- * @returns The current playback time in seconds.
1106
- *
1107
- * For VoD streams the returned time ranges between 0 and the duration of the asset.
1108
- *
1109
- * For live streams it can be specified if an absolute UNIX timestamp or a value
1110
- * relative to the playback start should be returned.
1111
- *
1112
- * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').
1113
- */
1114
- __publicField(this, "getCurrentTime", async (mode = "absolute") => {
1115
- return PlayerModule.currentTime(this.nativeId, mode);
1116
- });
1117
- /**
1118
- * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.
1119
- */
1120
- __publicField(this, "getDuration", async () => {
1121
- return PlayerModule.duration(this.nativeId);
1122
- });
1123
- /**
1124
- * @returns `true` if the player is muted.
1125
- */
1126
- __publicField(this, "isMuted", async () => {
1127
- return PlayerModule.isMuted(this.nativeId);
1128
- });
1129
- /**
1130
- * @returns `true` if the player is currently playing, i.e. has started and is not paused.
1131
- */
1132
- __publicField(this, "isPlaying", async () => {
1133
- return PlayerModule.isPlaying(this.nativeId);
1134
- });
1135
- /**
1136
- * @returns `true` if the player has started playback but it's currently paused.
1137
- */
1138
- __publicField(this, "isPaused", async () => {
1139
- return PlayerModule.isPaused(this.nativeId);
1140
- });
1141
- /**
1142
- * @returns `true` if the displayed video is a live stream.
1143
- */
1144
- __publicField(this, "isLive", async () => {
1145
- return PlayerModule.isLive(this.nativeId);
1146
- });
1147
- /**
1148
- * @remarks Only available for iOS devices.
1149
- * @returns `true` when media is played externally using AirPlay.
1150
- */
1151
- __publicField(this, "isAirPlayActive", async () => {
1152
- if (Platform3.OS === "android") {
1153
- console.warn(
1154
- `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`
1155
- );
1156
- return false;
1157
- }
1158
- return PlayerModule.isAirPlayActive(this.nativeId);
1159
- });
1160
- /**
1161
- * @remarks Only available for iOS devices.
1162
- * @returns `true` when AirPlay is available.
1163
- */
1164
- __publicField(this, "isAirPlayAvailable", async () => {
1165
- if (Platform3.OS === "android") {
1166
- console.warn(
1167
- `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`
1168
- );
1169
- return false;
1170
- }
1171
- return PlayerModule.isAirPlayAvailable(this.nativeId);
1172
- });
1173
- /**
1174
- * @returns The currently selected audio track or `null`.
1175
- */
1176
- __publicField(this, "getAudioTrack", async () => {
1177
- return PlayerModule.getAudioTrack(this.nativeId);
1178
- });
1179
- /**
1180
- * @returns An array containing {@link AudioTrack} objects for all available audio tracks.
1181
- */
1182
- __publicField(this, "getAvailableAudioTracks", async () => {
1183
- return PlayerModule.getAvailableAudioTracks(this.nativeId);
1184
- });
1185
- /**
1186
- * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.
1187
- *
1188
- * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.
1189
- */
1190
- __publicField(this, "setAudioTrack", async (trackIdentifier) => {
1191
- return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);
1192
- });
1193
- /**
1194
- * @returns The currently selected {@link SubtitleTrack} or `null`.
1195
- */
1196
- __publicField(this, "getSubtitleTrack", async () => {
1197
- return PlayerModule.getSubtitleTrack(this.nativeId);
1198
- });
1199
- /**
1200
- * @returns An array containing SubtitleTrack objects for all available subtitle tracks.
1201
- */
1202
- __publicField(this, "getAvailableSubtitles", async () => {
1203
- return PlayerModule.getAvailableSubtitles(this.nativeId);
1204
- });
1205
- /**
1206
- * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.
1207
- *
1208
- * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.
1209
- */
1210
- __publicField(this, "setSubtitleTrack", async (trackIdentifier) => {
1211
- return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier);
1212
- });
1213
- /**
1214
- * Dynamically schedules the {@link AdItem} for playback.
1215
- * Has no effect if there is no active playback session.
1216
- *
1217
- * @param adItem - Ad to be scheduled for playback.
1218
- *
1219
- * @platform iOS, Android
1220
- */
1221
- __publicField(this, "scheduleAd", (adItem) => {
1222
- PlayerModule.scheduleAd(this.nativeId, adItem);
1223
- });
1224
- /**
1225
- * Skips the current ad.
1226
- * Has no effect if the current ad is not skippable or if no ad is being played back.
1227
- *
1228
- * @platform iOS, Android
1229
- */
1230
- __publicField(this, "skipAd", () => {
1231
- PlayerModule.skipAd(this.nativeId);
1232
- });
1233
- /**
1234
- * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
1235
- * @platform iOS, Android
1236
- */
1237
- __publicField(this, "isAd", async () => {
1238
- return PlayerModule.isAd(this.nativeId);
1239
- });
1240
- /**
1241
- * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a
1242
- * live stream or no sources are loaded.
1243
- */
1244
- __publicField(this, "getTimeShift", async () => {
1245
- return PlayerModule.getTimeShift(this.nativeId);
1246
- });
1247
- /**
1248
- * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active
1249
- * {@link Source} is not a live stream or no sources are loaded.
1250
- */
1251
- __publicField(this, "getMaxTimeShift", async () => {
1252
- return PlayerModule.getMaxTimeShift(this.nativeId);
1253
- });
1254
- /**
1255
- * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate
1256
- * that is higher than this threshold will not be eligible for automatic quality selection.
1257
- *
1258
- * Can be set to `null` for no limitation.
1259
- */
1260
- __publicField(this, "setMaxSelectableBitrate", (bitrate) => {
1261
- PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);
1262
- });
1263
- /**
1264
- * @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.
1265
- * Supported thumbnail formats are:
1266
- * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms
1267
- * - HLS `Image Media Playlist` in the multivariant playlist, Android-only
1268
- * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only
1269
- * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
1270
- *
1271
- * @param time - The time in seconds for which to retrieve the thumbnail.
1272
- */
1273
- __publicField(this, "getThumbnail", async (time) => {
1274
- return PlayerModule.getThumbnail(this.nativeId, time);
1275
- });
1276
- /**
1277
- * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
1278
- * casting becomes available.
1279
- *
1280
- * @platform iOS, Android
1281
- */
1282
- __publicField(this, "isCastAvailable", async () => {
1283
- return PlayerModule.isCastAvailable(this.nativeId);
1284
- });
1285
- /**
1286
- * Whether video is currently being casted to a remote device and not played locally.
1287
- *
1288
- * @platform iOS, Android
1289
- */
1290
- __publicField(this, "isCasting", async () => {
1291
- return PlayerModule.isCasting(this.nativeId);
1292
- });
1293
- /**
1294
- * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
1295
- * should be sent.
1296
- *
1297
- * @platform iOS, Android
1298
- */
1299
- __publicField(this, "castVideo", () => {
1300
- PlayerModule.castVideo(this.nativeId);
1301
- });
1302
- /**
1303
- * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
1304
- *
1305
- * @platform iOS, Android
1306
- */
1307
- __publicField(this, "castStop", () => {
1308
- PlayerModule.castStop(this.nativeId);
1309
- });
1310
- /**
1311
- * Returns the currently selected video quality.
1312
- * @returns The currently selected video quality.
1313
- */
1314
- __publicField(this, "getVideoQuality", async () => {
1315
- return PlayerModule.getVideoQuality(this.nativeId);
1316
- });
1317
- /**
1318
- * Returns an array containing all available video qualities the player can adapt between.
1319
- * @returns An array containing all available video qualities the player can adapt between.
1320
- */
1321
- __publicField(this, "getAvailableVideoQualities", async () => {
1322
- return PlayerModule.getAvailableVideoQualities(this.nativeId);
1323
- });
1324
- /**
1325
- * Sets the video quality.
1326
- * @remarks Only available on Android.
1327
- * @platform Android
1328
- *
1329
- * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.
1330
- */
1331
- __publicField(this, "setVideoQuality", (qualityId) => {
1332
- if (Platform3.OS !== "android") {
1333
- console.warn(
1334
- `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`
1335
- );
1336
- return;
1337
- }
1338
- PlayerModule.setVideoQuality(this.nativeId, qualityId);
1339
- });
1340
- /**
1341
- * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.
1342
- * @note
1343
- * - Slow motion is indicated by values between `0` and `1`.
1344
- * - Fast forward by values greater than `1`.
1345
- * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.
1346
- * @note
1347
- * Negative values are ignored during Casting and on Android.
1348
- * @note
1349
- * During reverse playback the playback will continue until the beginning of the active source is
1350
- * reached. When reaching the beginning of the source, playback will be paused and the playback
1351
- * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be
1352
- * emitted in this case.
1353
- *
1354
- * @param playbackSpeed - The playback speed to set.
1355
- */
1356
- __publicField(this, "setPlaybackSpeed", (playbackSpeed) => {
1357
- PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);
1358
- });
1359
- /**
1360
- * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.
1361
- * @returns The player's current playback speed.
1362
- */
1363
- __publicField(this, "getPlaybackSpeed", async () => {
1364
- return PlayerModule.getPlaybackSpeed(this.nativeId);
1365
- });
1366
- /**
1367
- * Checks the possibility to play the media at specified playback speed.
1368
- * @param playbackSpeed - The playback speed to check.
1369
- * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
1370
- * @platform iOS, tvOS
1371
- */
1372
- __publicField(this, "canPlayAtPlaybackSpeed", async (playbackSpeed) => {
1373
- if (Platform3.OS === "android") {
1374
- console.warn(
1375
- `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`
1376
- );
1377
- return void 0;
1378
- }
1379
- return PlayerModule.canPlayAtPlaybackSpeed(this.nativeId, playbackSpeed);
1380
- });
1381
- __publicField(this, "maybeInitDecoderConfig", () => {
1382
- if (this.config?.playbackConfig?.decoderConfig == null) {
1383
- return;
1384
- }
1385
- if (Platform3.OS === "ios") {
1386
- return;
1387
- }
1388
- this.decoderConfig = new DecoderConfigBridge(
1389
- this.config.playbackConfig.decoderConfig
1390
- );
1391
- this.decoderConfig.initialize();
1392
- });
1393
- }
1394
- };
1395
-
1396
- // src/hooks/usePlayer.ts
1397
- function usePlayer(config) {
1398
- return useRef2(new Player(config)).current;
1399
- }
1400
-
1401
- // src/styleConfig.ts
1402
- var ScalingMode = /* @__PURE__ */ ((ScalingMode2) => {
1403
- ScalingMode2["Fit"] = "Fit";
1404
- ScalingMode2["Stretch"] = "Stretch";
1405
- ScalingMode2["Zoom"] = "Zoom";
1406
- return ScalingMode2;
1407
- })(ScalingMode || {});
1408
- var UserInterfaceType = /* @__PURE__ */ ((UserInterfaceType2) => {
1409
- UserInterfaceType2["Bitmovin"] = "Bitmovin";
1410
- UserInterfaceType2["System"] = "System";
1411
- UserInterfaceType2["Subtitle"] = "Subtitle";
1412
- return UserInterfaceType2;
1413
- })(UserInterfaceType || {});
1414
-
1415
- // src/ui/custommessagehandler.ts
1416
- var CustomMessageHandler = class {
1417
- /**
1418
- * Android and iOS only.
1419
- *
1420
- * Creates a new `CustomMessageHandler` instance to handle two-way communication between the integation and the Player UI.
1421
- *
1422
- * @param options - Configuration options for the `CustomMessageHandler` instance.
1423
- */
1424
- constructor({
1425
- onReceivedSynchronousMessage,
1426
- onReceivedAsynchronousMessage
1427
- }) {
1428
- __publicField(this, "onReceivedSynchronousMessage");
1429
- __publicField(this, "onReceivedAsynchronousMessage");
1430
- /** @internal */
1431
- __publicField(this, "customMessageSender");
1432
- this.onReceivedSynchronousMessage = onReceivedSynchronousMessage;
1433
- this.onReceivedAsynchronousMessage = onReceivedAsynchronousMessage;
1434
- }
1435
- /**
1436
- * Gets called when a synchronous message was received from the Bitmovin Web UI.
1437
- *
1438
- * @param message Identifier of the message.
1439
- * @param data Optional data of the message as string (can be a serialized object).
1440
- * @returns Optional return value as string which will be propagates back to the JS counterpart.
1441
- */
1442
- receivedSynchronousMessage(message, data) {
1443
- return this.onReceivedSynchronousMessage(message, data);
1444
- }
1445
- /**
1446
- * Gets called when an asynchronous message was received from the Bitmovin Web UI.
1447
- *
1448
- * @param message Identifier of the message.
1449
- * @param data Optional data of the message as string (can be a serialized object).
1450
- */
1451
- receivedAsynchronousMessage(message, data) {
1452
- this.onReceivedAsynchronousMessage(message, data);
1453
- }
1454
- /**
1455
- * Android and iOS only.
1456
- *
1457
- * Sends a message to the Player UI.
1458
- *
1459
- * @param message - Identifier for the callback which should be called.
1460
- * @param data - Payload for the callback.
1461
- */
1462
- sendMessage(message, data) {
1463
- this.customMessageSender?.sendMessage(message, data);
1464
- }
1465
- };
1466
-
1467
- // src/offline/offlineState.ts
1468
- var OfflineState = /* @__PURE__ */ ((OfflineState2) => {
1469
- OfflineState2["Downloaded"] = "Downloaded";
1470
- OfflineState2["Downloading"] = "Downloading";
1471
- OfflineState2["Suspended"] = "Suspended";
1472
- OfflineState2["NotDownloaded"] = "NotDownloaded";
1473
- return OfflineState2;
1474
- })(OfflineState || {});
1475
-
1476
- // src/offline/offlineContentManager.ts
1477
- import {
1478
- NativeEventEmitter,
1479
- NativeModules as NativeModules12
1480
- } from "react-native";
1481
-
1482
- // src/offline/offlineContentManagerListener.ts
1483
- var OfflineEventType = /* @__PURE__ */ ((OfflineEventType2) => {
1484
- OfflineEventType2["onCompleted"] = "onCompleted";
1485
- OfflineEventType2["onError"] = "onError";
1486
- OfflineEventType2["onProgress"] = "onProgress";
1487
- OfflineEventType2["onOptionsAvailable"] = "onOptionsAvailable";
1488
- OfflineEventType2["onDrmLicenseUpdated"] = "onDrmLicenseUpdated";
1489
- OfflineEventType2["onDrmLicenseExpired"] = "onDrmLicenseExpired";
1490
- OfflineEventType2["onSuspended"] = "onSuspended";
1491
- OfflineEventType2["onResumed"] = "onResumed";
1492
- OfflineEventType2["onCanceled"] = "onCanceled";
1493
- return OfflineEventType2;
1494
- })(OfflineEventType || {});
1495
-
1496
- // src/offline/offlineContentManager.ts
1497
- var OfflineModule = NativeModules12.BitmovinOfflineModule;
1498
- var handleBitmovinNativeOfflineEvent = (data, listeners) => {
1499
- listeners.forEach((listener) => {
1500
- if (!listener)
1501
- return;
1502
- if (data.eventType === "onCompleted" /* onCompleted */) {
1503
- listener.onCompleted?.(data);
1504
- } else if (data.eventType === "onError" /* onError */) {
1505
- listener.onError?.(data);
1506
- } else if (data.eventType === "onProgress" /* onProgress */) {
1507
- listener.onProgress?.(data);
1508
- } else if (data.eventType === "onOptionsAvailable" /* onOptionsAvailable */) {
1509
- listener.onOptionsAvailable?.(data);
1510
- } else if (data.eventType === "onDrmLicenseUpdated" /* onDrmLicenseUpdated */) {
1511
- listener.onDrmLicenseUpdated?.(data);
1512
- } else if (data.eventType === "onDrmLicenseExpired" /* onDrmLicenseExpired */) {
1513
- listener.onDrmLicenseExpired?.(data);
1514
- } else if (data.eventType === "onSuspended" /* onSuspended */) {
1515
- listener.onSuspended?.(data);
1516
- } else if (data.eventType === "onResumed" /* onResumed */) {
1517
- listener.onResumed?.(data);
1518
- } else if (data.eventType === "onCanceled" /* onCanceled */) {
1519
- listener.onCanceled?.(data);
1520
- }
1521
- });
1522
- };
1523
- var OfflineContentManager = class extends NativeInstance {
1524
- constructor(config) {
1525
- super(config);
1526
- __publicField(this, "isInitialized", false);
1527
- __publicField(this, "isDestroyed", false);
1528
- __publicField(this, "eventSubscription");
1529
- __publicField(this, "listeners", /* @__PURE__ */ new Set());
1530
- __publicField(this, "drm");
1531
- /**
1532
- * Allocates the native `OfflineManager` instance and its resources natively.
1533
- * Registers the `DeviceEventEmitter` listener to receive data from the native `OfflineContentManagerListener` callbacks
1534
- */
1535
- __publicField(this, "initialize", async () => {
1536
- let initPromise = Promise.resolve();
1537
- if (!this.isInitialized && this.config) {
1538
- this.eventSubscription = new NativeEventEmitter(
1539
- OfflineModule
1540
- ).addListener(
1541
- "BitmovinOfflineEvent",
1542
- (data) => {
1543
- if (this.nativeId !== data?.nativeId) {
1544
- return;
1545
- }
1546
- handleBitmovinNativeOfflineEvent(data, this.listeners);
1547
- }
1548
- );
1549
- if (this.config.sourceConfig.drmConfig) {
1550
- this.drm = new Drm(this.config.sourceConfig.drmConfig);
1551
- this.drm.initialize();
1552
- }
1553
- initPromise = OfflineModule.initWithConfig(
1554
- this.nativeId,
1555
- {
1556
- identifier: this.config.identifier,
1557
- sourceConfig: this.config.sourceConfig
1558
- },
1559
- this.drm?.nativeId
1560
- );
1561
- }
1562
- this.isInitialized = true;
1563
- return initPromise;
1564
- });
1565
- /**
1566
- * Adds a listener to the receive data from the native `OfflineContentManagerListener` callbacks
1567
- * Returns a function that removes this listener from the `OfflineContentManager` that registered it.
1568
- */
1569
- __publicField(this, "addListener", (listener) => {
1570
- this.listeners.add(listener);
1571
- return () => {
1572
- this.listeners.delete(listener);
1573
- };
1574
- });
1575
- /**
1576
- * Destroys the native `OfflineManager` and releases all of its allocated resources.
1577
- */
1578
- __publicField(this, "destroy", async () => {
1579
- if (!this.isDestroyed) {
1580
- this.isDestroyed = true;
1581
- this.eventSubscription?.remove?.();
1582
- this.listeners.clear();
1583
- this.drm?.destroy();
1584
- return OfflineModule.release(this.nativeId);
1585
- }
1586
- return Promise.resolve();
1587
- });
1588
- /**
1589
- * Gets the current state of the `OfflineContentManager`
1590
- */
1591
- __publicField(this, "state", async () => {
1592
- return OfflineModule.getState(this.nativeId);
1593
- });
1594
- /**
1595
- * Loads the current `OfflineContentOptions`.
1596
- * When the options are loaded the data will be passed to the `OfflineContentManagerListener.onOptionsAvailable`.
1597
- */
1598
- __publicField(this, "getOptions", async () => {
1599
- return OfflineModule.getOptions(this.nativeId);
1600
- });
1601
- /**
1602
- * Enqueues downloads according to the `OfflineDownloadRequest`.
1603
- * The promise will reject in the event of null or invalid request parameters.
1604
- * The promise will reject when calling this method when download has already started or is completed.
1605
- * The promise will resolve when the download has been queued. The download will is not finished when the promise resolves.
1606
- */
1607
- __publicField(this, "download", async (request) => {
1608
- return OfflineModule.download(this.nativeId, request);
1609
- });
1610
- /**
1611
- * Resumes all suspended actions.
1612
- */
1613
- __publicField(this, "resume", async () => {
1614
- return OfflineModule.resume(this.nativeId);
1615
- });
1616
- /**
1617
- * Suspends all active actions.
1618
- */
1619
- __publicField(this, "suspend", async () => {
1620
- return OfflineModule.suspend(this.nativeId);
1621
- });
1622
- /**
1623
- * Cancels and deletes the active download.
1624
- */
1625
- __publicField(this, "cancelDownload", async () => {
1626
- return OfflineModule.cancelDownload(this.nativeId);
1627
- });
1628
- /**
1629
- * Resolves how many bytes of storage are used by the offline content.
1630
- */
1631
- __publicField(this, "usedStorage", async () => {
1632
- return OfflineModule.usedStorage(this.nativeId);
1633
- });
1634
- /**
1635
- * Deletes everything related to the related content ID.
1636
- */
1637
- __publicField(this, "deleteAll", async () => {
1638
- return OfflineModule.deleteAll(this.nativeId);
1639
- });
1640
- /**
1641
- * Downloads the offline license.
1642
- * When finished successfully, data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
1643
- * Errors are transmitted to the `OfflineContentManagerListener.onError`.
1644
- */
1645
- __publicField(this, "downloadLicense", async () => {
1646
- return OfflineModule.downloadLicense(this.nativeId);
1647
- });
1648
- /**
1649
- * Releases the currently held offline license.
1650
- * When finished successfully data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
1651
- * Errors are transmitted to the `OfflineContentManagerListener.onError`.
1652
- *
1653
- * @platform Android
1654
- */
1655
- __publicField(this, "releaseLicense", async () => {
1656
- return OfflineModule.releaseLicense(this.nativeId);
1657
- });
1658
- /**
1659
- * Renews the already downloaded DRM license.
1660
- * When finished successfully data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
1661
- * Errors are transmitted to the `OfflineContentManagerListener.onError`.
1662
- */
1663
- __publicField(this, "renewOfflineLicense", async () => {
1664
- return OfflineModule.renewOfflineLicense(this.nativeId);
1665
- });
1666
- }
1667
- };
1668
-
1669
- // src/bitmovinCastManager.ts
1670
- import { NativeModules as NativeModules13, Platform as Platform4 } from "react-native";
1671
- var BitmovinCastManagerModule = NativeModules13.BitmovinCastManagerModule;
1672
- var BitmovinCastManager = {
1673
- /**
1674
- * Returns whether the `BitmovinCastManager` is initialized.
1675
- * @returns A promise that resolves with a boolean indicating whether the `BitmovinCastManager` is initialized
1676
- */
1677
- isInitialized: async () => {
1678
- if (Platform4.OS === "ios" && Platform4.isTV) {
1679
- return false;
1680
- }
1681
- return BitmovinCastManagerModule.isInitialized();
1682
- },
1683
- /**
1684
- * Initialize `BitmovinCastManager` based on the provided `BitmovinCastManagerOptions`.
1685
- * This method needs to be called before `Player` creation to enable casting features.
1686
- * If no options are provided, the default options will be used.
1687
- *
1688
- * IMPORTANT: This should only be called when the Google Cast SDK is available in the application.
1689
- *
1690
- * @param options The options to be used for initializing `BitmovinCastManager`
1691
- * @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully
1692
- */
1693
- initialize: async (options = null) => {
1694
- if (Platform4.OS === "ios" && Platform4.isTV) {
1695
- return Promise.resolve();
1696
- }
1697
- return BitmovinCastManagerModule.initializeCastManager(options);
1698
- },
1699
- /**
1700
- * Must be called in every Android Activity to update the context to the current one.
1701
- * Make sure to call this method on every Android Activity switch.
1702
- *
1703
- * @returns A promise that resolves when the context was updated successfully
1704
- * @platform Android
1705
- */
1706
- updateContext: async () => {
1707
- if (Platform4.OS === "ios") {
1708
- return Promise.resolve();
1709
- }
1710
- return BitmovinCastManagerModule.updateContext();
1711
- },
1712
- /**
1713
- * Sends the given message to the cast receiver.
1714
- *
1715
- * @param message The message to be sent
1716
- * @param messageNamespace The message namespace to be used, in case of null the default message namespace will be used
1717
- * @returns A promise that resolves when the message was sent successfully
1718
- */
1719
- sendMessage: (message, messageNamespace = null) => {
1720
- if (Platform4.OS === "ios" && Platform4.isTV) {
1721
- return Promise.resolve();
1722
- }
1723
- return BitmovinCastManagerModule.sendMessage(message, messageNamespace);
1724
- }
1725
- };
1726
-
1727
- // src/tweaksConfig.ts
1728
- var ForceReuseVideoCodecReason = /* @__PURE__ */ ((ForceReuseVideoCodecReason2) => {
1729
- ForceReuseVideoCodecReason2["ColorInfoMismatch"] = "ColorInfoMismatch";
1730
- ForceReuseVideoCodecReason2["MaxInputSizeExceeded"] = "MaxInputSizeExceeded";
1731
- ForceReuseVideoCodecReason2["MaxResolutionExceeded"] = "MaxResolutionExceeded";
1732
- return ForceReuseVideoCodecReason2;
1733
- })(ForceReuseVideoCodecReason || {});
1734
-
1735
- // src/debug.ts
1736
- import { NativeModules as NativeModules14 } from "react-native";
1737
- var DebugModule = NativeModules14.DebugModule;
1738
- var _DebugConfig = class _DebugConfig {
1739
- /**
1740
- * Retrieves the current debug logging state.
1741
- *
1742
- * @returns `true` if debug logging is enabled, otherwise `false`.
1743
- */
1744
- static get isDebugLoggingEnabled() {
1745
- return _DebugConfig._isDebugEnabled;
1746
- }
1747
- /**
1748
- * Enables or disables global debug logging for all Bitmovin components.
1749
- *
1750
- * Debug logging provides detailed information primarily for debugging purposes,
1751
- * helping to diagnose problems and trace the flow of execution within the Player.
1752
- *
1753
- * ### Warning:
1754
- * This option **should not be enabled in production** as it may log sensitive or confidential
1755
- * information to the console.
1756
- *
1757
- * ## Platform-Specific Logging Behavior
1758
- * ---
1759
- * - **iOS:** logs are printed using `NSLog` at the verbose log level.
1760
- * - **Android:** logs are printed using `android.util.Log` with the following tags:
1761
- * - `BitmovinPlayer`
1762
- * - `BitmovinPlayerView`
1763
- * - `BitmovinOffline`
1764
- * - `BitmovinSource`
1765
- * - `BitmovinExoPlayer`
1766
- *
1767
- * ## Limitations
1768
- * ---
1769
- * **Android**
1770
- * - This flag **must** be set **before** creating any Bitmovin component to take effect.
1771
- *
1772
- * ## Usage Notes
1773
- * ---
1774
- * - We recommend setting this flag during your app's initialization phase, such as in the
1775
- * application's entry point (e.g. `App.tsx`).
1776
- *
1777
- * @defaultValue `false`
1778
- */
1779
- static async setDebugLoggingEnabled(value) {
1780
- _DebugConfig._isDebugEnabled = value;
1781
- await DebugModule.setDebugLoggingEnabled(value);
1782
- }
1783
- };
1784
- __publicField(_DebugConfig, "_isDebugEnabled", false);
1785
- var DebugConfig = _DebugConfig;
1786
-
1787
- // src/decoder/decoderConfig.ts
1788
- var DecoderContextMediaType = /* @__PURE__ */ ((DecoderContextMediaType2) => {
1789
- DecoderContextMediaType2["AUDIO"] = "Audio";
1790
- DecoderContextMediaType2["VIDEO"] = "Video";
1791
- return DecoderContextMediaType2;
1792
- })(DecoderContextMediaType || {});
1793
-
1794
- // src/subtitleFormat.ts
1795
- var SubtitleFormat = /* @__PURE__ */ ((SubtitleFormat2) => {
1796
- SubtitleFormat2["CEA"] = "cea";
1797
- SubtitleFormat2["TTML"] = "ttml";
1798
- SubtitleFormat2["VTT"] = "vtt";
1799
- SubtitleFormat2["SRT"] = "srt";
1800
- return SubtitleFormat2;
1801
- })(SubtitleFormat || {});
1802
- export {
1803
- AdQuartile,
1804
- AdSourceType,
1805
- AnalyticsApi,
1806
- AudioSession,
1807
- BitmovinCastManager,
1808
- BufferApi,
1809
- BufferType,
1810
- CustomMessageHandler,
1811
- CustomUi,
1812
- DebugConfig,
1813
- DecoderContextMediaType,
1814
- Drm,
1815
- ForceReuseVideoCodecReason,
1816
- HttpRequestType,
1817
- LoadingState,
1818
- MediaType,
1819
- Network,
1820
- OfflineContentManager,
1821
- OfflineEventType,
1822
- OfflineState,
1823
- Player,
1824
- PlayerView,
1825
- ScalingMode,
1826
- SmallScreenUi,
1827
- Source,
1828
- SourceType,
1829
- SubtitleFormat,
1830
- SurfaceType,
1831
- TimelineReferencePoint,
1832
- TvUi,
1833
- UserInterfaceType,
1834
- Variant,
1835
- usePlayer
1836
- };