@npo/player 1.29.1 → 2.0.0-beta.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 (532) hide show
  1. package/README.md +32 -24
  2. package/dist/logErrorEvent-DbEp9rzx.js +25 -0
  3. package/dist/logErrorEvent-DbEp9rzx.js.map +1 -0
  4. package/dist/main-XvJyWo8j.js +53061 -0
  5. package/dist/main-XvJyWo8j.js.map +1 -0
  6. package/dist/main.d.ts +1163 -0
  7. package/dist/npoplayer-audio.es.js +19 -0
  8. package/dist/npoplayer-audio.es.js.map +1 -0
  9. package/dist/npoplayer-audio.umd.js +53088 -0
  10. package/dist/npoplayer-audio.umd.js.map +1 -0
  11. package/package.json +72 -86
  12. package/CHANGELOG.md +0 -3
  13. package/LICENSE +0 -15
  14. package/lib/js/markers/updateLiveMarkers.d.ts +0 -9
  15. package/lib/js/markers/updateLiveMarkers.js +0 -56
  16. package/lib/js/markers/updateLiveMarkers.test.d.ts +0 -1
  17. package/lib/js/markers/updateLiveMarkers.test.js +0 -63
  18. package/lib/js/playeractions/handlers/handleoffsets.d.ts +0 -4
  19. package/lib/js/playeractions/handlers/handleoffsets.js +0 -58
  20. package/lib/js/playeractions/handlers/handleoffsets.test.d.ts +0 -1
  21. package/lib/js/playeractions/handlers/handleoffsets.test.js +0 -93
  22. package/lib/js/playeractions/handlers/mediasessionactions.d.ts +0 -7
  23. package/lib/js/playeractions/handlers/mediasessionactions.js +0 -123
  24. package/lib/js/playeractions/handlers/processplayerconfig.d.ts +0 -3
  25. package/lib/js/playeractions/handlers/processplayerconfig.js +0 -56
  26. package/lib/js/playeractions/handlers/processplayerconfig.test.d.ts +0 -1
  27. package/lib/js/playeractions/handlers/processplayerconfig.test.js +0 -116
  28. package/lib/js/playeractions/handlers/processsourceconfig.d.ts +0 -15
  29. package/lib/js/playeractions/handlers/processsourceconfig.js +0 -234
  30. package/lib/js/playeractions/handlers/processsourceconfig.test.d.ts +0 -1
  31. package/lib/js/playeractions/handlers/processsourceconfig.test.js +0 -25
  32. package/lib/js/playeractions/handlers/removereplayclass.d.ts +0 -2
  33. package/lib/js/playeractions/handlers/removereplayclass.js +0 -12
  34. package/lib/js/playeractions/handlers/removereplayclass.test.d.ts +0 -1
  35. package/lib/js/playeractions/handlers/removereplayclass.test.js +0 -33
  36. package/lib/js/playeractions/playeractions.d.ts +0 -3
  37. package/lib/js/playeractions/playeractions.js +0 -3
  38. package/lib/js/settings/localization.d.ts +0 -82
  39. package/lib/js/settings/localization.js +0 -7
  40. package/lib/js/settings/settings.user-agent.d.ts +0 -1
  41. package/lib/js/settings/settings.user-agent.js +0 -1
  42. package/lib/js/utilities/utilities.element.d.ts +0 -16
  43. package/lib/js/utilities/utilities.element.js +0 -18
  44. package/lib/js/utilities/utilities.element.test.d.ts +0 -1
  45. package/lib/js/utilities/utilities.element.test.js +0 -38
  46. package/lib/js/utilities/utilities.jwt.d.ts +0 -5
  47. package/lib/js/utilities/utilities.jwt.js +0 -44
  48. package/lib/js/utilities/utilities.jwt.test.d.ts +0 -1
  49. package/lib/js/utilities/utilities.jwt.test.js +0 -32
  50. package/lib/js/utilities/utilities.locale.d.ts +0 -2
  51. package/lib/js/utilities/utilities.locale.js +0 -4
  52. package/lib/js/utilities/utilities.locale.test.d.ts +0 -1
  53. package/lib/js/utilities/utilities.locale.test.js +0 -10
  54. package/lib/js/utilities/utilities.module.d.ts +0 -1
  55. package/lib/js/utilities/utilities.module.js +0 -4
  56. package/lib/js/utilities/utilities.module.test.d.ts +0 -1
  57. package/lib/js/utilities/utilities.module.test.js +0 -19
  58. package/lib/js/utilities/utilities.prid.d.ts +0 -6
  59. package/lib/js/utilities/utilities.prid.js +0 -8
  60. package/lib/js/utilities/utilities.prid.test.d.ts +0 -1
  61. package/lib/js/utilities/utilities.prid.test.js +0 -46
  62. package/lib/js/utilities/utilities.stream.d.ts +0 -7
  63. package/lib/js/utilities/utilities.stream.js +0 -19
  64. package/lib/js/utilities/utilities.stream.test.d.ts +0 -1
  65. package/lib/js/utilities/utilities.stream.test.js +0 -32
  66. package/lib/js/utilities/utilities.text.d.ts +0 -1
  67. package/lib/js/utilities/utilities.text.js +0 -3
  68. package/lib/js/utilities/utilities.text.test.d.ts +0 -1
  69. package/lib/js/utilities/utilities.text.test.js +0 -18
  70. package/lib/js/utilities/utilities.time.d.ts +0 -1
  71. package/lib/js/utilities/utilities.time.js +0 -3
  72. package/lib/js/utilities/utilities.time.test.d.ts +0 -1
  73. package/lib/js/utilities/utilities.time.test.js +0 -8
  74. package/lib/js/utilities/utilities.url.d.ts +0 -3
  75. package/lib/js/utilities/utilities.url.js +0 -29
  76. package/lib/js/utilities/utilities.url.test.d.ts +0 -1
  77. package/lib/js/utilities/utilities.url.test.js +0 -46
  78. package/lib/js/utilities/utilities.user-agent.d.ts +0 -3
  79. package/lib/js/utilities/utilities.user-agent.js +0 -13
  80. package/lib/js/utilities/utilities.user-agent.test.d.ts +0 -1
  81. package/lib/js/utilities/utilities.user-agent.test.js +0 -60
  82. package/lib/js/utilities/utilities.version.d.ts +0 -1
  83. package/lib/js/utilities/utilities.version.js +0 -26
  84. package/lib/js/utilities/utilities.version.test.d.ts +0 -1
  85. package/lib/js/utilities/utilities.version.test.js +0 -26
  86. package/lib/lang/nl.json +0 -77
  87. package/lib/lang/subtitleLabels/nl.json +0 -14
  88. package/lib/npoplayer.d.ts +0 -64
  89. package/lib/npoplayer.js +0 -428
  90. package/lib/npoplayer.test.d.ts +0 -1
  91. package/lib/npoplayer.test.js +0 -22
  92. package/lib/package.json +0 -105
  93. package/lib/services/a11y/setup.d.ts +0 -2
  94. package/lib/services/a11y/setup.js +0 -15
  95. package/lib/services/a11y/setup.test.d.ts +0 -1
  96. package/lib/services/a11y/setup.test.js +0 -88
  97. package/lib/services/advertHandlers/discardAdBreak.d.ts +0 -2
  98. package/lib/services/advertHandlers/discardAdBreak.js +0 -9
  99. package/lib/services/advertHandlers/discardAdBreak.test.d.ts +0 -1
  100. package/lib/services/advertHandlers/discardAdBreak.test.js +0 -40
  101. package/lib/services/advertHandlers/handlePreRolls.d.ts +0 -2
  102. package/lib/services/advertHandlers/handlePreRolls.js +0 -136
  103. package/lib/services/advertHandlers/handlePrerolls.test.d.ts +0 -1
  104. package/lib/services/advertHandlers/handlePrerolls.test.js +0 -112
  105. package/lib/services/avTypeHandlers/getAVType.d.ts +0 -2
  106. package/lib/services/avTypeHandlers/getAVType.js +0 -9
  107. package/lib/services/avTypeHandlers/getAVType.test.d.ts +0 -1
  108. package/lib/services/avTypeHandlers/getAVType.test.js +0 -18
  109. package/lib/services/backButton/backButton.d.ts +0 -2
  110. package/lib/services/backButton/backButton.js +0 -24
  111. package/lib/services/cdnProviders/cdnProviders.d.ts +0 -4
  112. package/lib/services/cdnProviders/cdnProviders.js +0 -24
  113. package/lib/services/cdnProviders/cndProviders.test.d.ts +0 -1
  114. package/lib/services/cdnProviders/cndProviders.test.js +0 -22
  115. package/lib/services/chapterHandlers/chapterHandler.d.ts +0 -35
  116. package/lib/services/chapterHandlers/chapterHandler.js +0 -230
  117. package/lib/services/drmHandlers/constants.d.ts +0 -15
  118. package/lib/services/drmHandlers/constants.js +0 -13
  119. package/lib/services/drmHandlers/decideprofile.d.ts +0 -2
  120. package/lib/services/drmHandlers/decideprofile.js +0 -57
  121. package/lib/services/drmHandlers/decideprofile.test.d.ts +0 -1
  122. package/lib/services/drmHandlers/decideprofile.test.js +0 -38
  123. package/lib/services/drmHandlers/drmhandlers.d.ts +0 -2
  124. package/lib/services/drmHandlers/drmhandlers.js +0 -2
  125. package/lib/services/drmHandlers/utils.d.ts +0 -5
  126. package/lib/services/drmHandlers/utils.js +0 -29
  127. package/lib/services/drmHandlers/utils.test.d.ts +0 -1
  128. package/lib/services/drmHandlers/utils.test.js +0 -81
  129. package/lib/services/drmHandlers/verifydrm.d.ts +0 -2
  130. package/lib/services/drmHandlers/verifydrm.js +0 -39
  131. package/lib/services/drmHandlers/verifydrm.test.d.ts +0 -1
  132. package/lib/services/drmHandlers/verifydrm.test.js +0 -112
  133. package/lib/services/errors/errorBackground.test.d.ts +0 -1
  134. package/lib/services/errors/errorBackground.test.js +0 -48
  135. package/lib/services/errors/errorHandler.d.ts +0 -5
  136. package/lib/services/errors/errorHandler.js +0 -59
  137. package/lib/services/errors/errorHandler.test.d.ts +0 -1
  138. package/lib/services/errors/errorHandler.test.js +0 -148
  139. package/lib/services/errors/errorRetryHandler.d.ts +0 -2
  140. package/lib/services/errors/errorRetryHandler.js +0 -14
  141. package/lib/services/errors/errorRetryHandler.test.d.ts +0 -1
  142. package/lib/services/errors/errorRetryHandler.test.js +0 -62
  143. package/lib/services/errors/errorText.d.ts +0 -2
  144. package/lib/services/errors/errorText.js +0 -62
  145. package/lib/services/errors/errorText.test.d.ts +0 -1
  146. package/lib/services/errors/errorText.test.js +0 -66
  147. package/lib/services/eventListenerHandlers/removeEventListeners.d.ts +0 -2
  148. package/lib/services/eventListenerHandlers/removeEventListeners.js +0 -24
  149. package/lib/services/eventListenerHandlers/removeEventListeners.test.d.ts +0 -1
  150. package/lib/services/eventListenerHandlers/removeEventListeners.test.js +0 -36
  151. package/lib/services/infoPanel/infoPanel.d.ts +0 -3
  152. package/lib/services/infoPanel/infoPanel.js +0 -35
  153. package/lib/services/infoPanel/infoPanel.test.d.ts +0 -1
  154. package/lib/services/infoPanel/infoPanel.test.js +0 -70
  155. package/lib/services/keyboardHandlers/resolvekeypress.d.ts +0 -2
  156. package/lib/services/keyboardHandlers/resolvekeypress.js +0 -63
  157. package/lib/services/keyboardHandlers/resolvekeypress.test.d.ts +0 -1
  158. package/lib/services/keyboardHandlers/resolvekeypress.test.js +0 -92
  159. package/lib/services/liveStreamHandlers/handleLiveStreamControls.d.ts +0 -6
  160. package/lib/services/liveStreamHandlers/handleLiveStreamControls.js +0 -36
  161. package/lib/services/liveStreamHandlers/handleLiveStreamControls.test.d.ts +0 -2
  162. package/lib/services/liveStreamHandlers/handleLiveStreamControls.test.js +0 -65
  163. package/lib/services/localStorageHandlers/localStorageHandlers.d.ts +0 -4
  164. package/lib/services/localStorageHandlers/localStorageHandlers.js +0 -36
  165. package/lib/services/localStorageHandlers/localStorageHandlers.test.d.ts +0 -1
  166. package/lib/services/localStorageHandlers/localStorageHandlers.test.js +0 -104
  167. package/lib/services/nicamHandlers/nicamhandler.d.ts +0 -6
  168. package/lib/services/nicamHandlers/nicamhandler.js +0 -69
  169. package/lib/services/nicamHandlers/nicamhandler.test.d.ts +0 -1
  170. package/lib/services/nicamHandlers/nicamhandler.test.js +0 -127
  171. package/lib/services/npoPlayerAPI/contants.d.ts +0 -25
  172. package/lib/services/npoPlayerAPI/contants.js +0 -11
  173. package/lib/services/npoPlayerAPI/npoPlayerAPI.d.ts +0 -53
  174. package/lib/services/npoPlayerAPI/npoPlayerAPI.js +0 -193
  175. package/lib/services/npoPlayerAPI/npoPlayerAPI.test.d.ts +0 -1
  176. package/lib/services/npoPlayerAPI/npoPlayerAPI.test.js +0 -127
  177. package/lib/services/npoPlayerAPI/playerModules.d.ts +0 -1
  178. package/lib/services/npoPlayerAPI/playerModules.js +0 -48
  179. package/lib/services/preferences/handlePreferences.d.ts +0 -2
  180. package/lib/services/preferences/handlePreferences.js +0 -47
  181. package/lib/services/preferences/handlePreferences.test.d.ts +0 -1
  182. package/lib/services/preferences/handlePreferences.test.js +0 -138
  183. package/lib/services/segmentHandlers/addSegmentEventListeners.d.ts +0 -2
  184. package/lib/services/segmentHandlers/addSegmentEventListeners.js +0 -15
  185. package/lib/services/segmentHandlers/addSegmentEventListeners.test.d.ts +0 -1
  186. package/lib/services/segmentHandlers/addSegmentEventListeners.test.js +0 -44
  187. package/lib/services/segmentHandlers/convertFragmentToSegment.d.ts +0 -2
  188. package/lib/services/segmentHandlers/convertFragmentToSegment.js +0 -8
  189. package/lib/services/segmentHandlers/convertFragmentToSegment.test.d.ts +0 -1
  190. package/lib/services/segmentHandlers/convertFragmentToSegment.test.js +0 -17
  191. package/lib/services/segmentHandlers/handleSegmentSeek.d.ts +0 -5
  192. package/lib/services/segmentHandlers/handleSegmentSeek.js +0 -15
  193. package/lib/services/segmentHandlers/handleSegmentSeek.test.d.ts +0 -1
  194. package/lib/services/segmentHandlers/handleSegmentSeek.test.js +0 -73
  195. package/lib/services/segmentHandlers/handleSegmentTimeChanged.d.ts +0 -2
  196. package/lib/services/segmentHandlers/handleSegmentTimeChanged.js +0 -21
  197. package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +0 -1
  198. package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.js +0 -43
  199. package/lib/services/segmentHandlers/initSegment.d.ts +0 -7
  200. package/lib/services/segmentHandlers/initSegment.js +0 -10
  201. package/lib/services/segmentHandlers/initSegment.test.d.ts +0 -1
  202. package/lib/services/segmentHandlers/initSegment.test.js +0 -38
  203. package/lib/services/segmentHandlers/isSegmentInBounds.d.ts +0 -2
  204. package/lib/services/segmentHandlers/isSegmentInBounds.js +0 -5
  205. package/lib/services/segmentHandlers/isSegmentInBounds.test.d.ts +0 -1
  206. package/lib/services/segmentHandlers/isSegmentInBounds.test.js +0 -27
  207. package/lib/services/segmentHandlers/setSegmentMarkers.d.ts +0 -2
  208. package/lib/services/segmentHandlers/setSegmentMarkers.js +0 -25
  209. package/lib/services/segmentHandlers/setSegmentMarkers.test.d.ts +0 -1
  210. package/lib/services/segmentHandlers/setSegmentMarkers.test.js +0 -32
  211. package/lib/services/services.d.ts +0 -34
  212. package/lib/services/services.js +0 -129
  213. package/lib/services/streamFetchHandler/fetchStream.d.ts +0 -2
  214. package/lib/services/streamFetchHandler/fetchStream.js +0 -49
  215. package/lib/services/streamFetchHandler/fetchstream.test.d.ts +0 -1
  216. package/lib/services/streamFetchHandler/fetchstream.test.js +0 -92
  217. package/lib/services/streamoptionsHandlers/streamOptionsHandler.d.ts +0 -6
  218. package/lib/services/streamoptionsHandlers/streamOptionsHandler.js +0 -80
  219. package/lib/services/streamoptionsHandlers/streamOptionsHandler.test.d.ts +0 -1
  220. package/lib/services/streamoptionsHandlers/streamOptionsHandler.test.js +0 -199
  221. package/lib/services/trackingHandlers/eventBinding.d.ts +0 -2
  222. package/lib/services/trackingHandlers/eventBinding.js +0 -129
  223. package/lib/services/trackingHandlers/eventBinding.test.d.ts +0 -1
  224. package/lib/services/trackingHandlers/eventBinding.test.js +0 -145
  225. package/lib/services/trackingHandlers/eventLogging.d.ts +0 -2
  226. package/lib/services/trackingHandlers/eventLogging.js +0 -37
  227. package/lib/services/trackingHandlers/eventLogging.test.d.ts +0 -1
  228. package/lib/services/trackingHandlers/eventLogging.test.js +0 -63
  229. package/lib/services/trackingHandlers/index.d.ts +0 -3
  230. package/lib/services/trackingHandlers/index.js +0 -3
  231. package/lib/services/trackingHandlers/playerTrackerInit.d.ts +0 -2
  232. package/lib/services/trackingHandlers/playerTrackerInit.js +0 -20
  233. package/lib/services/trackingHandlers/playerTrackerInit.test.d.ts +0 -1
  234. package/lib/services/trackingHandlers/playerTrackerInit.test.js +0 -75
  235. package/lib/services/trackingHandlers/playerTrackerStart.d.ts +0 -2
  236. package/lib/services/trackingHandlers/playerTrackerStart.js +0 -28
  237. package/lib/services/trackingHandlers/playerTrackerStart.test.d.ts +0 -1
  238. package/lib/services/trackingHandlers/playerTrackerStart.test.js +0 -76
  239. package/lib/services/trackingHandlers/streamTrackerInit.d.ts +0 -3
  240. package/lib/services/trackingHandlers/streamTrackerInit.js +0 -27
  241. package/lib/services/trackingHandlers/streamTrackerInit.test.d.ts +0 -1
  242. package/lib/services/trackingHandlers/streamTrackerInit.test.js +0 -84
  243. package/lib/services/uiHandlers/uiVisiblityHandler.d.ts +0 -3
  244. package/lib/services/uiHandlers/uiVisiblityHandler.js +0 -32
  245. package/lib/services/uiHandlers/uiVisiblityHandler.test.d.ts +0 -1
  246. package/lib/services/uiHandlers/uiVisiblityHandler.test.js +0 -62
  247. package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.d.ts +0 -2
  248. package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.js +0 -6
  249. package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.test.d.ts +0 -1
  250. package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.test.js +0 -23
  251. package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.d.ts +0 -2
  252. package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.js +0 -26
  253. package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.test.d.ts +0 -1
  254. package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.test.js +0 -73
  255. package/lib/src/js/markers/updateLiveMarkers.d.ts +0 -9
  256. package/lib/src/js/markers/updateLiveMarkers.test.d.ts +0 -1
  257. package/lib/src/js/playeractions/handlers/handleoffsets.d.ts +0 -4
  258. package/lib/src/js/playeractions/handlers/handleoffsets.test.d.ts +0 -1
  259. package/lib/src/js/playeractions/handlers/mediasessionactions.d.ts +0 -7
  260. package/lib/src/js/playeractions/handlers/processplayerconfig.d.ts +0 -3
  261. package/lib/src/js/playeractions/handlers/processplayerconfig.test.d.ts +0 -1
  262. package/lib/src/js/playeractions/handlers/processsourceconfig.d.ts +0 -15
  263. package/lib/src/js/playeractions/handlers/processsourceconfig.test.d.ts +0 -1
  264. package/lib/src/js/playeractions/handlers/removereplayclass.d.ts +0 -2
  265. package/lib/src/js/playeractions/handlers/removereplayclass.test.d.ts +0 -1
  266. package/lib/src/js/playeractions/playeractions.d.ts +0 -3
  267. package/lib/src/js/settings/localization.d.ts +0 -82
  268. package/lib/src/js/settings/settings.user-agent.d.ts +0 -1
  269. package/lib/src/js/utilities/utilities.element.d.ts +0 -16
  270. package/lib/src/js/utilities/utilities.element.test.d.ts +0 -1
  271. package/lib/src/js/utilities/utilities.jwt.d.ts +0 -5
  272. package/lib/src/js/utilities/utilities.jwt.test.d.ts +0 -1
  273. package/lib/src/js/utilities/utilities.locale.d.ts +0 -2
  274. package/lib/src/js/utilities/utilities.locale.test.d.ts +0 -1
  275. package/lib/src/js/utilities/utilities.module.d.ts +0 -1
  276. package/lib/src/js/utilities/utilities.module.test.d.ts +0 -1
  277. package/lib/src/js/utilities/utilities.prid.d.ts +0 -6
  278. package/lib/src/js/utilities/utilities.prid.test.d.ts +0 -1
  279. package/lib/src/js/utilities/utilities.stream.d.ts +0 -7
  280. package/lib/src/js/utilities/utilities.stream.test.d.ts +0 -1
  281. package/lib/src/js/utilities/utilities.text.d.ts +0 -1
  282. package/lib/src/js/utilities/utilities.text.test.d.ts +0 -1
  283. package/lib/src/js/utilities/utilities.time.d.ts +0 -1
  284. package/lib/src/js/utilities/utilities.time.test.d.ts +0 -1
  285. package/lib/src/js/utilities/utilities.url.d.ts +0 -3
  286. package/lib/src/js/utilities/utilities.url.test.d.ts +0 -1
  287. package/lib/src/js/utilities/utilities.user-agent.d.ts +0 -3
  288. package/lib/src/js/utilities/utilities.user-agent.test.d.ts +0 -1
  289. package/lib/src/js/utilities/utilities.version.d.ts +0 -1
  290. package/lib/src/js/utilities/utilities.version.test.d.ts +0 -1
  291. package/lib/src/npoplayer.d.ts +0 -64
  292. package/lib/src/npoplayer.test.d.ts +0 -1
  293. package/lib/src/services/a11y/setup.d.ts +0 -2
  294. package/lib/src/services/a11y/setup.test.d.ts +0 -1
  295. package/lib/src/services/advertHandlers/discardAdBreak.d.ts +0 -2
  296. package/lib/src/services/advertHandlers/discardAdBreak.test.d.ts +0 -1
  297. package/lib/src/services/advertHandlers/handlePreRolls.d.ts +0 -2
  298. package/lib/src/services/advertHandlers/handlePrerolls.test.d.ts +0 -1
  299. package/lib/src/services/avTypeHandlers/getAVType.d.ts +0 -2
  300. package/lib/src/services/avTypeHandlers/getAVType.test.d.ts +0 -1
  301. package/lib/src/services/backButton/backButton.d.ts +0 -2
  302. package/lib/src/services/cdnProviders/cdnProviders.d.ts +0 -4
  303. package/lib/src/services/cdnProviders/cndProviders.test.d.ts +0 -1
  304. package/lib/src/services/chapterHandlers/chapterHandler.d.ts +0 -35
  305. package/lib/src/services/drmHandlers/constants.d.ts +0 -15
  306. package/lib/src/services/drmHandlers/decideprofile.d.ts +0 -2
  307. package/lib/src/services/drmHandlers/decideprofile.test.d.ts +0 -1
  308. package/lib/src/services/drmHandlers/drmhandlers.d.ts +0 -2
  309. package/lib/src/services/drmHandlers/utils.d.ts +0 -5
  310. package/lib/src/services/drmHandlers/utils.test.d.ts +0 -1
  311. package/lib/src/services/drmHandlers/verifydrm.d.ts +0 -2
  312. package/lib/src/services/drmHandlers/verifydrm.test.d.ts +0 -1
  313. package/lib/src/services/errors/errorBackground.test.d.ts +0 -1
  314. package/lib/src/services/errors/errorHandler.d.ts +0 -5
  315. package/lib/src/services/errors/errorHandler.test.d.ts +0 -1
  316. package/lib/src/services/errors/errorRetryHandler.d.ts +0 -2
  317. package/lib/src/services/errors/errorRetryHandler.test.d.ts +0 -1
  318. package/lib/src/services/errors/errorText.d.ts +0 -2
  319. package/lib/src/services/errors/errorText.test.d.ts +0 -1
  320. package/lib/src/services/eventListenerHandlers/removeEventListeners.d.ts +0 -2
  321. package/lib/src/services/eventListenerHandlers/removeEventListeners.test.d.ts +0 -1
  322. package/lib/src/services/infoPanel/infoPanel.d.ts +0 -3
  323. package/lib/src/services/infoPanel/infoPanel.test.d.ts +0 -1
  324. package/lib/src/services/keyboardHandlers/resolvekeypress.d.ts +0 -2
  325. package/lib/src/services/keyboardHandlers/resolvekeypress.test.d.ts +0 -1
  326. package/lib/src/services/liveStreamHandlers/handleLiveStreamControls.d.ts +0 -6
  327. package/lib/src/services/liveStreamHandlers/handleLiveStreamControls.test.d.ts +0 -2
  328. package/lib/src/services/localStorageHandlers/localStorageHandlers.d.ts +0 -4
  329. package/lib/src/services/localStorageHandlers/localStorageHandlers.test.d.ts +0 -1
  330. package/lib/src/services/nicamHandlers/nicamhandler.d.ts +0 -6
  331. package/lib/src/services/nicamHandlers/nicamhandler.test.d.ts +0 -1
  332. package/lib/src/services/npoPlayerAPI/contants.d.ts +0 -25
  333. package/lib/src/services/npoPlayerAPI/npoPlayerAPI.d.ts +0 -53
  334. package/lib/src/services/npoPlayerAPI/npoPlayerAPI.test.d.ts +0 -1
  335. package/lib/src/services/npoPlayerAPI/playerModules.d.ts +0 -1
  336. package/lib/src/services/preferences/handlePreferences.d.ts +0 -2
  337. package/lib/src/services/preferences/handlePreferences.test.d.ts +0 -1
  338. package/lib/src/services/segmentHandlers/addSegmentEventListeners.d.ts +0 -2
  339. package/lib/src/services/segmentHandlers/addSegmentEventListeners.test.d.ts +0 -1
  340. package/lib/src/services/segmentHandlers/convertFragmentToSegment.d.ts +0 -2
  341. package/lib/src/services/segmentHandlers/convertFragmentToSegment.test.d.ts +0 -1
  342. package/lib/src/services/segmentHandlers/handleSegmentSeek.d.ts +0 -5
  343. package/lib/src/services/segmentHandlers/handleSegmentSeek.test.d.ts +0 -1
  344. package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.d.ts +0 -2
  345. package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +0 -1
  346. package/lib/src/services/segmentHandlers/initSegment.d.ts +0 -7
  347. package/lib/src/services/segmentHandlers/initSegment.test.d.ts +0 -1
  348. package/lib/src/services/segmentHandlers/isSegmentInBounds.d.ts +0 -2
  349. package/lib/src/services/segmentHandlers/isSegmentInBounds.test.d.ts +0 -1
  350. package/lib/src/services/segmentHandlers/setSegmentMarkers.d.ts +0 -2
  351. package/lib/src/services/segmentHandlers/setSegmentMarkers.test.d.ts +0 -1
  352. package/lib/src/services/services.d.ts +0 -34
  353. package/lib/src/services/streamFetchHandler/fetchStream.d.ts +0 -2
  354. package/lib/src/services/streamFetchHandler/fetchstream.test.d.ts +0 -1
  355. package/lib/src/services/streamoptionsHandlers/streamOptionsHandler.d.ts +0 -6
  356. package/lib/src/services/streamoptionsHandlers/streamOptionsHandler.test.d.ts +0 -1
  357. package/lib/src/services/trackingHandlers/eventBinding.d.ts +0 -2
  358. package/lib/src/services/trackingHandlers/eventBinding.test.d.ts +0 -1
  359. package/lib/src/services/trackingHandlers/eventLogging.d.ts +0 -2
  360. package/lib/src/services/trackingHandlers/eventLogging.test.d.ts +0 -1
  361. package/lib/src/services/trackingHandlers/index.d.ts +0 -3
  362. package/lib/src/services/trackingHandlers/playerTrackerInit.d.ts +0 -2
  363. package/lib/src/services/trackingHandlers/playerTrackerInit.test.d.ts +0 -1
  364. package/lib/src/services/trackingHandlers/playerTrackerStart.d.ts +0 -2
  365. package/lib/src/services/trackingHandlers/playerTrackerStart.test.d.ts +0 -1
  366. package/lib/src/services/trackingHandlers/streamTrackerInit.d.ts +0 -3
  367. package/lib/src/services/trackingHandlers/streamTrackerInit.test.d.ts +0 -1
  368. package/lib/src/services/uiHandlers/uiVisiblityHandler.d.ts +0 -3
  369. package/lib/src/services/uiHandlers/uiVisiblityHandler.test.d.ts +0 -1
  370. package/lib/src/services/verticalVideoHandlers/handleVerticalVideoControls.d.ts +0 -2
  371. package/lib/src/services/verticalVideoHandlers/handleVerticalVideoControls.test.d.ts +0 -1
  372. package/lib/src/services/verticalVideoHandlers/handleVerticalVideoSettings.d.ts +0 -2
  373. package/lib/src/services/verticalVideoHandlers/handleVerticalVideoSettings.test.d.ts +0 -1
  374. package/lib/src/types/classes.d.ts +0 -10
  375. package/lib/src/types/events.d.ts +0 -98
  376. package/lib/src/types/interfaces.d.ts +0 -246
  377. package/lib/src/ui/components/adbutton.d.ts +0 -4
  378. package/lib/src/ui/components/adlabel.d.ts +0 -4
  379. package/lib/src/ui/components/audio/controlbar.d.ts +0 -3
  380. package/lib/src/ui/components/backButton.d.ts +0 -2
  381. package/lib/src/ui/components/buttons.d.ts +0 -42
  382. package/lib/src/ui/components/controlbar.d.ts +0 -3
  383. package/lib/src/ui/components/ctabar.d.ts +0 -4
  384. package/lib/src/ui/components/infopanel/infopanel.d.ts +0 -3
  385. package/lib/src/ui/components/infopanel/togglebutton.d.ts +0 -3
  386. package/lib/src/ui/components/playnext.d.ts +0 -4
  387. package/lib/src/ui/components/seekbar.d.ts +0 -6
  388. package/lib/src/ui/components/settingspanel.d.ts +0 -3
  389. package/lib/src/ui/components/titlebar.d.ts +0 -3
  390. package/lib/src/ui/components/topbar.d.ts +0 -3
  391. package/lib/src/ui/components/verticalvideo/controlbar.d.ts +0 -3
  392. package/lib/src/ui/components/verticalvideo/settingspanel.d.ts +0 -2
  393. package/lib/src/ui/handlers/accessibilityhandler.d.ts +0 -2
  394. package/lib/src/ui/handlers/accessibilityhandler.test.d.ts +0 -1
  395. package/lib/src/ui/handlers/domhandlers.d.ts +0 -3
  396. package/lib/src/ui/handlers/domhandlers.test.d.ts +0 -1
  397. package/lib/src/ui/handlers/listboxhandlers.d.ts +0 -19
  398. package/lib/src/ui/handlers/playnextscreen.d.ts +0 -6
  399. package/lib/src/ui/handlers/playnextscreen.test.d.ts +0 -1
  400. package/lib/src/ui/handlers/timecontrolhandlers.d.ts +0 -3
  401. package/lib/src/ui/uicontainer.d.ts +0 -3
  402. package/lib/src/ui/uicontainer.test.d.ts +0 -1
  403. package/lib/tests/jest.setup-files-after-env.d.ts +0 -0
  404. package/lib/tests/jest.setup-files-after-env.js +0 -6
  405. package/lib/tests/jest.setup-tests.d.ts +0 -1
  406. package/lib/tests/jest.setup-tests.js +0 -2
  407. package/lib/tests/mocks/mockLogEmitter.d.ts +0 -2
  408. package/lib/tests/mocks/mockLogEmitter.js +0 -20
  409. package/lib/tests/mocks/mockNpoplayer.d.ts +0 -2
  410. package/lib/tests/mocks/mockNpoplayer.js +0 -105
  411. package/lib/tests/mocks/mockPlayerAPI.d.ts +0 -3
  412. package/lib/tests/mocks/mockPlayerAPI.js +0 -195
  413. package/lib/tests/mocks/mockPlayerUi.d.ts +0 -64
  414. package/lib/tests/mocks/mockPlayerUi.js +0 -251
  415. package/lib/tests/mocks/mockStreamObject.d.ts +0 -2
  416. package/lib/tests/mocks/mockStreamObject.js +0 -21
  417. package/lib/tests/mocks/playerContextMock.d.ts +0 -7
  418. package/lib/tests/mocks/playerContextMock.js +0 -153
  419. package/lib/types/classes.d.ts +0 -10
  420. package/lib/types/classes.js +0 -15
  421. package/lib/types/events.d.ts +0 -98
  422. package/lib/types/events.js +0 -184
  423. package/lib/types/interfaces.d.ts +0 -246
  424. package/lib/types/interfaces.js +0 -20
  425. package/lib/ui/components/adbutton.d.ts +0 -4
  426. package/lib/ui/components/adbutton.js +0 -12
  427. package/lib/ui/components/adlabel.d.ts +0 -4
  428. package/lib/ui/components/adlabel.js +0 -8
  429. package/lib/ui/components/audio/controlbar.d.ts +0 -3
  430. package/lib/ui/components/audio/controlbar.js +0 -23
  431. package/lib/ui/components/backButton.d.ts +0 -2
  432. package/lib/ui/components/backButton.js +0 -8
  433. package/lib/ui/components/buttons.d.ts +0 -42
  434. package/lib/ui/components/buttons.js +0 -144
  435. package/lib/ui/components/controlbar.d.ts +0 -3
  436. package/lib/ui/components/controlbar.js +0 -40
  437. package/lib/ui/components/ctabar.d.ts +0 -4
  438. package/lib/ui/components/ctabar.js +0 -28
  439. package/lib/ui/components/infopanel/infopanel.d.ts +0 -3
  440. package/lib/ui/components/infopanel/infopanel.js +0 -42
  441. package/lib/ui/components/infopanel/togglebutton.d.ts +0 -3
  442. package/lib/ui/components/infopanel/togglebutton.js +0 -18
  443. package/lib/ui/components/playnext.d.ts +0 -4
  444. package/lib/ui/components/playnext.js +0 -10
  445. package/lib/ui/components/seekbar.d.ts +0 -6
  446. package/lib/ui/components/seekbar.js +0 -26
  447. package/lib/ui/components/settingspanel.d.ts +0 -3
  448. package/lib/ui/components/settingspanel.js +0 -159
  449. package/lib/ui/components/titlebar.d.ts +0 -3
  450. package/lib/ui/components/titlebar.js +0 -14
  451. package/lib/ui/components/topbar.d.ts +0 -3
  452. package/lib/ui/components/topbar.js +0 -36
  453. package/lib/ui/components/verticalvideo/controlbar.d.ts +0 -3
  454. package/lib/ui/components/verticalvideo/controlbar.js +0 -40
  455. package/lib/ui/components/verticalvideo/settingspanel.d.ts +0 -2
  456. package/lib/ui/components/verticalvideo/settingspanel.js +0 -25
  457. package/lib/ui/handlers/accessibilityhandler.d.ts +0 -2
  458. package/lib/ui/handlers/accessibilityhandler.js +0 -22
  459. package/lib/ui/handlers/accessibilityhandler.test.d.ts +0 -1
  460. package/lib/ui/handlers/accessibilityhandler.test.js +0 -54
  461. package/lib/ui/handlers/domhandlers.d.ts +0 -3
  462. package/lib/ui/handlers/domhandlers.js +0 -7
  463. package/lib/ui/handlers/domhandlers.test.d.ts +0 -1
  464. package/lib/ui/handlers/domhandlers.test.js +0 -31
  465. package/lib/ui/handlers/listboxhandlers.d.ts +0 -19
  466. package/lib/ui/handlers/listboxhandlers.js +0 -43
  467. package/lib/ui/handlers/playnextscreen.d.ts +0 -6
  468. package/lib/ui/handlers/playnextscreen.js +0 -28
  469. package/lib/ui/handlers/playnextscreen.test.d.ts +0 -1
  470. package/lib/ui/handlers/playnextscreen.test.js +0 -57
  471. package/lib/ui/handlers/timecontrolhandlers.d.ts +0 -3
  472. package/lib/ui/handlers/timecontrolhandlers.js +0 -17
  473. package/lib/ui/uicontainer.d.ts +0 -3
  474. package/lib/ui/uicontainer.js +0 -80
  475. package/lib/ui/uicontainer.test.d.ts +0 -1
  476. package/lib/ui/uicontainer.test.js +0 -84
  477. package/src/style/components/_advert.scss +0 -119
  478. package/src/style/components/_audio.scss +0 -4
  479. package/src/style/components/_back-button.scss +0 -42
  480. package/src/style/components/_buffering.scss +0 -69
  481. package/src/style/components/_controlbars.scss +0 -26
  482. package/src/style/components/_error.scss +0 -71
  483. package/src/style/components/_hugeplaybacktogglebutton.scss +0 -97
  484. package/src/style/components/_icons.scss +0 -177
  485. package/src/style/components/_infopanel.scss +0 -105
  486. package/src/style/components/_metadata.scss +0 -52
  487. package/src/style/components/_nicam.scss +0 -117
  488. package/src/style/components/_playnext.scss +0 -72
  489. package/src/style/components/_poster.scss +0 -3
  490. package/src/style/components/_replay.scss +0 -25
  491. package/src/style/components/_seekbar.scss +0 -114
  492. package/src/style/components/_seekbarthumbnail.scss +0 -61
  493. package/src/style/components/_settingspanel.scss +0 -290
  494. package/src/style/components/_subtitles.scss +0 -78
  495. package/src/style/components/_textbuttons.scss +0 -82
  496. package/src/style/components/_volumeslider.scss +0 -94
  497. package/src/style/components/audio/_bottombar.scss +0 -54
  498. package/src/style/components/audio/_buffering.scss +0 -8
  499. package/src/style/components/audio/_errors.scss +0 -13
  500. package/src/style/components/audio/_metadata.scss +0 -60
  501. package/src/style/components/audio/_playbutton.scss +0 -54
  502. package/src/style/components/audio/_poster.scss +0 -19
  503. package/src/style/components/audio/_replay.scss +0 -28
  504. package/src/style/components/audio/_seekbar.scss +0 -28
  505. package/src/style/components/audio/_topbar.scss +0 -35
  506. package/src/style/components/audio/_vars.scss +0 -5
  507. package/src/style/components/audio/_volumeslider.scss +0 -41
  508. package/src/style/components/vertical-video/_bottombar.scss +0 -60
  509. package/src/style/components/vertical-video/_buttons.scss +0 -25
  510. package/src/style/components/vertical-video/_hugeplaybacktogglebutton.scss +0 -34
  511. package/src/style/components/vertical-video/_seekbar.scss +0 -19
  512. package/src/style/components/vertical-video/_settingsbutton.scss +0 -7
  513. package/src/style/components/vertical-video/_settingspanel.scss +0 -31
  514. package/src/style/components/vertical-video/_shortvideo.scss +0 -14
  515. package/src/style/components/vertical-video/_subtitles.scss +0 -3
  516. package/src/style/components/vertical-video/_topbar.scss +0 -58
  517. package/src/style/components/vertical-video/_volumeslider.scss +0 -9
  518. package/src/style/npoplayer.css +0 -908
  519. package/src/style/npoplayer.scss +0 -58
  520. package/src/style/variants/_player-audio-only.scss +0 -32
  521. package/src/style/variants/_player-audio.scss +0 -55
  522. package/src/style/variants/_player-base.scss +0 -101
  523. package/src/style/variants/_player-debug.scss +0 -14
  524. package/src/style/variants/_player-large.scss +0 -99
  525. package/src/style/variants/_player-medium.scss +0 -68
  526. package/src/style/variants/_player-small.scss +0 -203
  527. package/src/style/variants/_player-vertical.scss +0 -23
  528. package/src/style/vars/_audio.scss +0 -5
  529. package/src/style/vars/_colors.scss +0 -25
  530. package/src/style/vars/_fonts.scss +0 -26
  531. package/src/style/vars/_icons.scss +0 -29
  532. package/src/style/vars/_z-index.scss +0 -1
