@npo/player 1.29.0 → 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 -232
  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,127 +0,0 @@
1
- import { processNicam, SHOW_NICAM_AFTER_UI_HIDE_DURATION, showNicamAfterUiDelay } from './nicamhandler';
2
- import '@testing-library/jest-dom';
3
- import { createMockNpoPlayer, createPlayerContextMock } from '../../../tests/mocks/playerContextMock';
4
- describe('NICAM Processing', () => {
5
- let mockElement;
6
- beforeEach(() => {
7
- mockElement = { innerHTML: '', appendChild: jest.fn() };
8
- document.querySelector = jest.fn().mockReturnValue(mockElement);
9
- });
10
- it('processes NICAM from the streamObject', () => {
11
- const mockElement = document.createElement('div');
12
- const npoPlayerMock = createMockNpoPlayer({
13
- streamObject: {
14
- metadata: {
15
- ageRating: '12',
16
- nicam: ['GEWELD', 'ANGST', 'DRUGS_EN_ALCOHOL', 'GROF_TAALGEBRUIK']
17
- }
18
- }
19
- });
20
- const playerContextMock = createPlayerContextMock({
21
- npoPlayer: npoPlayerMock
22
- });
23
- processNicam(playerContextMock, mockElement);
24
- expect(mockElement.children).toHaveLength(5);
25
- });
26
- it('processes NICAM and age rating with streamOptions taking priority', () => {
27
- const mockElement = document.createElement('div');
28
- const npoPlayerMock = createMockNpoPlayer({
29
- streamObject: {
30
- metadata: {
31
- ageRating: '12',
32
- nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
33
- }
34
- },
35
- streamOptions: {
36
- ageRating: '16',
37
- nicam: ['DRUGS_EN_ALCOHOL']
38
- }
39
- });
40
- const playerContextMock = createPlayerContextMock({
41
- npoPlayer: npoPlayerMock
42
- });
43
- processNicam(playerContextMock, mockElement);
44
- expect(mockElement.children).toHaveLength(2);
45
- });
46
- it('does nothing if no NICAM element found', () => {
47
- document.querySelector = jest.fn().mockReturnValue(undefined);
48
- const npoPlayerMock = createMockNpoPlayer({
49
- streamObject: {
50
- metadata: {
51
- ageRating: '12',
52
- nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
53
- }
54
- }
55
- });
56
- const playerContextMock = createPlayerContextMock({
57
- npoPlayer: npoPlayerMock
58
- });
59
- processNicam(playerContextMock, mockElement);
60
- });
61
- it('does nothing if no metadata and no streamOptions', () => {
62
- const npoPlayerMock = createMockNpoPlayer({});
63
- const playerContextMock = createPlayerContextMock({
64
- npoPlayer: npoPlayerMock
65
- });
66
- processNicam(playerContextMock, mockElement);
67
- expect(mockElement.appendChild).not.toHaveBeenCalled();
68
- });
69
- });
70
- describe('NICAM Visibility Management', () => {
71
- let mockPlayerContext;
72
- let mockContainer;
73
- let mockPlayer;
74
- let mockUiManager;
75
- beforeEach(() => {
76
- mockContainer = document.createElement('div');
77
- mockPlayer = {
78
- getNpoPlayerElement: jest.fn().mockReturnValue(mockContainer),
79
- off: jest.fn()
80
- };
81
- mockUiManager = {
82
- activeUi: {
83
- onControlsHide: {
84
- subscribe: jest.fn(),
85
- unsubscribe: jest.fn()
86
- },
87
- onControlsShow: {
88
- subscribe: jest.fn(),
89
- unsubscribe: jest.fn()
90
- }
91
- }
92
- };
93
- mockPlayerContext = createPlayerContextMock({
94
- player: mockPlayer,
95
- npoPlayer: {
96
- uiManager: mockUiManager,
97
- container: mockContainer
98
- }
99
- });
100
- });
101
- describe('showNicamAfterUiDelay', () => {
102
- it('should add showNicam class when controls are hidden', () => {
103
- jest.useFakeTimers();
104
- const showNicamClass = 'bmpui-show-nicam';
105
- showNicamAfterUiDelay(mockPlayerContext);
106
- mockUiManager.activeUi.onControlsHide.subscribe.mock.calls[0][0]();
107
- expect(mockContainer).toHaveClass(showNicamClass);
108
- jest.advanceTimersByTime(SHOW_NICAM_AFTER_UI_HIDE_DURATION);
109
- expect(mockContainer).not.toHaveClass(showNicamClass);
110
- jest.useRealTimers();
111
- });
112
- it('should remove showNicam class when controls are shown', () => {
113
- showNicamAfterUiDelay(mockPlayerContext);
114
- const showNicamClass = 'bmpui-show-nicam';
115
- mockUiManager.activeUi.onControlsHide.subscribe.mock.calls[0][0]();
116
- expect(mockContainer).toHaveClass(showNicamClass);
117
- mockUiManager.activeUi.onControlsShow.subscribe.mock.calls[0][0]();
118
- expect(mockContainer).not.toHaveClass(showNicamClass);
119
- });
120
- it('should not execute if player container or uiManager is undefined', () => {
121
- mockPlayerContext.npoPlayer.uiManager = undefined;
122
- showNicamAfterUiDelay(mockPlayerContext);
123
- expect(mockUiManager.activeUi.onControlsHide.subscribe).not.toHaveBeenCalled();
124
- expect(mockUiManager.activeUi.onControlsShow.subscribe).not.toHaveBeenCalled();
125
- });
126
- });
127
- });
@@ -1,25 +0,0 @@
1
- export declare const DEFAULT_UI_DELAY = 3000;
2
- export declare const PREVENT_UI_DELAY = -1;
3
- export declare const VOLUME_STEP = 10;
4
- export declare const VOLUME_MIN = 0;
5
- export declare const VOLUME_MAX = 100;
6
- export declare const emptyStreamObject: {
7
- stream: {
8
- drmType: string;
9
- streamProfile: string;
10
- streamURL: string;
11
- avType: string;
12
- sourceProfile: string;
13
- };
14
- metadata: {
15
- title: string;
16
- description: string;
17
- };
18
- assets: {
19
- scrubbingThumbnail: string;
20
- subtitles: never[];
21
- };
22
- user: {
23
- type: "anonymous" | "plus";
24
- };
25
- };
@@ -1,11 +0,0 @@
1
- export const DEFAULT_UI_DELAY = 3000;
2
- export const PREVENT_UI_DELAY = -1;
3
- export const VOLUME_STEP = 10;
4
- export const VOLUME_MIN = 0;
5
- export const VOLUME_MAX = 100;
6
- export const emptyStreamObject = {
7
- stream: { drmType: '', streamProfile: '', streamURL: '', avType: '', sourceProfile: '' },
8
- metadata: { title: '', description: '' },
9
- assets: { scrubbingThumbnail: '', subtitles: [] },
10
- user: { type: 'anonymous' }
11
- };
@@ -1,53 +0,0 @@
1
- import { PlayerAPI, PlayerConfig, SourceConfig, TimeMode, VideoQuality, ViewMode } from 'bitmovin-player/modules/bitmovinplayer-core';
2
- import { AdBreak, AdConfig } from 'bitmovin-player/modules/bitmovinplayer-advertising-core';
3
- import { SubtitleTrack } from 'bitmovin-player/modules/bitmovinplayer-subtitles';
4
- import { UIManager } from 'bitmovin-player-ui';
5
- import { NpoPlayerUIVariants, PlayerContext, Technology } from 'types/interfaces';
6
- import { NpoPlayerEventCallback, NpoPlayerEvent } from '../../types/events';
7
- export declare class NpoPlayerAPI {
8
- playerAPI: PlayerAPI;
9
- constructor(playerAPI: PlayerAPI);
10
- load(sourceConfig: SourceConfig): Promise<void>;
11
- unload(): Promise<void>;
12
- play(): Promise<void>;
13
- pause(): void;
14
- mute(): void;
15
- unmute(): void;
16
- getVolume(): number;
17
- setVolume(level: number): void;
18
- increaseVolume(): void;
19
- decreaseVolume(): void;
20
- setViewMode(viewMode: ViewMode): void;
21
- getViewMode(): ViewMode;
22
- areSubtitlesEnabled(): boolean;
23
- getCurrentSubtitle(): string | undefined;
24
- enableSubtitles(selectedLang?: string): void;
25
- isPaused(): boolean;
26
- isMuted(): boolean;
27
- isLive(): boolean;
28
- getSupportedDRM(): Promise<string[]>;
29
- getSupportedTech(): Technology[];
30
- off(eventType: NpoPlayerEvent, callback: NpoPlayerEventCallback): void;
31
- on(eventType: NpoPlayerEvent, callback: NpoPlayerEventCallback): void;
32
- isCastAvailable(): boolean;
33
- isCasting(): boolean;
34
- seek(time: number): void;
35
- timeShift(time: number): void;
36
- getContainer(): HTMLElement;
37
- getNpoPlayerElement(): Element | null;
38
- addClassToNpoPlayerElement(className: string): void | undefined;
39
- removeClassFromNpoPlayerElement(className: string): void | undefined;
40
- toggleClassOnNpoPlayerElement(className: string, toggle: boolean): void | undefined;
41
- getCurrentTime(mode?: TimeMode | undefined): number;
42
- getDuration(): number;
43
- getTimeShift(): number;
44
- scheduleAds(adConfig: AdConfig): Promise<AdBreak[]>;
45
- handleErrorRetry(playerContext: PlayerContext): Promise<void>;
46
- getActiveAdBreak(): AdBreak | null;
47
- getConfig(mergedConfig?: boolean): PlayerConfig;
48
- createUIManager(playerContext: PlayerContext, variant: NpoPlayerUIVariants): void | UIManager;
49
- getAvailableVideoQualities(): VideoQuality[];
50
- listSubtitles(): SubtitleTrack[];
51
- setPlaybackSpeed(speed: number): void;
52
- setVideoQuality(VideoQualityId: string): void;
53
- }
@@ -1,193 +0,0 @@
1
- import { UIManager } from 'bitmovin-player-ui';
2
- import { customSpecificErrorMessageOverlayConfig } from '../errors/errorText';
3
- import { createUIContainer } from '../../ui/uicontainer';
4
- import { playerEventMap } from '../../types/events';
5
- import { VOLUME_MAX, VOLUME_MIN, VOLUME_STEP } from './contants';
6
- import { localizationConfig } from '../../js/settings/localization';
7
- import { handleErrorRetry } from '../../services/errors/errorRetryHandler';
8
- const externalCallbacksMap = new WeakMap();
9
- export class NpoPlayerAPI {
10
- constructor(playerAPI) {
11
- this.playerAPI = playerAPI;
12
- }
13
- async load(sourceConfig) {
14
- await this.playerAPI.load(sourceConfig);
15
- }
16
- async unload() {
17
- await this.playerAPI.unload();
18
- }
19
- async play() {
20
- await this.playerAPI.play().catch((error) => {
21
- console.error('Playback error:', error);
22
- if (error.code === 1201) {
23
- console.error('No source was loaded. Please load a source before playing.');
24
- }
25
- else {
26
- console.error('An unexpected playback error occurred.');
27
- }
28
- });
29
- }
30
- pause() {
31
- this.playerAPI.pause();
32
- }
33
- mute() {
34
- this.playerAPI.mute();
35
- }
36
- unmute() {
37
- this.playerAPI.unmute();
38
- }
39
- getVolume() {
40
- return this.playerAPI.getVolume();
41
- }
42
- setVolume(level) {
43
- const volume = Math.max(VOLUME_MIN, Math.min(VOLUME_MAX, level));
44
- this.playerAPI.setVolume(volume);
45
- }
46
- increaseVolume() {
47
- const currentVolume = this.getVolume();
48
- this.setVolume(currentVolume + VOLUME_STEP);
49
- }
50
- decreaseVolume() {
51
- const currentVolume = this.getVolume();
52
- this.setVolume(currentVolume - VOLUME_STEP);
53
- }
54
- setViewMode(viewMode) {
55
- this.playerAPI.setViewMode(viewMode);
56
- }
57
- getViewMode() {
58
- return this.playerAPI.getViewMode();
59
- }
60
- areSubtitlesEnabled() {
61
- const subtitles = this.listSubtitles();
62
- return subtitles ? subtitles.some((subtitle) => subtitle.enabled) : false;
63
- }
64
- getCurrentSubtitle() {
65
- const subtitles = this.listSubtitles();
66
- const currentSubtitle = subtitles.find((subtitle) => subtitle.enabled);
67
- return currentSubtitle ? currentSubtitle.lang : undefined;
68
- }
69
- enableSubtitles(selectedLang = 'nl') {
70
- const subtitleTracks = this.listSubtitles();
71
- const subtitleToEnable = subtitleTracks.find((subtitle) => subtitle.lang === selectedLang);
72
- if (subtitleToEnable && !subtitleToEnable.enabled) {
73
- this.playerAPI.subtitles?.enable(subtitleToEnable.id);
74
- }
75
- }
76
- isPaused() {
77
- return this.playerAPI.isPaused();
78
- }
79
- isMuted() {
80
- return this.playerAPI.isMuted();
81
- }
82
- isLive() {
83
- return this.playerAPI.isLive();
84
- }
85
- async getSupportedDRM() {
86
- return await this.playerAPI.getSupportedDRM();
87
- }
88
- getSupportedTech() {
89
- return this.playerAPI.getSupportedTech();
90
- }
91
- off(eventType, callback) {
92
- const externalEventType = playerEventMap[eventType];
93
- const externalCallback = externalCallbacksMap.get(callback);
94
- if (externalCallback) {
95
- this.playerAPI.off(externalEventType, externalCallback);
96
- externalCallbacksMap.delete(callback);
97
- }
98
- }
99
- on(eventType, callback) {
100
- const externalEventType = playerEventMap[eventType];
101
- let externalCallback = externalCallbacksMap.get(callback);
102
- if (!externalCallback) {
103
- externalCallback = (args) => {
104
- callback(args);
105
- };
106
- externalCallbacksMap.set(callback, externalCallback);
107
- }
108
- this.playerAPI.on(externalEventType, externalCallback);
109
- }
110
- isCastAvailable() {
111
- return this.playerAPI.isCastAvailable();
112
- }
113
- isCasting() {
114
- return this.playerAPI.isCasting();
115
- }
116
- seek(time) {
117
- this.playerAPI.seek(time);
118
- }
119
- timeShift(time) {
120
- this.playerAPI.timeShift(time);
121
- }
122
- getContainer() {
123
- return this.playerAPI.getContainer();
124
- }
125
- getNpoPlayerElement() {
126
- return this.getContainer().querySelector('.bmpui-npo-player');
127
- }
128
- addClassToNpoPlayerElement(className) {
129
- this.getNpoPlayerElement()?.classList.add(className);
130
- }
131
- removeClassFromNpoPlayerElement(className) {
132
- this.getNpoPlayerElement()?.classList.remove(className);
133
- }
134
- toggleClassOnNpoPlayerElement(className, toggle) {
135
- this.getNpoPlayerElement()?.classList.toggle(className, toggle);
136
- }
137
- getCurrentTime(mode) {
138
- return this.playerAPI.getCurrentTime(mode);
139
- }
140
- getDuration() {
141
- return this.playerAPI.getDuration();
142
- }
143
- getTimeShift() {
144
- return this.playerAPI.getTimeShift();
145
- }
146
- async scheduleAds(adConfig) {
147
- return this.playerAPI.ads.schedule(adConfig);
148
- }
149
- async handleErrorRetry(playerContext) {
150
- return handleErrorRetry(playerContext);
151
- }
152
- getActiveAdBreak() {
153
- return this.playerAPI.ads.getActiveAdBreak();
154
- }
155
- getConfig(mergedConfig) {
156
- return this.playerAPI.getConfig(mergedConfig);
157
- }
158
- createUIManager(playerContext, variant) {
159
- const { npoPlayerServices } = playerContext.npoPlayer;
160
- if (playerContext.npoPlayer.uiManager === undefined || variant !== playerContext.npoPlayer.variant) {
161
- npoPlayerServices.removeUivisiblityHandlers(playerContext);
162
- const uiConfig = {
163
- errorMessages: customSpecificErrorMessageOverlayConfig,
164
- disableAutoHideWhenHovered: true,
165
- seekbarSnappingEnabled: false
166
- };
167
- npoPlayerServices.removeUivisiblityHandlers(playerContext);
168
- playerContext.npoPlayer.uiManager?.release();
169
- UIManager.setLocalizationConfig(localizationConfig);
170
- const uiContainer = createUIContainer(playerContext, variant);
171
- const uiManager = new UIManager(this.playerAPI, uiContainer, uiConfig);
172
- playerContext.npoPlayer.uiManager = uiManager;
173
- playerContext.npoPlayer.variant = variant;
174
- npoPlayerServices.addUivisiblityHandlers(playerContext);
175
- npoPlayerServices.setupNicamKijkwijzerIcons(playerContext);
176
- npoPlayerServices.showNicamAfterUiDelay(playerContext);
177
- npoPlayerServices.addDataInInfoPanel(playerContext);
178
- npoPlayerServices.handleBackButtons(playerContext);
179
- }
180
- }
181
- getAvailableVideoQualities() {
182
- return this.playerAPI.getAvailableVideoQualities();
183
- }
184
- listSubtitles() {
185
- return this.playerAPI.subtitles?.list() || [];
186
- }
187
- setPlaybackSpeed(speed) {
188
- this.playerAPI.setPlaybackSpeed(speed);
189
- }
190
- setVideoQuality(VideoQualityId) {
191
- this.playerAPI.setVideoQuality(VideoQualityId);
192
- }
193
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,127 +0,0 @@
1
- import { NpoPlayerAPI } from './npoPlayerAPI';
2
- import createPlayerContextMock from '../../../tests/mocks/playerContextMock';
3
- import { NpoPlayerEvent } from '../../types/events';
4
- describe('NpoPlayerAPI', () => {
5
- let mockPlayerAPI;
6
- let npoPlayerAPI;
7
- beforeEach(() => {
8
- mockPlayerAPI = {
9
- play: jest.fn(),
10
- pause: jest.fn(),
11
- mute: jest.fn(),
12
- unmute: jest.fn(),
13
- setViewMode: jest.fn(),
14
- getViewMode: jest.fn(),
15
- isPaused: jest.fn(),
16
- isMuted: jest.fn(),
17
- on: jest.fn(),
18
- off: jest.fn()
19
- };
20
- npoPlayerAPI = new NpoPlayerAPI(mockPlayerAPI);
21
- });
22
- it('should call play on the PlayerAPI', async () => {
23
- mockPlayerAPI.play.mockResolvedValueOnce(undefined);
24
- await npoPlayerAPI.play();
25
- expect(mockPlayerAPI.play).toHaveBeenCalled();
26
- });
27
- it('should handle error when play throws an error', async () => {
28
- const error = { code: 1201, message: 'No source loaded' };
29
- mockPlayerAPI.play.mockRejectedValueOnce(error);
30
- const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {
31
- });
32
- await npoPlayerAPI.play();
33
- expect(consoleErrorSpy).toHaveBeenCalledWith('Playback error:', error);
34
- expect(consoleErrorSpy).toHaveBeenCalledWith('No source was loaded. Please load a source before playing.');
35
- consoleErrorSpy.mockRestore();
36
- });
37
- it('should call pause on the PlayerAPI', () => {
38
- npoPlayerAPI.pause();
39
- expect(mockPlayerAPI.pause).toHaveBeenCalled();
40
- });
41
- it('should call mute on the PlayerAPI', () => {
42
- npoPlayerAPI.mute();
43
- expect(mockPlayerAPI.mute).toHaveBeenCalled();
44
- });
45
- it('should call unmute on the PlayerAPI', () => {
46
- npoPlayerAPI.unmute();
47
- expect(mockPlayerAPI.unmute).toHaveBeenCalled();
48
- });
49
- it('should call setViewMode on the PlayerAPI', () => {
50
- const viewMode = 'fullscreen';
51
- npoPlayerAPI.setViewMode(viewMode);
52
- expect(mockPlayerAPI.setViewMode).toHaveBeenCalledWith(viewMode);
53
- });
54
- it('should call getViewMode on the PlayerAPI', () => {
55
- npoPlayerAPI.getViewMode();
56
- expect(mockPlayerAPI.getViewMode).toHaveBeenCalled();
57
- });
58
- it('should call isPaused on the PlayerAPI', () => {
59
- npoPlayerAPI.isPaused();
60
- expect(mockPlayerAPI.isPaused).toHaveBeenCalled();
61
- });
62
- it('should call isMuted on the PlayerAPI', () => {
63
- npoPlayerAPI.isMuted();
64
- expect(mockPlayerAPI.isMuted).toHaveBeenCalled();
65
- });
66
- describe('NpoPlayerAPI Volume Control Tests', () => {
67
- let playerContextMock;
68
- beforeEach(() => {
69
- playerContextMock = createPlayerContextMock();
70
- playerContextMock.player.setVolume(50);
71
- });
72
- test('should set volume to a specific value', () => {
73
- playerContextMock.player.setVolume(30);
74
- expect(playerContextMock.player.getVolume()).toBe(30);
75
- });
76
- test('should not set volume above the maximum', () => {
77
- playerContextMock.player.setVolume(110);
78
- expect(playerContextMock.player.getVolume()).toBe(100);
79
- });
80
- test('should not set volume below the minimum', () => {
81
- playerContextMock.player.setVolume(-10);
82
- expect(playerContextMock.player.getVolume()).toBe(0);
83
- });
84
- test('should increase volume by 10', () => {
85
- playerContextMock.player.increaseVolume();
86
- expect(playerContextMock.player.getVolume()).toBe(60);
87
- });
88
- test('should not increase volume above the maximum', () => {
89
- playerContextMock.player.setVolume(95);
90
- playerContextMock.player.increaseVolume();
91
- expect(playerContextMock.player.getVolume()).toBe(100);
92
- });
93
- test('should decrease volume by 10', () => {
94
- playerContextMock.player.decreaseVolume();
95
- expect(playerContextMock.player.getVolume()).toBe(40);
96
- });
97
- test('should not decrease volume below the minimum', () => {
98
- playerContextMock.player.setVolume(5);
99
- playerContextMock.player.decreaseVolume();
100
- expect(playerContextMock.player.getVolume()).toBe(0);
101
- });
102
- });
103
- describe('Event handling', () => {
104
- it('should add an event listener', () => {
105
- const eventType = NpoPlayerEvent.TimeChanged;
106
- const callback = jest.fn();
107
- npoPlayerAPI.on(eventType, callback);
108
- expect(mockPlayerAPI.on).toHaveBeenCalledWith(expect.any(String), expect.any(Function));
109
- });
110
- it('should remove an event listener', () => {
111
- const eventType = NpoPlayerEvent.TimeChanged;
112
- const callback = jest.fn();
113
- npoPlayerAPI.on(eventType, callback);
114
- npoPlayerAPI.off(eventType, callback);
115
- expect(mockPlayerAPI.off).toHaveBeenCalledWith(expect.any(String), expect.any(Function));
116
- });
117
- it('should trigger the correct callback when event is emitted', () => {
118
- const eventType = NpoPlayerEvent.TimeChanged;
119
- const callback = jest.fn();
120
- const mockArgs = { time: 123 };
121
- npoPlayerAPI.on(eventType, callback);
122
- const externalCallback = mockPlayerAPI.on.mock.calls[0][1];
123
- externalCallback(mockArgs);
124
- expect(callback).toHaveBeenCalledWith(mockArgs);
125
- });
126
- });
127
- });
@@ -1 +0,0 @@
1
- export declare const playerModules: any[];
@@ -1,48 +0,0 @@
1
- import EngineBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-engine-bitmovin';
2
- import EngineNativeModule from 'bitmovin-player/modules/bitmovinplayer-engine-native';
3
- import MseRendererModule from 'bitmovin-player/modules/bitmovinplayer-mserenderer';
4
- import DashModule from 'bitmovin-player/modules/bitmovinplayer-dash';
5
- import ContainerMP4 from 'bitmovin-player/modules/bitmovinplayer-container-mp4';
6
- import ContainerTS from 'bitmovin-player/modules/bitmovinplayer-container-ts';
7
- import AbrModule from 'bitmovin-player/modules/bitmovinplayer-abr';
8
- import DrmModule from 'bitmovin-player/modules/bitmovinplayer-drm';
9
- import XmlModule from 'bitmovin-player/modules/bitmovinplayer-xml';
10
- import Subtitles from 'bitmovin-player/modules/bitmovinplayer-subtitles';
11
- import SubtitlesWebVTT from 'bitmovin-player/modules/bitmovinplayer-subtitles-vtt';
12
- import SubtitlesCEA608 from 'bitmovin-player/modules/bitmovinplayer-subtitles-cea608';
13
- import SubtitlesTTML from 'bitmovin-player/modules/bitmovinplayer-subtitles-ttml';
14
- import SubtitlesNative from 'bitmovin-player/modules/bitmovinplayer-subtitles-native';
15
- import AdvertisingCoreModule from 'bitmovin-player/modules/bitmovinplayer-advertising-core';
16
- import AdvertisingBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-advertising-bitmovin';
17
- import AnalyticsModule from 'bitmovin-player/modules/bitmovinplayer-analytics';
18
- import HlsModule from 'bitmovin-player/modules/bitmovinplayer-hls';
19
- import StyleModule from 'bitmovin-player/modules/bitmovinplayer-style';
20
- import CryptoModule from 'bitmovin-player/modules/bitmovinplayer-crypto';
21
- import PatchModule from 'bitmovin-player/modules/bitmovinplayer-patch';
22
- import ThumbnailModule from 'bitmovin-player/modules/bitmovinplayer-thumbnail';
23
- import RemoteControlModule from 'bitmovin-player/modules/bitmovinplayer-remotecontrol';
24
- export const playerModules = [
25
- EngineBitmovinModule,
26
- EngineNativeModule,
27
- XmlModule,
28
- MseRendererModule,
29
- AbrModule,
30
- HlsModule,
31
- DrmModule,
32
- DashModule,
33
- ContainerMP4,
34
- ContainerTS,
35
- CryptoModule,
36
- PatchModule,
37
- Subtitles,
38
- SubtitlesCEA608,
39
- SubtitlesWebVTT,
40
- SubtitlesTTML,
41
- SubtitlesNative,
42
- StyleModule,
43
- AdvertisingCoreModule,
44
- AdvertisingBitmovinModule,
45
- AnalyticsModule,
46
- ThumbnailModule,
47
- RemoteControlModule
48
- ];
@@ -1,2 +0,0 @@
1
- import { PlayerContext } from '../../types/interfaces';
2
- export declare function handlePreferences(playerContext: PlayerContext): void;
@@ -1,47 +0,0 @@
1
- import { NpoPlayerEvent } from '../../types/events';
2
- import { LocalStorageValues } from '../../types/interfaces';
3
- export function handlePreferences(playerContext) {
4
- const { player, npoPlayer } = playerContext;
5
- const { npoPlayerServices } = npoPlayer;
6
- const handleReady = () => {
7
- const storedUserPrefs = npoPlayerServices.getStoredUserPrefs();
8
- const subtitlesEnabledInPrefs = storedUserPrefs?.subtitles_enabled === 'true';
9
- const preferredSubtitleLang = storedUserPrefs?.subtitles_language?.toString();
10
- const shouldEnableSubtitles = npoPlayer.streamOptions.enableSubtitles || subtitlesEnabledInPrefs;
11
- if (shouldEnableSubtitles) {
12
- player.enableSubtitles(preferredSubtitleLang);
13
- }
14
- };
15
- const handleSubtitleEnabled = () => {
16
- const subtitlesList = player.listSubtitles();
17
- const enabledSubtitle = subtitlesList.find((subtitle) => subtitle.enabled);
18
- if (enabledSubtitle) {
19
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_LANGUAGE, enabledSubtitle.lang);
20
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_ENABLED, 'true');
21
- }
22
- };
23
- const handleSubtitleDisabled = () => {
24
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_ENABLED, 'false');
25
- };
26
- const handleVolumeChanged = () => {
27
- const volume = player.getVolume();
28
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.VOLUME, volume);
29
- };
30
- const handleMuted = () => {
31
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.IS_MUTED, 'true');
32
- const volume = player.getVolume();
33
- if (volume === 0) {
34
- player.setVolume(100);
35
- player.mute();
36
- }
37
- };
38
- const handleUnmuted = () => {
39
- npoPlayerServices.setStoredUserPrefs(LocalStorageValues.IS_MUTED, 'false');
40
- };
41
- player.on(NpoPlayerEvent.Ready, handleReady);
42
- player.on(NpoPlayerEvent.SubtitleEnabled, handleSubtitleEnabled);
43
- player.on(NpoPlayerEvent.SubtitleDisabled, handleSubtitleDisabled);
44
- player.on(NpoPlayerEvent.VolumeChanged, handleVolumeChanged);
45
- player.on(NpoPlayerEvent.Muted, handleMuted);
46
- player.on(NpoPlayerEvent.Unmuted, handleUnmuted);
47
- }
@@ -1 +0,0 @@
1
- export {};