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
@@ -0,0 +1,89 @@
1
+ package com.bitmovin.player.reactnative.extensions
2
+
3
+ fun List<Any?>.getBooleanOrNull(index: Int): Boolean? =
4
+ if (index in indices) get(index) as? Boolean else null
5
+
6
+ fun List<Any?>.getIntOrNull(index: Int): Int? =
7
+ if (index in indices) (get(index) as? Number)?.toInt() else null
8
+
9
+ fun List<Any?>.getInt(index: Int): Int =
10
+ if (index in indices) (get(index) as? Number)?.toInt() ?: 0 else 0
11
+
12
+ fun List<Any?>.getDoubleOrNull(index: Int): Double? =
13
+ if (index in indices) (get(index) as? Number)?.toDouble() else null
14
+
15
+ fun List<Any?>.getString(index: Int): String? =
16
+ if (index in indices) get(index) as? String else null
17
+
18
+ fun List<Any?>.getMap(index: Int): Map<String, Any?>? =
19
+ if (index in indices) get(index) as? Map<String, Any?> else null
20
+
21
+ fun List<Any?>.getArray(index: Int): List<Any?>? =
22
+ if (index in indices) get(index) as? List<Any?> else null
23
+
24
+ inline fun <T> List<Any?>.withDouble(
25
+ index: Int,
26
+ block: (Double) -> T,
27
+ ): T? {
28
+ val value = if (index in indices) (get(index) as? Number)?.toDouble() else null
29
+ return if (value != null) block(value) else null
30
+ }
31
+
32
+ inline fun <T> List<Any?>.withMap(
33
+ index: Int,
34
+ block: (Map<String, Any?>) -> T,
35
+ ): T? {
36
+ val value = if (index in indices) get(index) as? Map<String, Any?> else null
37
+ return if (value != null) block(value) else null
38
+ }
39
+
40
+ inline fun <T> List<Any?>.withInt(
41
+ index: Int,
42
+ block: (Int) -> T,
43
+ ): T? {
44
+ val value = if (index in indices) (get(index) as? Number)?.toInt() else null
45
+ return if (value != null) block(value) else null
46
+ }
47
+
48
+ inline fun <T> List<Any?>.withBoolean(
49
+ index: Int,
50
+ block: (Boolean) -> T,
51
+ ): T? {
52
+ val value = if (index in indices) get(index) as? Boolean else null
53
+ return if (value != null) block(value) else null
54
+ }
55
+
56
+ inline fun <T> List<Any?>.withString(
57
+ index: Int,
58
+ block: (String) -> T,
59
+ ): T? {
60
+ val value = if (index in indices) get(index) as? String else null
61
+ return if (value != null) block(value) else null
62
+ }
63
+
64
+ inline fun <T> List<Any?>.withArray(
65
+ index: Int,
66
+ block: (List<Any?>) -> T,
67
+ ): T? {
68
+ val value = if (index in indices) get(index) as? List<Any?> else null
69
+ return if (value != null) block(value) else null
70
+ }
71
+
72
+ inline fun <T> List<Any?>.withStringArray(
73
+ index: Int,
74
+ block: (List<String?>) -> T,
75
+ ): T? {
76
+ val value = if (index in indices) (get(index) as? List<*>)?.map { item -> item as? String } else null
77
+ return if (value != null) block(value) else null
78
+ }
79
+
80
+ fun List<Any?>.getStringArray(index: Int): List<String?>? =
81
+ if (index in indices) (get(index) as? List<*>)?.map { it as? String } else null
82
+
83
+ inline fun <T, R> List<Any?>.mapValue(
84
+ index: Int,
85
+ transform: (Any?) -> R?,
86
+ ): R? = if (index in indices) transform(get(index)) else null
87
+
88
+ inline fun <reified T> List<Any?>.getTyped(index: Int): T? =
89
+ if (index in indices) get(index) as? T else null
@@ -0,0 +1,95 @@
1
+ package com.bitmovin.player.reactnative.extensions
2
+
3
+ fun Map<String, Any?>.getBooleanOrNull(key: String): Boolean? = get(key) as? Boolean
4
+ fun Map<String, Any?>.getIntOrNull(key: String): Int? = (get(key) as? Number)?.toInt()
5
+ fun Map<String, Any?>.getInt(key: String): Int = (get(key) as? Number)?.toInt() ?: 0
6
+ fun Map<String, Any?>.getDoubleOrNull(key: String): Double? = (get(key) as? Number)?.toDouble()
7
+ fun Map<String, Any?>.getString(key: String): String? = get(key) as? String
8
+ fun Map<String, Any?>.getMap(key: String): Map<String, Any?>? = get(key) as? Map<String, Any?>
9
+ fun Map<String, Any?>.getArray(key: String): List<Any?>? = get(key) as? List<Any?>
10
+
11
+ inline fun <T> Map<String, Any?>.withDouble(
12
+ key: String,
13
+ block: (Double) -> T,
14
+ ): T? {
15
+ val value = (get(key) as? Number)?.toDouble()
16
+ return if (value != null) block(value) else null
17
+ }
18
+
19
+ inline fun <T> Map<String, Any?>.withMap(
20
+ key: String,
21
+ block: (Map<String, Any?>) -> T,
22
+ ): T? {
23
+ val value = get(key) as? Map<String, Any?>
24
+ return if (value != null) block(value) else null
25
+ }
26
+
27
+ inline fun <T> Map<String, Any?>.withInt(
28
+ key: String,
29
+ block: (Int) -> T,
30
+ ): T? {
31
+ val value = (get(key) as? Number)?.toInt()
32
+ return if (value != null) block(value) else null
33
+ }
34
+
35
+ inline fun <T> Map<String, Any?>.withBoolean(
36
+ key: String,
37
+ block: (Boolean) -> T,
38
+ ): T? {
39
+ val value = get(key) as? Boolean
40
+ return if (value != null) block(value) else null
41
+ }
42
+
43
+ inline fun <T> Map<String, Any?>.withString(
44
+ key: String,
45
+ block: (String) -> T,
46
+ ): T? {
47
+ val value = get(key) as? String
48
+ return if (value != null) block(value) else null
49
+ }
50
+
51
+ inline fun <T> Map<String, Any?>.withArray(
52
+ key: String,
53
+ block: (List<Any?>) -> T,
54
+ ): T? {
55
+ val value = get(key) as? List<Any?>
56
+ return if (value != null) block(value) else null
57
+ }
58
+
59
+ inline fun <T> Map<String, Any?>.withStringArray(
60
+ key: String,
61
+ block: (List<String?>) -> T,
62
+ ): T? {
63
+ val value = (get(key) as? List<*>)?.map { item -> item as? String }
64
+ return if (value != null) block(value) else null
65
+ }
66
+
67
+ fun Map<String, Any?>.getStringArray(key: String): List<String?>? = (get(key) as? List<*>)?.map { it as? String }
68
+
69
+ inline fun <T, R> Map<String, Any?>.mapValue(
70
+ key: String,
71
+ transform: (Any?) -> R?,
72
+ ): R? = if (containsKey(key)) transform(get(key)) else null
73
+
74
+ inline fun <reified T> Map<String, Any?>.toMap(): Map<String, T> = mapValues { it.value as T }
75
+
76
+ /** Convert a [Map] to [Map], adding each [T] value using [put]. */
77
+ private inline fun <T> Map<String, T>.toMap(
78
+ put: MutableMap<String, Any?>.(String, T) -> Unit = { key, value -> this[key] = value },
79
+ ): Map<String, Any?> = mutableMapOf<String, Any?>().apply {
80
+ forEach { put(it.key, it.value) }
81
+ }
82
+
83
+ @JvmName("toStringMap")
84
+ fun Map<String, String>.toMap(): Map<String, Any?> = toMap()
85
+
86
+ fun List<Any?>.toMapList(): List<Map<String, Any?>?> = map { it as? Map<String, Any?> }
87
+
88
+ fun List<Any?>.toStringList(): List<String?> = map { it as? String }
89
+ fun List<Any?>.toBooleanList(): List<Boolean?> = map { it as? Boolean }
90
+ fun List<Any?>.toDoubleList(): List<Double?> = map { (it as? Number)?.toDouble() }
91
+ fun List<Any?>.toIntList(): List<Int?> = map { (it as? Number)?.toInt() }
92
+
93
+ inline fun <T> List<T>.mapToList(
94
+ transform: (T) -> Map<String, Any?>,
95
+ ): List<Map<String, Any?>> = map(transform)
@@ -1,5 +1,6 @@
1
1
  package com.bitmovin.player.reactnative.offline