@@ -1,38 +0,0 @@
1
- import { getElementByQuery, updateClassFromElementByQuery } from './utilities.element';
2
- const CLASS = 'element-class';
3
- const NEW_CLASS = 'new-class';
4
- const ID = 'element-id';
5
- const PARENT_ELEMENT = document.createElement('div');
6
- const CHILD_ELEMENT_WITH_ID = document.createElement('div');
7
- const CHILD_ELEMENT_WITH_CLASS = document.createElement('div');
8
- CHILD_ELEMENT_WITH_ID.setAttribute('id', ID);
9
- CHILD_ELEMENT_WITH_CLASS.setAttribute('class', CLASS);
10
- PARENT_ELEMENT.appendChild(CHILD_ELEMENT_WITH_ID);
11
- PARENT_ELEMENT.appendChild(CHILD_ELEMENT_WITH_CLASS);
12
- describe('getElementByQuery', () => {
13
- it('should return the child element', () => {
14
- expect(getElementByQuery({ container: PARENT_ELEMENT, query: `#${ID}` })).toEqual(CHILD_ELEMENT_WITH_ID);
15
- });
16
- });
17
- describe('updateClassFromElementByQuery', () => {
18
- it('should remove the specified class from the queried element', () => {
19
- updateClassFromElementByQuery({
20
- container: PARENT_ELEMENT,
21
- query: `.${CLASS}`,
22
- className: CLASS,
23
- condition: false
24
- });
25
- expect(PARENT_ELEMENT.querySelector(`.${CLASS}`)).toBeNull();
26
- });
27
- it('should add the specified class to the queried element', () => {
28
- const ELEMENT_WITHOUT_CLASS = document.createElement('div');
29
- PARENT_ELEMENT.appendChild(ELEMENT_WITHOUT_CLASS);
30
- updateClassFromElementByQuery({
31
- container: PARENT_ELEMENT,
32
- query: 'div:not([class])',
33
- className: NEW_CLASS,
34
- condition: true
35
- });
36
- expect(PARENT_ELEMENT.querySelector(`.${NEW_CLASS}`)).not.toBeNull();
37
- });
38
- });
@@ -1,5 +0,0 @@
1
- export declare const convertBase64ToObject: (value: string) => Record<string, any>;
2
- export declare const convertJwtToBase64: (jwt: string) => string;
3
- export declare function isJWTToken(token: string): boolean;
4
- export declare function getJwtIat(jwt: string): number;
5
- export declare function isJwtFresh(jwt: string, maxAgeSeconds?: number): boolean;
@@ -1,44 +0,0 @@
1
- export const convertBase64ToObject = (value) => {
2
- try {
3
- const decodedValue = [...window.atob(value)];
4
- const mappedValue = decodedValue.map((c) => {
5
- const codePoint = c.codePointAt(0);
6
- if (codePoint === undefined)
7
- return;
8
- return '%' + ('00' + codePoint.toString(16)).slice(-2);
9
- });
10
- return JSON.parse(decodeURIComponent(mappedValue.join('')));
11
- }
12
- catch {
13
- return {};
14
- }
15
- };
16
- export const convertJwtToBase64 = (jwt) => {
17
- return jwt.toString().split('.')[1].replace('-', '+').replace('_', '/');
18
- };
19
- export function isJWTToken(token) {
20
- const JWT_REGEX = /^(?:[\w=-]+\.){2}[\w+./=-]+$/;
21
- return JWT_REGEX.test(token);
22
- }
23
- export function getJwtIat(jwt) {
24
- const parts = jwt.split('.');
25
- if (parts.length !== 3) {
26
- throw new Error('Invalid JWT format');
27
- }
28
- const payloadJson = Buffer.from(parts[1], 'base64').toString('utf8');
29
- const payload = JSON.parse(payloadJson);
30
- if (typeof payload.iat !== 'number') {
31
- throw new TypeError('JWT `iat` claim missing or not a number');
32
- }
33
- return payload.iat;
34
- }
35
- export function isJwtFresh(jwt, maxAgeSeconds = 3600) {
36
- try {
37
- const issuedAt = getJwtIat(jwt);
38
- const ageSeconds = Date.now() / 1000 - issuedAt;
39
- return ageSeconds <= maxAgeSeconds;
40
- }
41
- catch {
42
- return false;
43
- }
44
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- import { convertBase64ToObject, convertJwtToBase64, isJWTToken } from './utilities.jwt';
2
- describe('convertBase64ToObject', () => {
3
- test('base64 string should return an object', () => {
4
- const BASE64 = 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ';
5
- const exptectedObject = { sub: '1234567890', name: 'John Doe', iat: 1516239022 };
6
- expect(convertBase64ToObject(BASE64)).toMatchObject(exptectedObject);
7
- });
8
- test('invalid base64 string should return an empty object', () => {
9
- expect(convertBase64ToObject('e2ludmFsaWRPYmplY3R9=')).toMatchObject({});
10
- });
11
- });
12
- describe('convertJwtToBase64', () => {
13
- test('convert a JWT to a base64 string', () => {
14
- const BASE64 = 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ';
15
- const JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
16
- expect(convertJwtToBase64(JWT)).toBe(BASE64);
17
- });
18
- });
19
- describe('isJWTToken', () => {
20
- test('valid JWT token should return true', () => {
21
- const validToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJucG8iLCJpYXQiOjE3MDA1Nzk4ODgsImxpY2Vuc2VfcHJvZmlsZSI6IndlYiIsImRybV90eXBlIjoid2lkZXZpbmUiLCJjbGllbnRfaXAiOiIzMS4yMS4yMDUuMTcxIn0.mxNDb_gx8nqwc5p-PwSPnJgjPB8_L-niXm_gIcgkQBw';
22
- expect(isJWTToken(validToken)).toBe(true);
23
- });
24
- test('invalid JWT token should return false', () => {
25
- const invalidToken = 'invalidToken';
26
- expect(isJWTToken(invalidToken)).toBe(false);
27
- });
28
- test('an url input should return false, despite 3 dots', () => {
29
- const invalidToken = 'https://www.example.com';
30
- expect(isJWTToken(invalidToken)).toBe(false);
31
- });
32
- });
@@ -1,2 +0,0 @@
1
- import { type LocalizableText } from 'bitmovin-player-ui/dist/js/framework/localization/i18n';
2
- export declare function localizeKey(key: string): LocalizableText;
@@ -1,4 +0,0 @@
1
- import { i18n } from 'bitmovin-player-ui/dist/js/framework/localization/i18n';
2
- export function localizeKey(key) {
3
- return i18n.getLocalizer(key);
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { i18n } from 'bitmovin-player-ui/dist/js/framework/localization/i18n';
2
- import { localizeKey } from './utilities.locale';
3
- const KEY = 'settings.value';
4
- describe('localizeKey', () => {
5
- it('should return a localized key', () => {
6
- const spy = jest.spyOn(i18n, 'getLocalizer');
7
- localizeKey(KEY);
8
- expect(spy).toHaveBeenCalledWith(KEY);
9
- });
10
- });
@@ -1 +0,0 @@
1
- export declare function getModuleExport(module: unknown): unknown;
@@ -1,4 +0,0 @@
1
- export function getModuleExport(module) {
2
- const isDefaultExport = typeof module === 'object' && module !== null && 'default' in module;
3
- return isDefaultExport ? module.default : module;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import { getModuleExport } from './utilities.module';
2
- describe('getModuleExport', () => {
3
- it('should return null for the module', () => {
4
- const MODULE = undefined;
5
- expect(getModuleExport(MODULE)).toBeUndefined();
6
- });
7
- it('should return a string as module', () => {
8
- const MODULE = 'module';
9
- expect(getModuleExport(MODULE)).toBe(MODULE);
10
- });
11
- it('should return a non-default object as module', () => {
12
- const MODULE = { module: true };
13
- expect(getModuleExport(MODULE)).toMatchObject(MODULE);
14
- });
15
- it('should return the default module', () => {
16
- const MODULE = { default: true };
17
- expect(getModuleExport(MODULE)).toBeTruthy();
18
- });
19
- });
@@ -1,6 +0,0 @@
1
- import { SourceConfig, StreamObject } from 'types/interfaces';
2
- export declare function getAnalyticsPrid(params: {
3
- source: string;
4
- sourceConfig?: SourceConfig;
5
- streamObject?: StreamObject;
6
- }): string;
@@ -1,8 +0,0 @@
1
- import { isJWTToken } from './utilities.jwt';
2
- export function getAnalyticsPrid(params) {
3
- const { source, sourceConfig, streamObject } = params;
4
- if (isJWTToken(source)) {
5
- return streamObject?.metadata?.prid ?? '';
6
- }
7
- return sourceConfig?.metadata?.prid ?? source;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- import { mockStreamObject } from '../../../tests/mocks/mockStreamObject';
2
- import { getAnalyticsPrid } from './utilities.prid';
3
- describe('getAnalyticsPrid', () => {
4
- it('should return the prid from streamObject if the source is a JWT token', () => {
5
- const result = getAnalyticsPrid({
6
- source: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
7
- sourceConfig: undefined,
8
- streamObject: {
9
- ...mockStreamObject,
10
- metadata: {
11
- ...mockStreamObject.metadata,
12
- prid: '123'
13
- }
14
- }
15
- });
16
- expect(result).toBe('123');
17
- });
18
- it('should return an empty string if the source is a JWT token but no prid is present in streamObject', () => {
19
- const result = getAnalyticsPrid({
20
- source: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
21
- sourceConfig: undefined,
22
- streamObject: {
23
- ...mockStreamObject
24
- }
25
- });
26
- expect(result).toBe('');
27
- });
28
- it('should return the prid from sourceConfig if the source is a media file URL', () => {
29
- const result = getAnalyticsPrid({
30
- source: 'https://example.com/media/video.mp4',
31
- sourceConfig: { metadata: { prid: '456' } },
32
- streamObject: undefined
33
- });
34
- expect(result).toBe('456');
35
- });
36
- it('should return the source (media file URL) if no prid is found', () => {
37
- const result = getAnalyticsPrid({
38
- source: 'https://example.com/media/audio.mp3',
39
- sourceConfig: undefined,
40
- streamObject: {
41
- ...mockStreamObject
42
- }
43
- });
44
- expect(result).toBe('https://example.com/media/audio.mp3');
45
- });
46
- });
@@ -1,7 +0,0 @@
1
- interface StreamDurationInSecondsParams {
2
- duration: string | number | undefined;
3
- durationIsInMs?: boolean;
4
- }
5
- export declare function getStreamDurationInSeconds(params: StreamDurationInSecondsParams): number;
6
- export declare function validatePrid(prid: string | undefined): string;
7
- export {};
@@ -1,19 +0,0 @@
1
- import { convertMsToSeconds } from './utilities.time';
2
- export function getStreamDurationInSeconds(params) {
3
- const { duration, durationIsInMs } = params;
4
- if (duration === undefined || duration === Number.POSITIVE_INFINITY) {
5
- return -1;
6
- }
7
- if (durationIsInMs) {
8
- return convertMsToSeconds(Number(duration));
9
- }
10
- else if (Number.isFinite(+duration)) {
11
- return Number(duration);
12
- }
13
- else {
14
- return -1;
15
- }
16
- }
17
- export function validatePrid(prid) {
18
- return prid !== '' && prid !== undefined ? prid : 'unknown';
19
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- import { getStreamDurationInSeconds, validatePrid } from './utilities.stream';
2
- describe('getStreamDurationInSeconds', () => {
3
- it('shoud return -1 for an undefined duration', () => {
4
- expect(getStreamDurationInSeconds({ duration: undefined })).toBe(-1);
5
- });
6
- it('shoud return -1 for an infinite duration', () => {
7
- expect(getStreamDurationInSeconds({ duration: Number.POSITIVE_INFINITY })).toBe(-1);
8
- });
9
- it('shoud return the duration in seconds with a string as input', () => {
10
- expect(getStreamDurationInSeconds({ duration: '10' })).toBe(10);
11
- });
12
- it('shoud return the duration in seconds with a number as input', () => {
13
- expect(getStreamDurationInSeconds({ duration: 10 })).toBe(10);
14
- });
15
- it('shoud return the duration in seconds with a string as input in ms', () => {
16
- expect(getStreamDurationInSeconds({ duration: '10000', durationIsInMs: true })).toBe(10);
17
- });
18
- it('shoud return the duration in seconds with a number as input in ms', () => {
19
- expect(getStreamDurationInSeconds({ duration: 10000, durationIsInMs: true })).toBe(10);
20
- });
21
- });
22
- describe('validatePrid', () => {
23
- it('should return "unknown" for an empty prid', () => {
24
- expect(validatePrid('')).toBe('unknown');
25
- });
26
- it('should return "unknown" for a null value', () => {
27
- expect(validatePrid(undefined)).toBe('unknown');
28
- });
29
- it('should return the prid', () => {
30
- expect(validatePrid('PRID')).toBe('PRID');
31
- });
32
- });
@@ -1 +0,0 @@
1
- export declare function replaceSpecialCharacters(text: string): string;
@@ -1,3 +0,0 @@
1
- export function replaceSpecialCharacters(text) {
2
- return text.replace(/['()*]/g, (char) => `%${char.codePointAt(0)?.toString(16).toUpperCase()}`);
3
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { replaceSpecialCharacters } from './utilities.text';
2
- describe('replaceSpecialCharacters', () => {
3
- it('should replace special characters with their hexadecimal representation', () => {
4
- const inputText = 'This is a test with ( and * characters.';
5
- const result = replaceSpecialCharacters(inputText);
6
- expect(result).toBe('This is a test with %28 and %2A characters.');
7
- });
8
- it('should handle an empty string', () => {
9
- const inputText = '';
10
- const result = replaceSpecialCharacters(inputText);
11
- expect(result).toBe('');
12
- });
13
- it('should handle a string with no special characters', () => {
14
- const inputText = 'This is a normal string without special characters.';
15
- const result = replaceSpecialCharacters(inputText);
16
- expect(result).toBe(inputText);
17
- });
18
- });
@@ -1 +0,0 @@
1
- export declare function convertMsToSeconds(ms: number): number;
@@ -1,3 +0,0 @@
1
- export function convertMsToSeconds(ms) {
2
- return ms / 1000;
3
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { convertMsToSeconds } from './utilities.time';
2
- describe('convertMsToSeconds', () => {
3
- test('convert milliseconds to seconds', () => {
4
- const TIME_IN_MS = 5000;
5
- const TIME_IN_SECONDS = 5;
6
- expect(convertMsToSeconds(TIME_IN_MS)).toBe(TIME_IN_SECONDS);
7
- });
8
- });
@@ -1,3 +0,0 @@
1
- export declare function isMediaUrl(url: string): Promise<boolean>;
2
- export declare function isUrl(url: string): boolean;
3
- export declare const removeTrailingSlash: (url: string) => string;
@@ -1,29 +0,0 @@
1
- const supportedMediaTypes = [
2
- 'video/',
3
- 'audio/',
4
- 'application/octet-stream',
5
- 'application/mp4',
6
- 'application/x-mpegURL',
7
- 'application/vnd.apple.mpegurl',
8
- 'application/ogg'
9
- ];
10
- export async function isMediaUrl(url) {
11
- if (!isUrl(url))
12
- return false;
13
- try {
14
- const response = await fetch(url, { method: 'HEAD' });
15
- const header = response.headers.get('Content-Type') ?? '';
16
- return supportedMediaTypes.some((mediaType) => header.startsWith(mediaType));
17
- }
18
- catch (error) {
19
- console.error('Failed to fetch the URL', error);
20
- return false;
21
- }
22
- }
23
- export function isUrl(url) {
24
- const URL_REGEX = /^(http|https):\/\/(?:www\.)?[\dA-Za-z-]+(?:\.[A-Za-z]{2,})+(?:\/[^ "]+)?(?:\?.*)?$/;
25
- return URL_REGEX.test(url);
26
- }
27
- export const removeTrailingSlash = (url) => {
28
- return url.endsWith('/') ? url.slice(0, -1) : url;
29
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- import fetchMock from 'jest-fetch-mock';
2
- import { isMediaUrl, isUrl, removeTrailingSlash } from './utilities.url';
3
- fetchMock.enableMocks();
4
- const INVALID_URL = 'invalidurl';
5
- const VALID_URL = 'https://example.com';
6
- describe('isMediaUrl', () => {
7
- it('should return false for an invalid url', async () => {
8
- expect(await isMediaUrl(INVALID_URL)).toBeFalsy();
9
- });
10
- it('should fail to fetch the url and return false', async () => {
11
- expect(await isMediaUrl(VALID_URL)).toBeFalsy();
12
- });
13
- it('should not contain a header with a mediaType and return false', async () => {
14
- fetchMock.mockResponseOnce('', { headers: { 'Content-Type': 'application/json' } });
15
- expect(await isMediaUrl(VALID_URL)).toBeFalsy();
16
- });
17
- it('should contain a header with a mediaType and return true', async () => {
18
- fetchMock.mockResponseOnce('', { headers: { 'Content-Type': 'application/vnd.apple.mpegurl' } });
19
- expect(await isMediaUrl(VALID_URL)).toBeTruthy();
20
- });
21
- });
22
- describe('isUrl', () => {
23
- test('valid URL should return true', () => {
24
- const VALID_URL = 'https://www.example.com';
25
- expect(isUrl(VALID_URL)).toBeTruthy();
26
- });
27
- test('valid URL with parameters should return true', () => {
28
- const VALID_URL = 'https://www.example.com?foo=bar';
29
- expect(isUrl(VALID_URL)).toBeTruthy();
30
- });
31
- test('valid URL with parameters should return true', () => {
32
- const VALID_URL = 'https://example.com';
33
- expect(isUrl(VALID_URL)).toBeTruthy();
34
- });
35
- test('invalid URL should return false', () => {
36
- const INVALID_URL = 'invalidurl';
37
- expect(isUrl(INVALID_URL)).toBeFalsy();
38
- });
39
- });
40
- describe('removeTrailingSlash', () => {
41
- test('trailing slash should be removed from url', () => {
42
- const URL_BASE = 'https://www.example.com';
43
- const URL_WITH_TRAILING_SLASH = URL_BASE + '/';
44
- expect(removeTrailingSlash(URL_WITH_TRAILING_SLASH)).toBe(URL_BASE);
45
- });
46
- });
@@ -1,3 +0,0 @@
1
- export declare function isFairPlayDrmSupported(keySystems: string[]): boolean;
2
- export declare const isSafariUserAgent: (userAgent: string) => boolean;
3
- export declare function isSafari(): boolean;
@@ -1,13 +0,0 @@
1
- import { supportedKeySystems } from '../settings/settings.user-agent';
2
- export function isFairPlayDrmSupported(keySystems) {
3
- return keySystems.some((keySystem) => window.WebKitMediaKeys?.isTypeSupported(keySystem, 'video/mp4'));
4
- }
5
- export const isSafariUserAgent = (userAgent) => userAgent.includes('Safari') &&
6
- !userAgent.includes('Chrome') &&
7
- !userAgent.includes('IEMobile') &&
8
- !userAgent.includes('Edge') &&
9
- !userAgent.includes('Chromium') &&
10
- !userAgent.includes('Android');
11
- export function isSafari() {
12
- return isSafariUserAgent(navigator.userAgent) || isFairPlayDrmSupported(supportedKeySystems);
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,60 +0,0 @@
1
- import { isFairPlayDrmSupported, isSafari, isSafariUserAgent } from './utilities.user-agent';
2
- const defaultKeySystems = ['com.apple.fps.1_0', 'com.apple.fps.2_0'];
3
- describe('isFairPlayDrmSupported', () => {
4
- it('should call WebKitMediaKeys.isTypeSupported with the right parameters', () => {
5
- const isTypeSupported = jest.fn();
6
- Object.defineProperty(window, 'WebKitMediaKeys', {
7
- value: { isTypeSupported },
8
- writable: true
9
- });
10
- isFairPlayDrmSupported(defaultKeySystems);
11
- expect(isTypeSupported).toHaveBeenCalledWith('com.apple.fps.1_0', 'video/mp4');
12
- expect(isTypeSupported).toHaveBeenCalledWith('com.apple.fps.2_0', 'video/mp4');
13
- });
14
- it('should return false if WebKitMediaKeys is not available', () => {
15
- Object.defineProperty(window, 'WebKitMediaKeys', {
16
- value: undefined,
17
- writable: true
18
- });
19
- expect(isFairPlayDrmSupported(defaultKeySystems)).toBe(false);
20
- });
21
- it('should return false if an empty array of key systems is provided', () => {
22
- Object.defineProperty(window, 'WebKitMediaKeys', {
23
- value: { isTypeSupported: () => true },
24
- writable: true
25
- });
26
- expect(isFairPlayDrmSupported([])).toBe(false);
27
- });
28
- });
29
- describe('isSafariUserAgent', () => {
30
- it('should return true for Safari', () => {
31
- expect(isSafariUserAgent('Safari')).toBe(true);
32
- });
33
- it('should return false for other user agents', () => {
34
- expect(isSafariUserAgent('Chrome')).toBe(false);
35
- expect(isSafariUserAgent('IEMobile')).toBe(false);
36
- expect(isSafariUserAgent('Edge')).toBe(false);
37
- expect(isSafariUserAgent('Chromium')).toBe(false);
38
- expect(isSafariUserAgent('Android')).toBe(false);
39
- });
40
- });
41
- describe('isSafari', () => {
42
- it('should return true if the user agent is Safari', () => {
43
- jest.spyOn(global.navigator, 'userAgent', 'get').mockReturnValue('Safari');
44
- expect(isSafari()).toBe(true);
45
- });
46
- it('should return true if FairPlayDrm is supported', () => {
47
- ;
48
- window.WebKitMediaKeys = function () { };
49
- window.WebKitMediaKeys.isTypeSupported = () => true;
50
- jest.spyOn(global.navigator, 'userAgent', 'get').mockReturnValue('Chrome');
51
- expect(isSafari()).toBe(true);
52
- });
53
- it('should return false if the user agent is not Safari and FairPlayDrm is not supported', () => {
54
- ;
55
- window.WebKitMediaKeys = function () { };
56
- window.WebKitMediaKeys.isTypeSupported = () => false;
57
- jest.spyOn(global.navigator, 'userAgent', 'get').mockReturnValue('Safari Chrome IEMobile Edge Chromium Android');
58
- expect(isSafari()).toBe(false);
59
- });
60
- });
@@ -1 +0,0 @@
1
- export declare function logVersion(version: string): void;
@@ -1,26 +0,0 @@
1
- export function logVersion(version) {
2
- const ASCII_ART = `
3
- ╔▒▒╖
4
- _╔╠╠╠╠╠╠╠φ_
5
- _#╠╠╠╠╠╠╠╠╠╠╠#_
6
- ╓╔╠╠╠╠╝╝╠╠╠╠╠╠╠╠╠▒,
7
- ╔╬╠╠╠╠╠ '╚╠╠╠╠╠╠╠╠▒╖
8
- ╔╬╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╬╦
9
- _╓╠╠╠╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╖╖
10
- ╠╠╠╠╠╠╠╠╠╠╠╠ ╠╠╠╠╠╠╠╠▒
11
- ╬╠╠╠╠╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╝
12
- \`╝╠╠╠╠╠╠╠╠╠ _╔╠╠╠╠╠╠╠╠╠╩\`
13
- \`╚╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╠╠╩
14
- ╙╠╠╠╠╠▒╗φ╬╠╠╠╠╠╠╠╠╠╠╜
15
- ╙╬╠╠╠╠╠╠╠╠╠╠╠╠╠╠╙
16
- '╬╠╠╠╠╠╠╠╠╠╝^
17
- \`╝╠╠╠╠╠╩\`
18
- \`╙╙╙
19
- `;
20
- const COLOR_CODE = '#f56A00';
21
- const TITLE = 'NPO Player';
22
- const TITLE_STYLE = `font-size: 24px; font-weight: bold; color: ${COLOR_CODE}; padding: 2px 4px;`;
23
- const VERSION_STRING = 'v' + String(version);
24
- const VERSION_STYLE = 'font-size: 24px; font-weight: bold; padding: 2px 4px;';
25
- console.log(`%c${ASCII_ART}%c${TITLE} %c${VERSION_STRING}`, `color: ${COLOR_CODE}; background-color: rgb(11, 28, 54);`, TITLE_STYLE, VERSION_STYLE);
26
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- import { logVersion } from './utilities.version';
2
- describe('logVersion', () => {
3
- it('should print the current version', () => {
4
- const logSpy = jest.spyOn(console, 'log');
5
- logVersion('1.0.0');
6
- const ASCII_ART = `
7
- ╔▒▒╖
8
- _╔╠╠╠╠╠╠╠φ_
9
- _#╠╠╠╠╠╠╠╠╠╠╠#_
10
- ╓╔╠╠╠╠╝╝╠╠╠╠╠╠╠╠╠▒,
11
- ╔╬╠╠╠╠╠ '╚╠╠╠╠╠╠╠╠▒╖
12
- ╔╬╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╬╦
13
- _╓╠╠╠╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╖╖
14
- ╠╠╠╠╠╠╠╠╠╠╠╠ ╠╠╠╠╠╠╠╠▒
15
- ╬╠╠╠╠╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╝
16
- \`╝╠╠╠╠╠╠╠╠╠ _╔╠╠╠╠╠╠╠╠╠╩\`
17
- \`╚╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╠╠╩
18
- ╙╠╠╠╠╠▒╗φ╬╠╠╠╠╠╠╠╠╠╠╜
19
- ╙╬╠╠╠╠╠╠╠╠╠╠╠╠╠╠╙
20
- '╬╠╠╠╠╠╠╠╠╠╝^
21
- \`╝╠╠╠╠╠╩\`
22
- \`╙╙╙
23
- `;
24
- expect(logSpy).toHaveBeenCalledWith(`%c${ASCII_ART}%cNPO Player %cv1.0.0`, 'color: #f56A00; background-color: rgb(11, 28, 54);', 'font-size: 24px; font-weight: bold; color: #f56A00; padding: 2px 4px;', 'font-size: 24px; font-weight: bold; padding: 2px 4px;');
25
- });
26
- });