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
@@ -5,11 +5,6 @@ import BitmovinPlayer
5
5
  import Foundation
6
6
 
7
7
  extension RCTConvert {
8
- /**
9
- Utility method to instantiate a `PlayerConfig` from a JS object.
10
- - Parameter json: JS object
11
- - Returns: The produced `PlayerConfig` object
12
- */
13
8
  static func playerConfig(_ json: Any?) -> PlayerConfig? { // swiftlint:disable:this cyclomatic_complexity
14
9
  let playerConfig = PlayerConfig()
15
10
  guard let json = json as? [String: Any?] else {
@@ -53,11 +48,6 @@ extension RCTConvert {
53
48
  return playerConfig
54
49
  }
55
50
 
56
- /**
57
- Utility method to instantiate a `PlaybackConfig` from a JS object.
58
- - Parameter json: JS object.
59
- - Returns: The produced `PlaybackConfig` object.
60
- */
61
51
  static func playbackConfig(_ json: Any?) -> PlaybackConfig? {
62
52
  guard let json = json as? [String: Any?] else {
63
53
  return nil
@@ -81,11 +71,6 @@ extension RCTConvert {
81
71
  return playbackConfig
82
72
  }
83
73
 
84
- /**
85
- Utility method to instantiate a `StyleConfig` from a JS object.
86
- - Parameter json: JS object.
87
- - Returns: The produced `StyleConfig` object.
88
- */
89
74
  static func styleConfig(_ json: Any?) -> StyleConfig? { // swiftlint:disable:this cyclomatic_complexity
90
75
  guard let json = json as? [String: Any?] else {
91
76
  return nil
@@ -123,11 +108,6 @@ extension RCTConvert {
123
108
  return styleConfig
124
109
  }
125
110
 
126
- /**
127
- Utility method to instantiate a `TweaksConfig` from a JS object.
128
- - Parameter json: JS object.
129
- - Returns: The produced `TweaksConfig` object.
130
- */
131
111
  static func tweaksConfig(_ json: Any?) -> TweaksConfig? { // swiftlint:disable:this cyclomatic_complexity
132
112
  guard let json = json as? [String: Any?] else {
133
113
  return nil
@@ -173,11 +153,6 @@ extension RCTConvert {
173
153
  return tweaksConfig
174
154
  }
175
155
 
176
- /**
177
- Utility method to instantiate a `BufferMediaTypeConfig` from a JS object.
178
- - Parameter json: JS object.
179
- - Returns: The produced `BufferMediaTypeConfig` object.
180
- */
181
156
  static func bufferMediaTypeConfig(_ json: Any?) -> BufferMediaTypeConfig? {
182
157
  guard let json = json as? [String: Any?] else {
183
158
  return nil
@@ -189,11 +164,6 @@ extension RCTConvert {
189
164
  return bufferMediaTypeConfig
190
165
  }
191
166
 
192
- /**
193
- Utility method to instantiate a `BufferConfig` from a JS object.
194
- - Parameter json: JS object.
195
- - Returns: The produced `BufferConfig` object.
196
- */
197
167
  static func bufferConfig(_ json: Any?) -> BufferConfig? {
198
168
  guard let json = json as? [String: Any?] else {
199
169
  return nil
@@ -205,11 +175,6 @@ extension RCTConvert {
205
175
  return bufferConfig
206
176
  }
207
177
 
208
- /**
209
- Utility method to instantiate a `LiveConfig` from a JS object.
210
- - Parameter json: JS object.
211
- - Returns: The produced `LiveConfig` object, or `nil` if `json` is not valid.
212
- */
213
178
  static func liveConfig(_ json: Any?) -> LiveConfig? {
214
179
  guard let json = json as? [String: Any?] else {
215
180
  return nil
@@ -221,11 +186,6 @@ extension RCTConvert {
221
186
  return liveConfig
222
187
  }
223
188
 
224
- /**
225
- Utility method to instantiate a `HttpRequest` from a JS object.
226
- - Parameter json: JS object.
227
- - Returns: The produced `HttpRequest` object, or `nil` if `json` is not valid.
228
- */
229
189
  static func httpRequest(_ json: Any?) -> HttpRequest? {
230
190
  guard
231
191
  let json = json as? [String: Any?],
@@ -245,11 +205,6 @@ extension RCTConvert {
245
205
  return request
246
206
  }
247
207
 
248
- /**
249
- Utility method to instantiate a `HttpResponse` from a JS object.
250
- - Parameter json: JS object.
251
- - Returns: The produced `HttpResponse` object, or `nil` if `json` is not valid.
252
- */
253
208
  static func httpResponse(_ json: Any?) -> HttpResponse? {
254
209
  guard
255
210
  let json = json as? [String: Any?],
@@ -282,11 +237,6 @@ extension RCTConvert {
282
237
  return NetworkConfig()
283
238
  }
284
239
 
285
- /**
286
- Utility method to instantiate an `AdvertisingConfig` from a JS object.
287
- - Parameter json: JS object.
288
- - Returns: The produced `AdvertisingConfig` object.
289
- */
290
240
  static func advertisingConfig(_ json: Any?) -> AdvertisingConfig? {
291
241
  guard
292
242
  let json = json as? [String: Any?],
@@ -297,11 +247,6 @@ extension RCTConvert {
297
247
  return AdvertisingConfig(schedule: schedule.compactMap { RCTConvert.adItem($0) })
298
248
  }
299
249
 
300
- /**
301
- Utility method to instantiate an `AdItem` from a JS object.
302
- - Parameter json: JS object.
303
- - Returns: The produced `AdItem` object.
304
- */
305
250
  static func adItem(_ json: Any?) -> AdItem? {
306
251
  guard
307
252
  let json = json as? [String: Any?],
@@ -315,11 +260,6 @@ extension RCTConvert {
315
260
  )
316
261
  }
317
262
 
318
- /**
319
- Utility method to instantiate an `AdSource` from a JS object.
320
- - Parameter json: JS object.
321
- - Returns: The produced `AdSource` object.
322
- */
323
263
  static func adSource(_ json: Any?) -> AdSource? {
324
264
  guard
325
265
  let json = json as? [String: Any?],
@@ -331,11 +271,6 @@ extension RCTConvert {
331
271
  return AdSource(tag: tag, ofType: type)
332
272
  }
333
273
 
334
- /**
335
- Utility method to instantiate an `AdSourceType` from a JS object.
336
- - Parameter json: JS object.
337
- - Returns: The produced `AdSourceType` object.
338
- */
339
274
  static func adSourceType(_ json: Any?) -> AdSourceType? {
340
275
  guard let json = json as? String else {
341
276
  return nil
@@ -352,11 +287,6 @@ extension RCTConvert {
352
287
  }
353
288
  }
354
289
 
355
- /**
356
- Utility method to instantiate a `SourceConfig` from a JS object.
357
- - Parameter json: JS object
358
- - Returns: The produced `SourceConfig` object
359
- */
360
290
  static func sourceConfig(_ json: Any?, drmConfig: DrmConfig? = nil) -> SourceConfig? { // swiftlint:disable:this cyclomatic_complexity line_length
361
291
  guard let json = json as? [String: Any?] else {
362
292
  return nil
@@ -399,11 +329,6 @@ extension RCTConvert {
399
329
  return sourceConfig
400
330
  }
401
331
 
402
- /**
403
- Utility method to instantiate a `SourceOptions` from a JS object.
404
- - Parameter json: JS object
405
- - Returns: The produced `SourceOptions` object
406
- */
407
332
  static func sourceOptions(_ json: Any?) -> SourceOptions {
408
333
  let sourceOptions = SourceOptions()
409
334
  guard let json = json as? [String: Any?] else {
@@ -417,11 +342,6 @@ extension RCTConvert {
417
342
  return sourceOptions
418
343
  }
419
344
 
420
- /**
421
- Utility method to instantiate a `TimelineReferencePoint` from a JS object.
422
- - Parameter json: JS object
423
- - Returns: The produced `TimelineReferencePoint` value
424
- */
425
345
  static func timelineReferencePoint(_ json: Any?) -> TimelineReferencePoint {
426
346
  guard let stringValue = json as? String else { return .auto }
427
347
  switch stringValue {
@@ -434,11 +354,6 @@ extension RCTConvert {
434
354
  }
435
355
  }
436
356
 
437
- /**
438
- Utility method to get a `SourceType` from a JS object.
439
- - Parameter json: JS object
440
- - Returns: The associated `SourceType` value
441
- */
442
357
  static func sourceType(_ json: Any?) -> SourceType {
443
358
  guard let json = json as? String else {
444
359
  return .none
@@ -457,11 +372,6 @@ extension RCTConvert {
457
372
  }
458
373
  }
459
374
 
460
- /**
461
- Utility method to get a `TimeMode` from a JS object.
462
- - Parameter json: JS object
463
- - Returns: The associated `TimeMode` value
464
- */
465
375
  static func timeMode(_ json: Any?) -> TimeMode {
466
376
  guard let json = json as? String else {
467
377
  return .absoluteTime
@@ -476,26 +386,16 @@ extension RCTConvert {
476
386
  }
477
387
  }
478
388
 
479
- /**
480
- Utility method to get a `DrmConfig` from a JS object.
481
- - Parameter json: JS object
482
- - Returns: The generated `DrmConfig` object
483
- */
484
389
  static func drmConfig(_ json: Any?) -> (fairplay: FairplayConfig?, widevine: WidevineConfig?) {
485
390
  guard let json = json as? [String: Any?] else {
486
391
  return (nil, nil)
487
392
  }
488
393
  return (
489
- fairplay: RCTConvert.fairplayConfig(json["fairplay"]),
490
- widevine: RCTConvert.widevineConfig(json["widevine"])
394
+ fairplay: json["fairplay"].flatMap(RCTConvert.fairplayConfig),
395
+ widevine: json["widevine"].flatMap(RCTConvert.widevineConfig)
491
396
  )
492
397
  }
493
398
 
494
- /**
495
- Utility method to get a `FairplayConfig` from a JS object.
496
- - Parameter json: JS object
497
- - Returns: The generated `FairplayConfig` object
498
- */
499
399
  static func fairplayConfig(_ json: Any?) -> FairplayConfig? {
500
400
  guard let json = json as? [String: Any?],
501
401
  let licenseURLString = json["licenseUrl"] as? String,
@@ -516,11 +416,6 @@ extension RCTConvert {
516
416
  return fairplayConfig
517
417
  }
518
418
 
519
- /**
520
- Utility method to get a `WidevineConfig` from a JS object.
521
- - Parameter json: JS object
522
- - Returns: The generated `WidevineConfig` object
523
- */
524
419
  static func widevineConfig(_ json: Any?) -> WidevineConfig? {
525
420
  guard let json = json as? [String: Any?],
526
421
  let licenseURL = json["licenseUrl"] as? String else {
@@ -533,11 +428,6 @@ extension RCTConvert {
533
428
  return widevineConfig
534
429
  }
535
430
 
536
- /**
537
- Utility method to get a `ThumbnailTrack` instance from a JS object.
538
- - Parameter url: String.
539
- - Returns: The generated `ThumbnailTrack`.
540
- */
541
431
  static func thumbnailTrack(_ url: String?) -> ThumbnailTrack? {
542
432
  guard
543
433
  let url = RCTConvert.nsurl(url)
@@ -552,22 +442,21 @@ extension RCTConvert {
552
442
  )
553
443
  }
554
444
 
555
- /**
556
- Utility method to get a json dictionary value from a `AudioTrack` object.
557
- - Parameter audioTrack: The track to convert to json format.
558
- - Returns: The generated json dictionary.
559
- */
560
- static func audioTrackJson(_ audioTrack: AudioTrack?) -> [AnyHashable: Any]? {
445
+ static func audioTrackJson(_ audioTrack: AudioTrack?) -> [String: Any]? {
561
446
  guard let audioTrack else {
562
447
  return nil
563
448
  }
564
- var audioTrackDict: [String: Any?] = [
565
- "url": audioTrack.url?.absoluteString,
449
+ var audioTrackDict: [String: Any] = [
566
450
  "label": audioTrack.label,
567
451
  "isDefault": audioTrack.isDefaultTrack,
568
452
  "identifier": audioTrack.identifier,
569
- "language": audioTrack.language
570
453
  ]
454
+ if let url = audioTrack.url {
455
+ audioTrackDict["url"] = url.absoluteString
456
+ }
457
+ if let language = audioTrack.language {
458
+ audioTrackDict["language"] = language
459
+ }
571
460
  audioTrackDict["roles"] = audioTrack.characteristics.map { characteristic in
572
461
  [
573
462
  "schemeIdUri": "urn:hls:characteristic",
@@ -577,11 +466,6 @@ extension RCTConvert {
577
466
  return audioTrackDict
578
467
  }
579
468
 
580
- /**
581
- Utility method to get a `SubtitleTrack` instance from a JS object.
582
- - Parameter json: JS object.
583
- - Returns: The generated `SubtitleTrack`.
584
- */
585
469
  static func subtitleTrack(_ json: [String: Any]) -> SubtitleTrack? {
586
470
  guard
587
471
  let url = RCTConvert.nsurl(json["url"]),
@@ -616,11 +500,6 @@ extension RCTConvert {
616
500
  )
617
501
  }
618
502
 
619
- /**
620
- Utility method to get a `SubtitleFormat` value from a JS object.
621
- - Parameter json: JS object.
622
- - Returns: The associated `SubtitleFormat` value or nil.
623
- */
624
503
  static func subtitleFormat(_ json: Any?) -> SubtitleFormat? {
625
504
  guard let json = json as? String else {
626
505
  return nil
@@ -639,23 +518,22 @@ extension RCTConvert {
639
518
  }
640
519
  }
641
520
 
642
- /**
643
- Utility method to get a json dictionary value from a `SubtitleTrack` object.
644
- - Parameter subtitleTrack: The track to convert to json format.
645
- - Returns: The generated json dictionary.
646
- */
647
- static func subtitleTrackJson(_ subtitleTrack: SubtitleTrack?) -> [AnyHashable: Any]? {
521
+ static func subtitleTrackJson(_ subtitleTrack: SubtitleTrack?) -> [String: Any]? {
648
522
  guard let subtitleTrack else {
649
523
  return nil
650
524
  }
651
- var subtitleTrackDict: [String: Any?] = [
652
- "url": subtitleTrack.url?.absoluteString,
525
+ var subtitleTrackDict: [String: Any] = [
653
526
  "label": subtitleTrack.label,
654
527
  "isDefault": subtitleTrack.isDefaultTrack,
655
528
  "identifier": subtitleTrack.identifier,
656
- "language": subtitleTrack.language,
657
529
  "isForced": subtitleTrack.isForced,
658
530
  ]
531
+ if let url = subtitleTrack.url {
532
+ subtitleTrackDict["url"] = url.absoluteString
533
+ }
534
+ if let language = subtitleTrack.language {
535
+ subtitleTrackDict["language"] = language
536
+ }
659
537
  switch subtitleTrack.format {
660
538
  case .cea:
661
539
  subtitleTrackDict["format"] = "cea"
@@ -678,29 +556,23 @@ extension RCTConvert {
678
556
  return subtitleTrackDict
679
557
  }
680
558
 
681
- /**
682
- Utility method to get a json dictionary value from a `ThumbnailTrack` object.
683
- - Parameter thumbnailTrack: The `ThumbnailTrack` to convert to json format.
684
- - Returns: The generated json dictionary.
685
- */
686
559
  static func toJson(thumbnailTrack: ThumbnailTrack?) -> [AnyHashable: Any]? {
687
560
  guard let thumbnailTrack else {
688
561
  return nil
689
562
  }
690
563
 
691
- return [
692
- "url": thumbnailTrack.url?.absoluteString,
564
+ var thumbnailTrackDict: [String: Any] = [
693
565
  "label": thumbnailTrack.label,
694
566
  "isDefault": thumbnailTrack.isDefaultTrack,
695
567
  "identifier": thumbnailTrack.identifier
696
568
  ]
569
+ if let url = thumbnailTrack.url {
570
+ thumbnailTrackDict["url"] = url.absoluteString
571
+ }
572
+
573
+ return thumbnailTrackDict
697
574
  }
698
575
 
699
- /**
700
- Utility method to compute a JS value from an `AdItem` object.
701
- - Parameter adItem: `AdItem` object to be converted.
702
- - Returns: The produced JS object.
703
- */
704
576
  static func toJson(adItem: AdItem?) -> [String: Any?]? {
705
577
  guard let adItem else {
706
578
  return nil
@@ -711,11 +583,6 @@ extension RCTConvert {
711
583
  ]
712
584
  }
713
585
 
714
- /**
715
- Utility method to compute a JS value from an `AdSource` object.
716
- - Parameter adSource: `AdSource` object to be converted.
717
- - Returns: The produced JS object.
718
- */
719
586
  static func toJson(adSource: AdSource?) -> [String: Any?]? {
720
587
  guard let adSource else {
721
588
  return nil
@@ -726,11 +593,6 @@ extension RCTConvert {
726
593
  ]
727
594
  }
728
595
 
729
- /**
730
- Utility method to compute a JS value from an `AdSourceType` value.
731
- - Parameter adSourceType: `AdSourceType` object to be converted.
732
- - Returns: The produced JS object.
733
- */
734
596
  static func toJson(adSourceType: AdSourceType?) -> String? {
735
597
  guard let adSourceType else {
736
598
  return nil
@@ -747,11 +609,6 @@ extension RCTConvert {
747
609
  }
748
610
  }
749
611
 
750
- /**
751
- Utility method to compute a JS value from an `AdConfig` object.
752
- - Parameter adConfig: `AdConfig` object to be converted.
753
- - Returns: The produced JS object.
754
- */
755
612
  static func toJson(adConfig: AdConfig?) -> [String: Any?]? {
756
613
  guard let adConfig else {
757
614
  return nil
@@ -759,11 +616,6 @@ extension RCTConvert {
759
616
  return ["replaceContentDuration": adConfig.replaceContentDuration]
760
617
  }
761
618
 
762
- /**
763
- Utility method to compute a JS string from an `AdQuartile` value.
764
- - Parameter adQuartile: `AdQuartile` value to be converted.
765
- - Returns: The produced JS string.
766
- */
767
619
  static func toJson(adQuartile: AdQuartile?) -> String? {
768
620
  guard let adQuartile else {
769
621
  return nil
@@ -778,11 +630,6 @@ extension RCTConvert {
778
630
  }
779
631
  }
780
632
 
781
- /**
782
- Utility method to compute a JS value from an `AdBreak` object.
783
- - Parameter adBreak: `AdBreak` object to be converted.
784
- - Returns: The produced JS object.
785
- */
786
633
  static func toJson(adBreak: AdBreak?) -> [String: Any?]? {
787
634
  guard let adBreak else {
788
635
  return nil
@@ -794,11 +641,6 @@ extension RCTConvert {
794
641
  ]
795
642
  }
796
643
 
797
- /**
798
- Utility method to compute a JS value from an `Ad` object.
799
- - Parameter ad: `Ad` object to be converted.
800
- - Returns: The produced JS object.
801
- */
802
644
  static func toJson(ad: Ad?) -> [String: Any?]? {
803
645
  guard let ad else {
804
646
  return nil
@@ -814,11 +656,6 @@ extension RCTConvert {
814
656
  ]
815
657
  }
816
658
 
817
- /**
818
- Utility method to compute a JS value from an `AdData` object.
819
- - Parameter adData `AdData` object to be converted.
820
- - Returns: The produced JS object.
821
- */
822
659
  static func toJson(adData: AdData?) -> [String: Any?]? {
823
660
  guard let adData else {
824
661
  return nil
@@ -831,11 +668,6 @@ extension RCTConvert {
831
668
  ]
832
669
  }
833
670
 
834
- /**
835
- Utility method to get a `BitmovinAnalyticsConfig` value from a JS object.
836
- - Parameter json: JS object.
837
- - Returns: The associated `BitmovinAnalyticsConfig` value or nil.
838
- */
839
671
  static func analyticsConfig(_ json: Any?) -> AnalyticsConfig? {
840
672
  guard
841
673
  let json = json as? [String: Any?],
@@ -872,11 +704,6 @@ extension RCTConvert {
872
704
  )
873
705
  }
874
706
 
875
- /**
876
- Utility method to get an analytics `CustomData` value from a JS object.
877
- - Parameter json: JS object.
878
- - Returns: The associated `CustomData` value or nil.
879
- */
880
707
  static func analyticsCustomData(_ json: Any?) -> CustomData? {
881
708
  guard let json = json as? [String: Any?] else {
882
709
  return nil
@@ -916,11 +743,6 @@ extension RCTConvert {
916
743
  )
917
744
  }
918
745
 
919
- /**
920
- Utility method to get a JS value from a `CustomData` object.
921
- - Parameter analyticsCustomData: Analytics custom data object.
922
- - Returns: The JS value representing the given object.
923
- */
924
746
  static func toJson(analyticsCustomData: CustomData?) -> [String: Any?]? {
925
747
  guard let analyticsCustomData else {
926
748
  return nil
@@ -960,11 +782,6 @@ extension RCTConvert {
960
782
  return json
961
783
  }
962
784
 
963
- /**
964
- Utility method to get an analytics `SourceMetadata` value from a JS object.
965
- - Parameter json: JS object.
966
- - Returns: The associated `SourceMetadata` value or nil.
967
- */
968
785
  static func analyticsSourceMetadata(_ json: Any?) -> SourceMetadata? {
969
786
  guard let json = json as? [String: Any?] else {
970
787
  return nil
@@ -982,30 +799,24 @@ extension RCTConvert {
982
799
  )
983
800
  }
984
801
 
985
- /**
986
- Utility method to compute a JS value from a `VideoQuality` object.
987
- - Parameter videoQuality `VideoQuality` object to be converted.
988
- - Returns: The produced JS object.
989
- */
990
- static func toJson(videoQuality: VideoQuality?) -> [String: Any?]? {
802
+ static func toJson(videoQuality: VideoQuality?) -> [String: Any]? {
991
803
  guard let videoQuality else {
992
804
  return nil
993
805
  }
994
- return [
806
+ var videoQualityDict: [String: Any] = [
995
807
  "id": videoQuality.identifier,
996
808
  "label": videoQuality.label,
997
809
  "height": videoQuality.height,
998
810
  "width": videoQuality.width,
999
- "codec": videoQuality.codec,
1000
811
  "bitrate": videoQuality.bitrate,
1001
812
  ]
813
+ if let codec = videoQuality.codec {
814
+ videoQualityDict["codec"] = codec
815
+ }
816
+
817
+ return videoQualityDict
1002
818
  }
1003
819
 
1004
- /**
1005
- Utility method to get a `UserInterfaceType` from a JS object.
1006
- - Parameter json: JS object
1007
- - Returns: The associated `UserInterfaceType` value or `nil`
1008
- */
1009
820
  static func userInterfaceType(_ json: Any?) -> UserInterfaceType? {
1010
821
  guard let json = json as? String else {
1011
822
  return .none
@@ -1025,11 +836,6 @@ extension RCTConvert {
1025
836
  }
1026
837
 
1027
838
  #if os(iOS)
1028
- /**
1029
- Utility method to compute a JS value from an `OfflineState` object.
1030
- - Parameter offlineState `OfflineState` object to be converted.
1031
- - Returns: The produced JS object.
1032
- */
1033
839
  static func toJson(offlineState: OfflineState?) -> String {
1034
840
  var notDownloaded = "NotDownloaded"
1035
841
  guard let offlineState else {
@@ -1048,11 +854,6 @@ extension RCTConvert {
1048
854
  }
1049
855
  }
1050
856
 
1051
- /**
1052
- Utility method to compute a JS value from an `OfflineTextTrack` object.
1053
- - Parameter offlineTrack `OfflineTextTrack` object to be converted.
1054
- - Returns: The produced JS object.
1055
- */
1056
857
  static func toJson(offlineTrack: OfflineTextTrack) -> [String: Any?] {
1057
858
  [
1058
859
  "id": offlineTrack.label,
@@ -1060,11 +861,6 @@ extension RCTConvert {
1060
861
  ]
1061
862
  }
1062
863
 
1063
- /**
1064
- Utility method to compute a JS value from an `OfflineAudioTrack` object.
1065
- - Parameter offlineTrack `OfflineAudioTrack` object to be converted.
1066
- - Returns: The produced JS object.
1067
- */
1068
864
  static func toJson(offlineTrack: OfflineAudioTrack) -> [String: Any?] {
1069
865
  [
1070
866
  "id": offlineTrack.label,
@@ -1072,12 +868,7 @@ extension RCTConvert {
1072
868
  ]
1073
869
  }
1074
870
 
1075
- /**
1076
- Utility method to compute a JS value from an `OfflineTrackSelection` object.
1077
- - Parameter offlineTracks `OfflineTrackSelection` object to be converted.
1078
- - Returns: The produced JS object.
1079
- */
1080
- static func toJson(offlineTracks: OfflineTrackSelection?) -> [String: Any?]? {
871
+ static func toJson(offlineTracks: OfflineTrackSelection?) -> [String: Any]? {
1081
872
  guard let offlineTracks else {
1082
873
  return nil
1083
874
  }
@@ -1089,11 +880,6 @@ extension RCTConvert {
1089
880
  }
1090
881
  #endif
1091
882
 
1092
- /**
1093
- Utility method to instantiate a `AdaptationConfig` from a JS object.
1094
- - Parameter json: JS object
1095
- - Returns: The produced `AdaptationConfig` object
1096
- */
1097
883
  static func adaptationConfig(_ json: Any?) -> AdaptationConfig? {
1098
884
  guard let json = json as? [String: Any?] else {
1099
885
  return nil
@@ -1106,12 +892,7 @@ extension RCTConvert {
1106
892
  return adaptationConfig
1107
893
  }
1108
894
 
1109
- /**
1110
- Utility method to compute a JS value from an `Thumbnail` object.
1111
- - Parameter thumbnail `Thumbnail` object to be converted.
1112
- - Returns: The produced JS object.
1113
- */
1114
- static func toJson(thumbnail: Thumbnail?) -> [String: Any?]? {
895
+ static func toJson(thumbnail: Thumbnail?) -> [String: Any]? {
1115
896
  guard let thumbnail else {
1116
897
  return nil
1117
898
  }
@@ -1128,11 +909,6 @@ extension RCTConvert {
1128
909
  ]
1129
910
  }
1130
911
 
1131
- /**
1132
- Utility method to instantiate a `RemoteControlConfig` from a JS object.
1133
- - Parameter json: JS object
1134
- - Returns: The produced `RemoteControlConfig` object
1135
- */
1136
912
  static func remoteControlConfig(_ json: Any?) -> RemoteControlConfig? {
1137
913
  guard let json = json as? [String: Any?] else {
1138
914
  return nil
@@ -1160,11 +936,6 @@ extension RCTConvert {
1160
936
  }
1161
937
 
1162
938
  #if os(iOS)
1163
- /**
1164
- Utility method to instantiate a `BitmovinCastManagerOptions` from a JS object.
1165
- - Parameter json: JS object
1166
- - Returns: The produced `BitmovinCastManagerOptions` object
1167
- */
1168
939
  static func castManagerOptions(_ json: Any?) -> BitmovinCastManagerOptions? {
1169
940
  guard let json = json as? [String: Any?] else {
1170
941
  return nil
@@ -1176,11 +947,6 @@ extension RCTConvert {
1176
947
  return options
1177
948
  }
1178
949
 
1179
- /**
1180
- Utility method to compute a JS value from an `CastPayload` object.
1181
- - Parameter castPayload `CastPayload` object to be converted.
1182
- - Returns: The produced JS object.
1183
- */
1184
950
  static func toJson(castPayload: CastPayload) -> [String: Any?] {
1185
951
  [
1186
952
  "currentTime": castPayload.currentTime,
@@ -1189,30 +955,21 @@ extension RCTConvert {
1189
955
  ]
1190
956
  }
1191
957
 
1192
- /**
1193
- Utility method to instantiate a `SourceRemoteControlConfig` from a JS object.
1194
- - Parameter json: JS object
1195
- - Returns: The produced `SourceRemoteControlConfig` object
1196
- */
1197
958
  static func sourceRemoteControlConfig(_ json: Any?) -> SourceRemoteControlConfig? {
1198
959
  guard let json = json as? [String: Any?],
1199
960
  let castSourceConfigJson = json["castSourceConfig"] as? [String: Any?] else {
1200
961
  return nil
1201
962
  }
963
+
1202
964
  return SourceRemoteControlConfig(
1203
965
  castSourceConfig: RCTConvert.sourceConfig(
1204
- json["castSourceConfig"],
1205
- drmConfig: RCTConvert.drmConfig(castSourceConfigJson["drmConfig"]).widevine
966
+ castSourceConfigJson,
967
+ drmConfig: castSourceConfigJson["drmConfig"].flatMap(RCTConvert.drmConfig)?.widevine
1206
968
  )
1207
969
  )
1208
970
  }
1209
971
  #endif
1210
972
 
1211
- /**
1212
- Utility method to instantiate a `PictureInPictureConfig` from a JS object.
1213
- - Parameter json: JS object
1214
- - Returns: The produced `PictureInPictureConfig` object
1215
- */
1216
973
  static func pictureInPictureConfig(_ json: Any?) -> PictureInPictureConfig? {
1217
974
  guard let json = json as? [String: Any?] else {
1218
975
  return nil
@@ -1231,28 +988,18 @@ extension RCTConvert {
1231
988
  return pictureInPictureConfig
1232
989
  }
1233
990
 
1234
- /**
1235
- Utility method to instantiate a `RNPlayerViewConfig` from a JS object.
1236
- - Parameter json: JS object
1237
- - Returns: The produced `UiConfig` object
1238
- */
1239
991
  static func rnPlayerViewConfig(_ json: Any?) -> RNPlayerViewConfig? {
1240
992
  guard let json = json as? [String: Any?] else {
1241
993
  return nil
1242
994
  }
1243
995
 
1244
996
  return RNPlayerViewConfig(
1245
- uiConfig: rnUiConfig(json["uiConfig"]),
1246
- pictureInPictureConfig: pictureInPictureConfig(json["pictureInPictureConfig"]),
997
+ uiConfig: json["uiConfig"].flatMap(rnUiConfig),
998
+ pictureInPictureConfig: json["pictureInPictureConfig"].flatMap(pictureInPictureConfig),
1247
999
  hideFirstFrame: json["hideFirstFrame"] as? Bool
1248
1000
  )
1249
1001
  }
1250
1002
 
1251
- /**
1252
- Utility method to instantiate a `RNUiConfig` from a JS object.
1253
- - Parameter json: JS object
1254
- - Returns: The produced `RNUiConfig` object
1255
- */
1256
1003
  static func rnUiConfig(_ json: Any?) -> RNUiConfig? {
1257
1004
  guard let json = json as? [String: Any?] else {
1258
1005
  return nil
@@ -1267,11 +1014,6 @@ extension RCTConvert {
1267
1014
  )
1268
1015
  }
1269
1016
 
1270
- /**
1271
- * Maps a JS string into the corresponding `BufferType` value.
1272
- * - Parameter json: JS string representing the `BufferType`.
1273
- * - Returns: The `BufferType` corresponding to `json`, or `nil` if the conversion fails.
1274
- */
1275
1017
  static func bufferType(_ json: String) -> BufferType? {
1276
1018
  switch json {
1277
1019
  case "forwardDuration":
@@ -1283,11 +1025,6 @@ extension RCTConvert {
1283
1025
  }
1284
1026
  }
1285
1027
 
1286
- /**
1287
- * Converts any `BufferType` value into its json representation.
1288
- * - Parameter bufferType: `BufferType` value.
1289
- * - Returns: The produced JS string.
1290
- */
1291
1028
  static func toJson(bufferType: BufferType) -> String {
1292
1029
  switch bufferType {
1293
1030
  case .forwardDuration:
@@ -1297,12 +1034,6 @@ extension RCTConvert {
1297
1034
  }
1298
1035
  }
1299
1036
 
1300
- /**
1301
- Utility method to get a json dictionary value from a `BufferLevel` object.
1302
- - Parameter bufferLevel: The `BufferLevel` to convert to json format.
1303
- - Parameter mediaType: The `MediaType` value to pass through.
1304
- - Returns: The generated json dictionary.
1305
- */
1306
1037
  static func toJson(bufferLevel: BufferLevel, mediaType: String) -> [String: Any] {
1307
1038
  [
1308
1039
  "level": bufferLevel.level,
@@ -1312,11 +1043,6 @@ extension RCTConvert {
1312
1043
  ]
1313
1044
  }
1314
1045
 
1315
- /**
1316
- Utility method to get a json dictionary value from a `BufferModule.RNBufferLevels` object.
1317
- - Parameter bufferLevels: The `BufferModule.RNBufferLevels` to convert to json format.
1318
- - Returns: The generated json dictionary.
1319
- */
1320
1046
  static func toJson(bufferLevels: RNBufferLevels) -> [String: Any] {
1321
1047
  [
1322
1048
  "audio": toJson(bufferLevel: bufferLevels.audio, mediaType: "audio"),