2
2
 
3
+ import android.content.Context
3
4
  import com.bitmovin.player.api.deficiency.ErrorEvent
4
5
  import com.bitmovin.player.api.offline.OfflineContentManager
5
6
  import com.bitmovin.player.api.offline.OfflineContentManagerListener
@@ -9,15 +10,13 @@ import com.bitmovin.player.api.offline.options.OfflineOptionEntryAction
9
10
  import com.bitmovin.player.api.offline.options.OfflineOptionEntryState
10
11
  import com.bitmovin.player.api.source.SourceConfig
11
12
  import com.bitmovin.player.reactnative.NativeId
13
+ import com.bitmovin.player.reactnative.OfflineModule
12
14
  import com.bitmovin.player.reactnative.converter.toJson
13
- import com.facebook.react.bridge.Arguments
14
- import com.facebook.react.bridge.ReactApplicationContext
15
- import com.facebook.react.bridge.WritableMap
16
- import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
17
15
 
18
16
  class OfflineContentManagerBridge(
19
17
  private val nativeId: NativeId,
20
- private val context: ReactApplicationContext,
18
+ context: Context,
19
+ private val offlineModule: OfflineModule,
21
20
  private val identifier: String,
22
21
  source: SourceConfig,
23
22
  location: String,
@@ -58,8 +57,7 @@ class OfflineContentManagerBridge(
58
57
  */
59
58
  fun process(request: OfflineDownloadRequest) {
60
59
  if (contentOptions != null) {
61
- val sortedVideoOptions = contentOptions!!.videoOptions
62
- .sortedBy { option -> option.bitrate }
60
+ val sortedVideoOptions = contentOptions!!.videoOptions.sortedBy { option -> option.bitrate }
63
61
  if (request.minimumBitrate == null) {
64
62
  sortedVideoOptions.lastOrNull()
65
63
  } else {
@@ -135,8 +133,7 @@ class OfflineContentManagerBridge(
135
133
  options?.videoOptions?.let { allOptions.addAll(it) }
136
134
  options?.audioOptions?.let { allOptions.addAll(it) }
137
135
  options?.textOptions?.let { allOptions.addAll(it) }
138
- val trackableStates =
139
- listOf(OfflineOptionEntryState.Suspended, OfflineOptionEntryState.Downloading)
136
+ val trackableStates = listOf(OfflineOptionEntryState.Suspended, OfflineOptionEntryState.Downloading)
140
137
 
141
138
  var state = allOptions.firstOrNull { trackableStates.contains(it.state) }?.state
142
139
 
@@ -147,86 +144,57 @@ class OfflineContentManagerBridge(
147
144
  return state ?: OfflineOptionEntryState.NotDownloaded
148
145
  }
149
146
 
150
- /**
151
- * Called when a process call has completed.
152
- */
153
147
  override fun onCompleted(source: SourceConfig, options: OfflineContentOptions) {
154
148
  this.contentOptions = options
155
149
  sendEvent(
156
150
  OfflineEventType.ON_COMPLETED,
157
- Arguments.createMap().apply {
158
- putMap("options", options.toJson())
159
- },
151
+ mapOf("options" to options.toJson()),
160
152
  )
161
153
  }
162
154
 
163
- /**
164
- * Called when an error occurs.
165
- */
166
155
  override fun onError(source: SourceConfig, event: ErrorEvent) {
167
156
  sendEvent(
168
157
  OfflineEventType.ON_ERROR,
169
- Arguments.createMap().apply {
170
- putInt("code", event.code.value)
171
- putString("message", event.message)
172
- },
158
+ mapOf(
159
+ "code" to event.code.value,
160
+ "message" to event.message,
161
+ ),
173
162
  )
174
163
  }
175
164
 
176
- /**
177
- * Called when the progress for a process call changes.
178
- */
179
165
  override fun onProgress(source: SourceConfig, progress: Float) {
180
166
  sendEvent(
181
167
  OfflineEventType.ON_PROGRESS,
182
- Arguments.createMap().apply {
183
- putDouble("progress", progress.toDouble())
184
- },
168
+ mapOf("progress" to progress.toDouble()),
185
169
  )
186
170
  }
187
171
 
188
- /**
189
- * Called after a getOptions or when am OfflineOptionEntry has been updated during a process call.
190
- */
191
172
  override fun onOptionsAvailable(source: SourceConfig, options: OfflineContentOptions) {
192
173
  this.contentOptions = options
193
174
  sendEvent(
194
175
  OfflineEventType.ON_OPTIONS_AVAILABLE,
195
- Arguments.createMap().apply {
196
- putMap("options", options.toJson())
197
- },
176
+ mapOf("options" to options.toJson()),
198
177
  )
199
178
  }
200
179
 
201
- /**
202
- * Called when the DRM license was updated.
203
- */
204
180
  override fun onDrmLicenseUpdated(source: SourceConfig) {
205
181
  sendEvent(OfflineEventType.ON_DRM_LICENSE_UPDATED)
206
182
  }
207
183
 
208
- /**
209
- * Called when all actions have been suspended.
210
- */
211
184
  override fun onSuspended(source: SourceConfig) {
212
185
  sendEvent(OfflineEventType.ON_SUSPENDED)
213
186
  }
214
187
 
215
- /**
216
- * Called when all actions have been resumed.
217
- */
218
188
  override fun onResumed(source: SourceConfig) {
219
189
  sendEvent(OfflineEventType.ON_RESUMED)
220
190
  }
221
191
 
222
- private fun sendEvent(eventType: OfflineEventType, event: WritableMap = Arguments.createMap()) {
223
- event.putString("nativeId", nativeId)
224
- event.putString("identifier", identifier)
225
- event.putString("eventType", eventType.eventName)
226
- event.putString("state", aggregateState(contentOptions).name)
227
- context.rtcDeviceEventEmitter.emit("BitmovinOfflineEvent", event)
192
+ private fun sendEvent(eventType: OfflineEventType, event: Map<String, Any> = mapOf()) {
193
+ val mutableEvent = event.toMutableMap()
194
+ mutableEvent["nativeId"] = nativeId
195
+ mutableEvent["identifier"] = identifier
196
+ mutableEvent["eventType"] = eventType.eventName
197
+ mutableEvent["state"] = aggregateState(contentOptions).name
198
+ offlineModule.sendEvent("onBitmovinOfflineEvent", mutableEvent)
228
199
  }
229
200
  }
230
-
231
- val ReactApplicationContext.rtcDeviceEventEmitter: RCTDeviceEventEmitter
232
- get() = getJSModule(RCTDeviceEventEmitter::class.java)
@@ -1,39 +1,29 @@
1
1
  package com.bitmovin.player.reactnative.ui
2
2
 
3
3
  import android.webkit.JavascriptInterface
4
+ import com.bitmovin.player.reactnative.CustomMessageHandlerModule
4
5
  import com.bitmovin.player.reactnative.NativeId
5
- import com.bitmovin.player.reactnative.extensions.getModule
6
6
  import com.bitmovin.player.ui.CustomMessageHandler
7
- import com.facebook.react.bridge.ReactApplicationContext
8
7
 
9
8
  class CustomMessageHandlerBridge(
10
- val context: ReactApplicationContext,
11
9
  private val nativeId: NativeId,
10
+ private val module: CustomMessageHandlerModule? = null,
12
11
  ) {
13
12
  val customMessageHandler = CustomMessageHandler(
14
13
  object : Any() {
15
14
  @JavascriptInterface
16
- fun sendSynchronous(name: String, data: String?): String? = context
17
- .getModule<CustomMessageHandlerModule>()
18
- ?.receivedSynchronousMessage(nativeId, name, data)
15
+ fun sendSynchronous(
16
+ name: String,
17
+ data: String?,
18
+ ): String? = module?.receivedSynchronousMessage(nativeId, name, data)
19
19
 
20
20
  @JavascriptInterface
21
- fun sendAsynchronous(name: String, data: String?) = context
22
- .getModule<CustomMessageHandlerModule>()
23
- ?.receivedAsynchronousMessage(nativeId, name, data)
21
+ fun sendAsynchronous(
22
+ name: String,
23
+ data: String?,
24
+ ) = module?.receivedAsynchronousMessage(nativeId, name, data)
24
25
  },
25
26
  )
26
27
 
27
- private var currentSynchronousResult: String? = null
28
-
29
28
  fun sendMessage(message: String, data: String?) = customMessageHandler.sendMessage(message, data)
30
-
31
- fun popSynchronousResult(): String? = currentSynchronousResult?.let {
32
- currentSynchronousResult = null
33
- return it
34
- }
35
-
36
- fun pushSynchronousResult(result: String?) {
37
- currentSynchronousResult = result
38
- }
39
29
  }
@@ -1,13 +1,12 @@
1
1
  package com.bitmovin.player.reactnative.ui
2
2
 
3
3
  import com.bitmovin.player.api.ui.FullscreenHandler
4
+ import com.bitmovin.player.reactnative.FullscreenHandlerModule
4
5
  import com.bitmovin.player.reactnative.NativeId
5
- import com.bitmovin.player.reactnative.extensions.getModule
6
- import com.facebook.react.bridge.ReactApplicationContext
7
6
 
8
7
  class FullscreenHandlerBridge(
9
- val context: ReactApplicationContext,
10
8
  private val nativeId: NativeId,
9
+ private val module: FullscreenHandlerModule? = null,
11
10
  ) : FullscreenHandler {
12
11
  override var isFullscreen = false
13
12
 
@@ -16,15 +15,11 @@ class FullscreenHandlerBridge(
16
15
  }
17
16
 
18
17
  override fun onFullscreenExitRequested() {
19
- context
20
- .getModule<FullscreenHandlerModule>()
21
- ?.requestExitFullscreen(nativeId)
18
+ module?.requestExitFullscreen(nativeId)
22
19
  }
23
20
 
24
21
  override fun onFullscreenRequested() {
25
- context
26
- .getModule<FullscreenHandlerModule>()
27
- ?.requestEnterFullscreen(nativeId)
22
+ module?.requestEnterFullscreen(nativeId)
28
23
  }
29
24
 
30
25
  override fun onPause() {
package/app.plugin.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Expo plugin for bitmovin-player-react-native
3
+ *
4
+ * Example:
5
+ * "plugins": [
6
+ * [
7
+ * "bitmovin-player-react-native",
8
+ * {
9
+ * "licenseKey": "ENTER_LICENSE_KEY",
10
+ * "featureFlags": {
11
+ * "airPlay": true,
12
+ * "backgroundPlayback": true,
13
+ * "googleCastSDK": { "android": "21.3.0", "ios": "4.8.1.2" },
14
+ * "offline": true,
15
+ * "pictureInPicture": true
16
+ * }
17
+ * }
18
+ * ]
19
+ * ]
20
+ */
21
+ module.exports = require('./plugin/build');
@@ -0,0 +1,18 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+ export type OnLoadEventPayload = {
3
+ url: string;
4
+ };
5
+ export type BitmovinPlayerReactNativeModuleEvents = {
6
+ onChange: (params: ChangeEventPayload) => void;
7
+ };
8
+ export type ChangeEventPayload = {
9
+ value: string;
10
+ };
11
+ export type BitmovinPlayerReactNativeViewProps = {
12
+ url: string;
13
+ onLoad: (event: {
14
+ nativeEvent: OnLoadEventPayload;
15
+ }) => void;
16
+ style?: StyleProp<ViewStyle>;
17
+ };
18
+ //# sourceMappingURL=BitmovinPlayerReactNative.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitmovinPlayerReactNative.types.d.ts","sourceRoot":"","sources":["../src/BitmovinPlayerReactNative.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,kBAAkB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BitmovinPlayerReactNative.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitmovinPlayerReactNative.types.js","sourceRoot":"","sources":["../src/BitmovinPlayerReactNative.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nexport type OnLoadEventPayload = {\n url: string;\n};\n\nexport type BitmovinPlayerReactNativeModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type BitmovinPlayerReactNativeViewProps = {\n url: string;\n onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;\n style?: StyleProp<ViewStyle>;\n};\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Configures the adaptation logic.
3
+ */
4
+ export interface AdaptationConfig {
5
+ /**
6
+ * The upper bitrate boundary in bits per second for approximate network bandwidth consumption of the played source.
7
+ * Can be set to `undefined` for no limitation.
8
+ */
9
+ maxSelectableBitrate?: number;
10
+ /**
11
+ * The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.
12
+ *
13
+ * @remarks Platform: Android
14
+ * @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html
15
+ */
16
+ initialBandwidthEstimateOverride?: number;
17
+ }
18
+ //# sourceMappingURL=adaptationConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adaptationConfig.d.ts","sourceRoot":"","sources":["../src/adaptationConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=adaptationConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adaptationConfig.js","sourceRoot":"","sources":["../src/adaptationConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Configures the adaptation logic.\n */\nexport interface AdaptationConfig {\n /**\n * The upper bitrate boundary in bits per second for approximate network bandwidth consumption of the played source.\n * Can be set to `undefined` for no limitation.\n */\n maxSelectableBitrate?: number;\n\n /**\n * The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.\n *\n * @remarks Platform: Android\n * @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html\n */\n initialBandwidthEstimateOverride?: number;\n}\n"]}
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Quartiles that can be reached during an ad playback.
3
+ */
4
+ export declare enum AdQuartile {
5
+ /**
6
+ * Fist ad quartile.
7
+ */
8
+ FIRST = "first",
9
+ /**
10
+ * Mid ad quartile.
11
+ */
12
+ MID_POINT = "mid_point",
13
+ /**
14
+ * Third ad quartile.
15
+ */
16
+ THIRD = "third"
17
+ }
18
+ /**
19
+ * The possible types an `AdSource` can be.
20
+ */
21
+ export declare enum AdSourceType {
22
+ /**
23
+ * Google Interactive Media Ads.
24
+ */
25
+ IMA = "ima",
26
+ /**
27
+ * Unknown ad source type.
28
+ */
29
+ UNKNOWN = "unknown",
30
+ /**
31
+ * Progressive ad type.
32
+ */
33
+ PROGRESSIVE = "progressive"
34
+ }
35
+ /**
36
+ * Represents an ad source which can be assigned to an `AdItem`. An `AdItem` can have multiple `AdSource`s
37
+ * as waterfalling option.
38
+ */
39
+ export interface AdSource {
40
+ /**
41
+ * The ad tag / url to the ad manifest.
42
+ */
43
+ tag: string;
44
+ /**
45
+ * The `AdSourceType` of this `AdSource`.
46
+ */
47
+ type: AdSourceType;
48
+ }
49
+ /**
50
+ * Represents an ad break which can be scheduled for playback.
51
+ *
52
+ * One single `AdItem` can have multiple `AdSource`s where all but the first act as fallback ad sources
53
+ * if the first one fails to load. The start and end of an ad break are signaled via `AdBreakStartedEvent`
54
+ * and `AdBreakFinishedEvent`.
55
+ */
56
+ export interface AdItem {
57
+ /**
58
+ * The playback position at which the ad break is scheduled to start. Default value is "pre".
59
+ *
60
+ * Possible values are:
61
+ * • "pre": pre-roll ad (for VoD and Live streaming)
62
+ * • "post": post-roll ad (for VoD streaming only)
63
+ * • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
64
+ * • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
65
+ * • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
66
+ */
67
+ position?: string;
68
+ /**
69
+ * The `AdSource`s that make up this `AdItem`. The first ad source in this array is used as the main ad.
70
+ * Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a
71
+ * valid response, the subsequent ad sources will be utilized one after another.
72
+ *
73
+ * The fallback ad sources need to have the same `AdSourceType` as the main ad source.
74
+ */
75
+ sources: AdSource[];
76
+ /**
77
+ * The amount of seconds the ad manifest is loaded in advance
78
+ * compared to when the ad break is scheduled for playback.
79
+ *
80
+ * Default value is 0.0
81
+ *
82
+ * @remarks Platform: Android
83
+ */
84
+ preloadOffset?: number;
85
+ }
86
+ /**
87
+ * Contains configuration values regarding the ads which should be played back by the player.
88
+ */
89
+ export interface AdvertisingConfig {
90
+ /**
91
+ * The ad items that are scheduled when a new playback session is started via `Player.load()`.
92
+ */
93
+ schedule: AdItem[];
94
+ }
95
+ /**
96
+ * Contains the base configuration options for an ad.
97
+ */
98
+ export interface AdConfig {
99
+ /**
100
+ * Specifies how many seconds of the main video content should be replaced by ad break(s).
101
+ */
102
+ replaceContentDuration: number;
103
+ }
104
+ /**
105
+ * Holds various additional ad data.
106
+ */
107
+ export interface AdData {
108
+ /**
109
+ * The average bitrate of the progressive media file as defined in the VAST response.
110
+ */
111
+ bitrate?: number;
112
+ /**
113
+ * The maximum bitrate of the streaming media file as defined in the VAST response.
114
+ */
115
+ maxBitrate?: number;
116
+ /**
117
+ * The MIME type of the media file or creative as defined in the VAST response.
118
+ */
119
+ mimeType?: string;
120
+ /**
121
+ * The minimum bitrate of the streaming media file as defined in the VAST response.
122
+ */
123
+ minBitrate?: number;
124
+ }
125
+ /**
126
+ * Defines basic properties available for every ad type.
127
+ */
128
+ export interface Ad {
129
+ /**
130
+ * The url the user should be redirected to when clicking the ad.
131
+ */
132
+ clickThroughUrl?: string;
133
+ /**
134
+ * Holds various additional `AdData`.
135
+ */
136
+ data?: AdData;
137
+ /**
138
+ * The height of the ad.
139
+ */
140
+ height: number;
141
+ /**
142
+ * Identifier for the ad. This might be autogenerated.
143
+ */
144
+ id?: string;
145
+ /**
146
+ * Determines whether an ad is linear, i.e. playback of main content needs to be paused for the ad.
147
+ */
148
+ isLinear: boolean;
149
+ /**
150
+ * The corresponding media file url for the ad.
151
+ */
152
+ mediaFileUrl?: string;
153
+ /**
154
+ * The width of the ad.
155
+ */
156
+ width: number;
157
+ }
158
+ /**
159
+ * Contains information about an ad break.
160
+ */
161
+ export interface AdBreak {
162
+ /**
163
+ * The ads scheduled for this `AdBreak`.
164
+ */
165
+ ads: Ad[];
166
+ /**
167
+ * The id of the corresponding `AdBreakConfig`. This will be auto-generated.
168
+ */
169
+ id: string;
170
+ /**
171
+ * The time in seconds in the media timeline the `AdBreak` is scheduled for.
172
+ */
173
+ scheduleTime: number;
174
+ }
175
+ //# sourceMappingURL=advertising.d.ts.map