@npo/player 1.27.7 → 1.28.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 (214) hide show
  1. package/README.md +4 -7
  2. package/lib/js/markers/updateLiveMarkers.d.ts +7 -2
  3. package/lib/js/markers/updateLiveMarkers.js +11 -4
  4. package/lib/js/markers/updateLiveMarkers.test.js +13 -3
  5. package/lib/js/playeractions/handlers/handleoffsets.test.js +1 -1
  6. package/lib/js/playeractions/handlers/mediasessionactions.d.ts +7 -2
  7. package/lib/js/playeractions/handlers/mediasessionactions.js +7 -7
  8. package/lib/js/playeractions/handlers/processplayerconfig.d.ts +1 -1
  9. package/lib/js/playeractions/handlers/processplayerconfig.js +1 -1
  10. package/lib/js/playeractions/handlers/processplayerconfig.test.js +1 -1
  11. package/lib/js/playeractions/handlers/processsourceconfig.d.ts +11 -2
  12. package/lib/js/playeractions/handlers/processsourceconfig.js +35 -18
  13. package/lib/js/playeractions/handlers/removereplayclass.d.ts +1 -1
  14. package/lib/js/playeractions/handlers/removereplayclass.js +1 -1
  15. package/lib/js/playeractions/handlers/removereplayclass.test.js +1 -1
  16. package/lib/js/settings/localization.d.ts +1 -0
  17. package/lib/js/utilities/utilities.jwt.d.ts +2 -0
  18. package/lib/js/utilities/utilities.jwt.js +22 -0
  19. package/lib/js/utilities/utilities.stream.js +11 -2
  20. package/lib/js/utilities/utilities.url.js +2 -2
  21. package/lib/js/utilities/utilities.version.js +1 -1
  22. package/lib/js/utilities/utilities.version.test.js +1 -1
  23. package/lib/lang/nl.json +2 -1
  24. package/lib/npoplayer.d.ts +6 -5
  25. package/lib/npoplayer.js +81 -28
  26. package/lib/package.json +7 -9
  27. package/lib/services/a11y/setup.test.js +2 -4
  28. package/lib/services/advertHandlers/handlePreRolls.js +3 -4
  29. package/lib/services/advertHandlers/handlePrerolls.test.js +2 -3
  30. package/lib/services/chapterHandlers/chapterHandler.d.ts +35 -0
  31. package/lib/services/chapterHandlers/chapterHandler.js +230 -0
  32. package/lib/services/errors/errorBackground.test.js +1 -1
  33. package/lib/services/errors/errorHandler.d.ts +4 -2
  34. package/lib/services/errors/errorHandler.js +27 -14
  35. package/lib/services/errors/errorHandler.test.js +148 -0
  36. package/lib/services/errors/errorRetryHandler.d.ts +2 -0
  37. package/lib/services/errors/errorRetryHandler.js +14 -0
  38. package/lib/services/errors/errorRetryHandler.test.d.ts +1 -0
  39. package/lib/services/errors/errorRetryHandler.test.js +62 -0
  40. package/lib/services/errors/errorText.js +8 -5
  41. package/lib/services/errors/errorText.test.js +3 -3
  42. package/lib/services/infoPanel/infoPanel.d.ts +3 -0
  43. package/lib/services/infoPanel/infoPanel.js +35 -0
  44. package/lib/services/infoPanel/infoPanel.test.d.ts +1 -0
  45. package/lib/services/infoPanel/infoPanel.test.js +70 -0
  46. package/lib/services/keyboardHandlers/resolvekeypress.js +11 -1
  47. package/lib/services/keyboardHandlers/resolvekeypress.test.js +6 -2
  48. package/lib/services/nicamHandlers/nicamhandler.d.ts +1 -0
  49. package/lib/services/nicamHandlers/nicamhandler.js +2 -1
  50. package/lib/services/nicamHandlers/nicamhandler.test.js +2 -2
  51. package/lib/services/npoPlayerAPI/npoPlayerAPI.d.ts +8 -2
  52. package/lib/services/npoPlayerAPI/npoPlayerAPI.js +25 -12
  53. package/lib/services/npoPlayerAPI/playerModules.d.ts +1 -0
  54. package/lib/services/npoPlayerAPI/playerModules.js +46 -0
  55. package/lib/services/preferences/handlePreferences.js +9 -4
  56. package/lib/services/preferences/handlePreferences.test.js +53 -17
  57. package/lib/services/segmentHandlers/addSegmentEventListeners.test.js +1 -1
  58. package/lib/services/segmentHandlers/isSegmentInBounds.d.ts +2 -0
  59. package/lib/services/segmentHandlers/isSegmentInBounds.js +5 -0
  60. package/lib/services/segmentHandlers/isSegmentInBounds.test.d.ts +1 -0
  61. package/lib/services/segmentHandlers/isSegmentInBounds.test.js +27 -0
  62. package/lib/services/services.d.ts +5 -2
  63. package/lib/services/services.js +15 -2
  64. package/lib/services/streamFetchHandler/fetchStream.js +5 -4
  65. package/lib/services/streamFetchHandler/fetchstream.test.js +25 -3
  66. package/lib/services/streamoptionsHandlers/streamOptionsHandler.js +11 -9
  67. package/lib/services/streamoptionsHandlers/streamOptionsHandler.test.js +14 -2
  68. package/lib/services/trackingHandlers/eventBinding.js +48 -33
  69. package/lib/services/trackingHandlers/eventBinding.test.js +57 -1
  70. package/lib/services/trackingHandlers/playerTrackerStart.js +1 -1
  71. package/lib/services/uiHandlers/uiVisiblityHandler.js +6 -0
  72. package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.test.js +0 -9
  73. package/lib/src/js/markers/updateLiveMarkers.d.ts +7 -2
  74. package/lib/src/js/playeractions/handlers/mediasessionactions.d.ts +7 -2
  75. package/lib/src/js/playeractions/handlers/processplayerconfig.d.ts +1 -1
  76. package/lib/src/js/playeractions/handlers/processsourceconfig.d.ts +11 -2
  77. package/lib/src/js/playeractions/handlers/removereplayclass.d.ts +1 -1
  78. package/lib/src/js/settings/localization.d.ts +1 -0
  79. package/lib/src/js/utilities/utilities.jwt.d.ts +2 -0
  80. package/lib/src/npoplayer.d.ts +6 -5
  81. package/lib/src/services/chapterHandlers/chapterHandler.d.ts +35 -0
  82. package/lib/src/services/errors/errorHandler.d.ts +4 -2
  83. package/lib/src/services/errors/errorRetryHandler.d.ts +2 -0
  84. package/lib/src/services/errors/errorRetryHandler.test.d.ts +1 -0
  85. package/lib/src/services/infoPanel/infoPanel.d.ts +3 -0
  86. package/lib/src/services/infoPanel/infoPanel.test.d.ts +1 -0
  87. package/lib/src/services/nicamHandlers/nicamhandler.d.ts +1 -0
  88. package/lib/src/services/npoPlayerAPI/npoPlayerAPI.d.ts +8 -2
  89. package/lib/src/services/npoPlayerAPI/playerModules.d.ts +1 -0
  90. package/lib/src/services/segmentHandlers/isSegmentInBounds.d.ts +2 -0
  91. package/lib/src/services/segmentHandlers/isSegmentInBounds.test.d.ts +1 -0
  92. package/lib/src/services/services.d.ts +5 -2
  93. package/lib/src/types/events.d.ts +1 -1
  94. package/lib/src/types/interfaces.d.ts +39 -43
  95. package/lib/src/ui/components/adbutton.d.ts +3 -6
  96. package/lib/src/ui/components/adlabel.d.ts +3 -6
  97. package/lib/src/ui/components/audio/controlbar.d.ts +2 -2
  98. package/lib/src/ui/components/buttons.d.ts +18 -11
  99. package/lib/src/ui/components/ctabar.d.ts +4 -10
  100. package/lib/src/ui/components/infopanel/infopanel.d.ts +3 -0
  101. package/lib/src/ui/components/infopanel/togglebutton.d.ts +3 -0
  102. package/lib/src/ui/components/playnext.d.ts +3 -9
  103. package/lib/src/ui/components/seekbar.d.ts +2 -3
  104. package/lib/src/ui/components/settingspanel.d.ts +2 -3
  105. package/lib/src/ui/components/titlebar.d.ts +2 -2
  106. package/lib/src/ui/handlers/domhandlers.d.ts +2 -2
  107. package/lib/src/ui/handlers/listboxhandlers.d.ts +18 -4
  108. package/lib/src/ui/handlers/playnextscreen.d.ts +6 -2
  109. package/lib/src/ui/uicontainer.d.ts +1 -2
  110. package/lib/tests/jest.setup-files-after-env.d.ts +0 -0
  111. package/lib/tests/jest.setup-files-after-env.js +6 -0
  112. package/lib/tests/jest.setup-tests.d.ts +1 -0
  113. package/lib/tests/jest.setup-tests.js +2 -0
  114. package/lib/tests/mocks/mockNpoplayer.js +27 -44
  115. package/lib/tests/mocks/mockPlayerAPI.d.ts +1 -1
  116. package/lib/tests/mocks/mockPlayerAPI.js +15 -1
  117. package/lib/tests/mocks/mockPlayerUi.d.ts +64 -0
  118. package/lib/tests/mocks/mockPlayerUi.js +251 -0
  119. package/lib/tests/mocks/playerContextMock.d.ts +3 -66
  120. package/lib/tests/mocks/playerContextMock.js +34 -7
  121. package/lib/types/events.d.ts +1 -1
  122. package/lib/types/events.js +1 -1
  123. package/lib/types/interfaces.d.ts +39 -43
  124. package/lib/types/interfaces.js +0 -27
  125. package/lib/ui/components/adbutton.d.ts +3 -6
  126. package/lib/ui/components/adbutton.js +2 -1
  127. package/lib/ui/components/adlabel.d.ts +3 -6
  128. package/lib/ui/components/adlabel.js +2 -1
  129. package/lib/ui/components/audio/controlbar.d.ts +2 -2
  130. package/lib/ui/components/audio/controlbar.js +6 -6
  131. package/lib/ui/components/buttons.d.ts +18 -11
  132. package/lib/ui/components/buttons.js +44 -26
  133. package/lib/ui/components/controlbar.js +13 -9
  134. package/lib/ui/components/ctabar.d.ts +4 -10
  135. package/lib/ui/components/ctabar.js +8 -7
  136. package/lib/ui/components/infopanel/infopanel.d.ts +3 -0
  137. package/lib/ui/components/infopanel/infopanel.js +40 -0
  138. package/lib/ui/components/infopanel/togglebutton.d.ts +3 -0
  139. package/lib/ui/components/infopanel/togglebutton.js +18 -0
  140. package/lib/ui/components/playnext.d.ts +3 -9
  141. package/lib/ui/components/playnext.js +3 -3
  142. package/lib/ui/components/seekbar.d.ts +2 -3
  143. package/lib/ui/components/seekbar.js +7 -3
  144. package/lib/ui/components/settingspanel.d.ts +2 -3
  145. package/lib/ui/components/settingspanel.js +79 -53
  146. package/lib/ui/components/titlebar.d.ts +2 -2
  147. package/lib/ui/components/titlebar.js +2 -1
  148. package/lib/ui/components/topbar.js +8 -5
  149. package/lib/ui/components/verticalvideo/controlbar.js +5 -2
  150. package/lib/ui/components/verticalvideo/settingspanel.js +9 -5
  151. package/lib/ui/handlers/accessibilityhandler.js +11 -22
  152. package/lib/ui/handlers/accessibilityhandler.test.js +25 -34
  153. package/lib/ui/handlers/domhandlers.d.ts +2 -2
  154. package/lib/ui/handlers/listboxhandlers.d.ts +18 -4
  155. package/lib/ui/handlers/listboxhandlers.js +5 -3
  156. package/lib/ui/handlers/playnextscreen.d.ts +6 -2
  157. package/lib/ui/handlers/playnextscreen.js +4 -4
  158. package/lib/ui/handlers/playnextscreen.test.js +15 -3
  159. package/lib/ui/uicontainer.d.ts +1 -2
  160. package/lib/ui/uicontainer.js +24 -8
  161. package/lib/ui/uicontainer.test.js +6 -5
  162. package/package.json +7 -9
  163. package/src/style/components/_advert.scss +0 -4
  164. package/src/style/components/_buffering.scss +18 -22
  165. package/src/style/components/_controlbars.scss +0 -4
  166. package/src/style/components/_icons.scss +18 -4
  167. package/src/style/components/_infopanel.scss +99 -0
  168. package/src/style/components/_nicam.scss +6 -2
  169. package/src/style/components/_seekbarthumbnail.scss +5 -0
  170. package/src/style/components/_settingspanel.scss +1 -1
  171. package/src/style/components/_subtitles.scss +0 -1
  172. package/src/style/components/_textbuttons.scss +30 -1
  173. package/src/style/components/_volumeslider.scss +0 -1
  174. package/src/style/components/audio/_bottombar.scss +6 -0
  175. package/src/style/components/audio/_metadata.scss +25 -9
  176. package/src/style/components/audio/_topbar.scss +6 -1
  177. package/src/style/npoplayer.css +166 -83
  178. package/src/style/npoplayer.scss +10 -2
  179. package/src/style/variants/_player-audio-only.scss +32 -0
  180. package/src/style/variants/_player-base.scss +5 -1
  181. package/src/style/variants/_player-large.scss +3 -3
  182. package/src/style/variants/_player-medium.scss +5 -1
  183. package/src/style/variants/_player-small.scss +6 -1
  184. package/src/style/vars/_colors.scss +1 -1
  185. package/src/style/vars/_icons.scss +5 -4
  186. package/src/style/vars/_z-index.scss +1 -1
  187. package/lib/npoplayer-bridge.test.js +0 -24
  188. package/lib/src/ui/components/nativemobile/buttons.d.ts +0 -30
  189. package/lib/src/ui/components/nativemobile/controlbar.d.ts +0 -3
  190. package/lib/src/ui/components/nativemobile/ctabar.d.ts +0 -11
  191. package/lib/src/ui/components/nativemobile/titlebar.d.ts +0 -2
  192. package/lib/src/ui/components/nativemobile/topbar.d.ts +0 -3
  193. package/lib/src/ui/nativemobileuicontainer.d.ts +0 -5
  194. package/lib/src/ui/nativemobileuifactory.d.ts +0 -3
  195. package/lib/src/ui/nativemobileuifactory.test.d.ts +0 -1
  196. package/lib/ui/components/nativemobile/buttons.d.ts +0 -30
  197. package/lib/ui/components/nativemobile/buttons.js +0 -233
  198. package/lib/ui/components/nativemobile/controlbar.d.ts +0 -3
  199. package/lib/ui/components/nativemobile/controlbar.js +0 -43
  200. package/lib/ui/components/nativemobile/ctabar.d.ts +0 -11
  201. package/lib/ui/components/nativemobile/ctabar.js +0 -10
  202. package/lib/ui/components/nativemobile/titlebar.d.ts +0 -2
  203. package/lib/ui/components/nativemobile/titlebar.js +0 -7
  204. package/lib/ui/components/nativemobile/topbar.d.ts +0 -3
  205. package/lib/ui/components/nativemobile/topbar.js +0 -23
  206. package/lib/ui/nativemobileuicontainer.d.ts +0 -5
  207. package/lib/ui/nativemobileuicontainer.js +0 -42
  208. package/lib/ui/nativemobileuifactory.d.ts +0 -3
  209. package/lib/ui/nativemobileuifactory.js +0 -112
  210. package/lib/ui/nativemobileuifactory.test.d.ts +0 -1
  211. package/lib/ui/nativemobileuifactory.test.js +0 -64
  212. package/src/style/variants/_player-native-mobile.scss +0 -13
  213. /package/lib/{npoplayer-bridge.test.d.ts → services/errors/errorHandler.test.d.ts} +0 -0
  214. /package/lib/src/{npoplayer-bridge.test.d.ts → services/errors/errorHandler.test.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  import { ControlBar } from 'bitmovin-player-ui';
2
- import type NpoPlayer from '../../../npoplayer';
3
- export declare function createAudioControlBar(npoPlayer: NpoPlayer): ControlBar;
2
+ import { PlayerContext } from '../../../types/interfaces';
3
+ export declare function createAudioControlBar(playerContext: PlayerContext): ControlBar;
@@ -1,8 +1,10 @@
1
- import { type PlayerAPI } from 'bitmovin-player';
2
- import { Button, ControlBar, CastToggleButton } from 'bitmovin-player-ui';
3
- import type NpoPlayer from '../../npoplayer';
4
- import { PlayerContext } from '../../types/interfaces';
5
- import { NpoPlayerAPI } from '../../services/npoPlayerAPI/npoPlayerAPI';
1
+ import { Button, ControlBar, CastToggleButton, Container } from 'bitmovin-player-ui';
2
+ import { ContainerConfig } from 'bitmovin-player-ui/dist/js/framework/components/container';
3
+ import { PlayerContext, CreateButtonConfig } from '../../types/interfaces';
4
+ export declare function createButton(playerContext: PlayerContext, config: CreateButtonConfig): Button<{
5
+ cssClass: string;
6
+ ariaLabel: string;
7
+ }>;
6
8
  export declare function createMiddleButtons(playerContext: PlayerContext): ControlBar;
7
9
  export declare function createRewindButton(playerContext: PlayerContext): Button<{
8
10
  cssClass: string;
@@ -12,24 +14,29 @@ export declare function createForwardButton(playerContext: PlayerContext): Butto
12
14
  cssClass: string;
13
15
  ariaLabel: string;
14
16
  }>;
15
- export declare function createPlayNextButton(player: PlayerAPI, npoPlayer: NpoPlayer): Button<{
17
+ export declare function createPlayNextButton(playerContext: PlayerContext): Button<{
16
18
  cssClass: string;
17
19
  ariaLabel: string;
18
20
  }>;
19
- export declare function createCancelPlayNextButton(player: PlayerAPI, npoPlayer: NpoPlayer): Button<{
21
+ export declare function createCancelPlayNextButton(playerContext: PlayerContext): Button<{
20
22
  cssClass: string;
21
23
  ariaLabel: string;
22
24
  }>;
23
- export declare function createskipIntroButton(player: PlayerAPI): Button<{
25
+ export declare function createGoBackLiveButton(playerContext: PlayerContext): Button<{
24
26
  cssClass: string;
25
27
  ariaLabel: string;
26
28
  }>;
27
- export declare function createGoBackLiveButton(player: PlayerAPI): Button<{
29
+ export declare function createWatchFromStartButton(playerContext: PlayerContext): Button<{
28
30
  cssClass: string;
29
31
  ariaLabel: string;
30
32
  }>;
31
- export declare function createWatchFromStartButton(player: PlayerAPI, npoPlayer: NpoPlayer): Button<{
33
+ export declare function createSkipChapterButton(playerContext: PlayerContext): Button<{
32
34
  cssClass: string;
33
35
  ariaLabel: string;
34
36
  }>;
35
- export declare function createChromecastButton(player: NpoPlayerAPI, npoPlayer: NpoPlayer): CastToggleButton;
37
+ export declare function createChromecastButton(playerContext: PlayerContext): CastToggleButton;
38
+ export interface ButtonOverlayConfig {
39
+ buttons: CreateButtonConfig[];
40
+ cssClasses?: string[];
41
+ }
42
+ export declare function createButtonOverlay(playerContext: PlayerContext, config: ButtonOverlayConfig): Container<ContainerConfig>;
@@ -1,10 +1,4 @@
1
- import { Button, Container, Label } from 'bitmovin-player-ui';
2
- import type NpoPlayer from '../../npoplayer';
3
- import { type PlayerAPI } from 'bitmovin-player';
4
- import { ButtonConfig } from 'bitmovin-player-ui/dist/js/framework/components/button';
5
- import { LabelConfig } from 'bitmovin-player-ui/dist/js/framework/components/label';
6
- import { NpoPlayerUIVariants } from '../../types/interfaces';
7
- export declare function createCTABar(player: PlayerAPI, npoPlayer: NpoPlayer, variant: NpoPlayerUIVariants): Container<{
8
- components: (Button<ButtonConfig> | Label<LabelConfig>)[];
9
- cssClasses: string[];
10
- }>;
1
+ import { Container } from 'bitmovin-player-ui';
2
+ import { ContainerConfig } from 'bitmovin-player-ui/dist/js/framework/components/container';
3
+ import { NpoPlayerUIVariants, PlayerContext } from '../../types/interfaces';
4
+ export declare function createCTABar(playerContext: PlayerContext, variant: NpoPlayerUIVariants): Container<ContainerConfig>;
@@ -0,0 +1,3 @@
1
+ import { Container, ContainerConfig } from 'bitmovin-player-ui';
2
+ import { PlayerContext } from '../../../types/interfaces';
3
+ export declare function createInfoPanel(playerContext: PlayerContext): Container<ContainerConfig>;
@@ -0,0 +1,3 @@
1
+ import { ToggleButton, ToggleButtonConfig } from 'bitmovin-player-ui';
2
+ import { PlayerContext } from 'types/interfaces';
3
+ export declare function createInfoPanelToggleButton(playerContext: PlayerContext): ToggleButton<ToggleButtonConfig>;
@@ -1,10 +1,4 @@
1
1
  import { Container } from 'bitmovin-player-ui';
2
- import { type PlayerAPI } from 'bitmovin-player';
3
- import type NpoPlayer from '../../npoplayer';
4
- export declare function createPlayNextScreen(player: PlayerAPI, npoPlayer: NpoPlayer): Container<{
5
- components: import("bitmovin-player-ui").Button<{
6
- cssClass: string;
7
- ariaLabel: string;
8
- }>[];
9
- cssClasses: string[];
10
- }>;
2
+ import { ContainerConfig } from 'bitmovin-player-ui/dist/js/framework/components/container';
3
+ import { PlayerContext } from '../../types/interfaces';
4
+ export declare function createPlayNextScreen(playerContext: PlayerContext): Container<ContainerConfig>;
@@ -1,7 +1,6 @@
1
1
  import { Container, PlaybackTimeLabel, SeekBar } from 'bitmovin-player-ui';
2
- import type NpoPlayer from '../../npoplayer';
3
- import { NpoPlayerUIVariants } from '../../npoplayer';
4
- export declare function createSeekBar(npoPlayer: NpoPlayer, variant: NpoPlayerUIVariants): Container<{
2
+ import { NpoPlayerUIVariants, PlayerContext } from '../../types/interfaces';
3
+ export declare function createSeekBar(playerContext: PlayerContext, variant: NpoPlayerUIVariants): Container<{
5
4
  components: (SeekBar | PlaybackTimeLabel)[];
6
5
  cssClasses: string[];
7
6
  }>;
@@ -1,4 +1,3 @@
1
1
  import { SettingsPanel } from 'bitmovin-player-ui';
2
- import type NpoPlayer from '../../npoplayer';
3
- import { PlayerAPI } from 'bitmovin-player';
4
- export declare function createSettingsPanel(npoPlayer: NpoPlayer | PlayerAPI): SettingsPanel;
2
+ import { PlayerContext } from '../../types/interfaces';
3
+ export declare function createSettingsPanel(playerContext: PlayerContext): SettingsPanel;
@@ -1,3 +1,3 @@
1
1
  import { TitleBar } from 'bitmovin-player-ui';
2
- import type NpoPlayer from '../../npoplayer';
3
- export declare function createTitleBar(npoPlayer: NpoPlayer): TitleBar;
2
+ import { PlayerContext } from '../../types/interfaces';
3
+ export declare function createTitleBar(playerContext: PlayerContext): TitleBar;
@@ -1,3 +1,3 @@
1
- import { StreamObject } from 'types/interfaces';
2
- import { PlayerAPI } from 'bitmovin-player';
1
+ import { StreamObject } from '../../types/interfaces';
2
+ import { PlayerAPI } from 'bitmovin-player/modules/bitmovinplayer-core';
3
3
  export declare function handleLiveStreamNoDvr(player: PlayerAPI, streamObject: StreamObject): void;
@@ -1,5 +1,19 @@
1
- import { type PlayerAPI } from 'bitmovin-player';
2
1
  import { type SettingsPanel, type SettingsPanelPage, type SettingsPanelPageOpenButton } from 'bitmovin-player-ui';
3
- export declare function handleSubtitleListBoxItemSelected(subtitleSettingsOpenButton: SettingsPanelPageOpenButton, settingsPanel: SettingsPanel, mainSettingsPage: SettingsPanelPage): (e: any) => void;
4
- export declare function handleSpeedListBoxItemSelected(player: PlayerAPI, speedSettingsOpenButton: SettingsPanelPageOpenButton, settingsPanel: SettingsPanel, mainSettingsPage: SettingsPanelPage): (source: any, args: any) => void;
5
- export declare function handleQualityListBoxItemSelected(player: PlayerAPI, qualitySettingsOpenButton: SettingsPanelPageOpenButton, settingsPanel: SettingsPanel, mainSettingsPage: SettingsPanelPage): (source: any, args: any) => void;
2
+ import { PlayerContext } from 'types/interfaces';
3
+ export declare function handleSubtitleListBoxItemSelected({ subtitleSettingsOpenButton, settingsPanel, mainSettingsPage }: {
4
+ subtitleSettingsOpenButton: SettingsPanelPageOpenButton;
5
+ settingsPanel: SettingsPanel;
6
+ mainSettingsPage: SettingsPanelPage;
7
+ }): (e: any) => void;
8
+ export declare function handleSpeedListBoxItemSelected({ playerContext, speedSettingsOpenButton, settingsPanel, mainSettingsPage }: {
9
+ playerContext: PlayerContext;
10
+ speedSettingsOpenButton: SettingsPanelPageOpenButton;
11
+ settingsPanel: SettingsPanel;
12
+ mainSettingsPage: SettingsPanelPage;
13
+ }): (source: any, args: any) => void;
14
+ export declare function handleQualityListBoxItemSelected({ playerContext, qualitySettingsOpenButton, settingsPanel, mainSettingsPage }: {
15
+ playerContext: PlayerContext;
16
+ qualitySettingsOpenButton: SettingsPanelPageOpenButton;
17
+ settingsPanel: SettingsPanel;
18
+ mainSettingsPage: SettingsPanelPage;
19
+ }): (source: any, args: any) => void;
@@ -1,2 +1,6 @@
1
- export declare function showPlayNextScreenIfNeeded(overlayDuration: number, containerEl: HTMLElement, proceedCallBack?: () => void): void;
2
- export declare function hidePlayNextScreen(containerEl: HTMLElement): void;
1
+ export declare function showPlayNextScreenIfNeeded({ overlayDuration, container, proceedCallBack }: {
2
+ overlayDuration: number;
3
+ container: HTMLElement;
4
+ proceedCallBack?: () => void;
5
+ }): void;
6
+ export declare function hidePlayNextScreen(container: HTMLElement): void;
@@ -1,4 +1,3 @@
1
1
  import { UIContainer } from 'bitmovin-player-ui';
2
- import { PlayerAPI } from 'bitmovin-player';
3
2
  import { NpoPlayerUIVariants, PlayerContext } from '../types/interfaces';
4
- export declare function createUIContainer(playerContext: PlayerContext, player: PlayerAPI, variant: NpoPlayerUIVariants): UIContainer;
3
+ export declare function createUIContainer(playerContext: PlayerContext, variant: NpoPlayerUIVariants): UIContainer;
File without changes
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ global.console = {
3
+ ...console,
4
+ error: jest.fn(),
5
+ warn: jest.fn()
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TextEncoder, TextDecoder } from 'util';
2
+ Object.assign(global, { TextDecoder, TextEncoder });
@@ -7,6 +7,14 @@ const settingsPanelMock = {
7
7
  settingsPanelEvents: jest.fn(),
8
8
  hideTimeout: jest.fn()
9
9
  };
10
+ const infoPanelMock = {
11
+ hide: jest.fn(),
12
+ isShown: jest.fn().mockReturnValue(true)
13
+ };
14
+ const infoPanelToggleButtonMock = {
15
+ off: jest.fn(),
16
+ isOn: jest.fn().mockReturnValue(true)
17
+ };
10
18
  export const mockNpoPlayer = {
11
19
  playerConfig: {
12
20
  key: jest.fn().mockReturnValue('mock-key'),
@@ -35,7 +43,10 @@ export const mockNpoPlayer = {
35
43
  npoTagPageTracker: undefined,
36
44
  logEmitter: {},
37
45
  uiComponents: {
38
- settingsPanels: [settingsPanelMock, settingsPanelMock]
46
+ settingsPanels: [settingsPanelMock, settingsPanelMock],
47
+ infoPanel: infoPanelMock,
48
+ infoPanelToggleButtons: [infoPanelToggleButtonMock, infoPanelToggleButtonMock],
49
+ skipChapterButton: undefined
39
50
  },
40
51
  container: document.createElement('div'),
41
52
  initPlayer: jest.fn(),
@@ -69,54 +80,26 @@ export const mockNpoPlayer = {
69
80
  playerContext: {},
70
81
  isShowingPlayNextScreen: false,
71
82
  eventListeners: undefined,
72
- setVolume: function (volume) {
73
- jest.fn();
74
- },
75
- increaseVolume: function () {
76
- jest.fn();
77
- },
78
- decreaseVolume: function () {
79
- jest.fn();
80
- },
81
- goForward: function (seconds) {
82
- jest.fn();
83
- },
84
- goBackwards: function (seconds) {
85
- jest.fn();
86
- },
87
- watchFromStart: function () {
88
- jest.fn();
89
- },
90
- showPlayNextScreen: function () {
91
- jest.fn();
92
- },
93
- cancelPlayNextScreen: function () {
94
- jest.fn();
95
- },
96
- hidePlayNextScreen: function () {
97
- jest.fn();
98
- },
99
- doPlayNext: function () {
100
- jest.fn();
101
- },
102
- destroy: function (asyncMode) {
103
- throw new Error('Function not implemented.');
104
- },
105
- unload: function (asyncMode) {
106
- throw new Error('Function not implemented.');
107
- },
108
- printVersion: function () {
109
- jest.fn();
110
- },
83
+ setVolume: jest.fn(),
84
+ increaseVolume: jest.fn(),
85
+ decreaseVolume: jest.fn(),
86
+ goForward: jest.fn(),
87
+ goBackwards: jest.fn(),
88
+ watchFromStart: jest.fn(),
89
+ showPlayNextScreen: jest.fn(),
90
+ cancelPlayNextScreen: jest.fn(),
91
+ hidePlayNextScreen: jest.fn(),
92
+ doPlayNext: jest.fn(),
93
+ destroy: jest.fn().mockResolvedValue(true),
94
+ unload: jest.fn().mockResolvedValue(true),
95
+ printVersion: jest.fn(),
111
96
  play: function () {
112
97
  throw new Error('Function not implemented.');
113
98
  },
114
99
  pause: function () {
115
100
  throw new Error('Function not implemented.');
116
101
  },
117
- updateMarkers: function () {
118
- jest.fn();
119
- },
102
+ updateMarkers: jest.fn(),
120
103
  npoPlayerServices: new NpoPlayerServices(),
121
- mockNpoPlayer: undefined
104
+ chapterHandler: undefined
122
105
  };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="jest" />
2
- import { PlayerAPI } from 'bitmovin-player';
2
+ import { PlayerAPI } from 'bitmovin-player/modules/bitmovinplayer-core';
3
3
  export declare const mockPlayerAPI: jest.Mocked<PlayerAPI>;
@@ -1,5 +1,19 @@
1
- import { AdQuartile, PlayerError, ModuleName, ErrorCode, BufferType, HttpRequestMethod, HttpRequestType, HttpResponseType, LogLevel, MediaType, PlayerAPINotAvailableError, PlayerEvent, PlayerModuleMissingError, PlayerType, SupportedTechnologyMode, ViewMode, WarningCode } from 'bitmovin-player';
1
+ import { AdQuartile, PlayerError, ModuleName, ErrorCode, BufferType, HttpRequestMethod, HttpRequestType, HttpResponseType, LogLevel, MediaType, PlayerAPINotAvailableError, PlayerEvent, PlayerModuleMissingError, PlayerType, SupportedTechnologyMode, ViewMode, WarningCode } from 'bitmovin-player/modules/bitmovinplayer-core';
2
2
  export const mockPlayerAPI = {
3
+ analytics: {
4
+ version: '1.0',
5
+ getCurrentImpressionId: jest.fn(() => 'test-impression-id'),
6
+ getUserId: jest.fn(() => 'test-user-id'),
7
+ setCustomData: jest.fn(),
8
+ setCustomDataOnce: jest.fn(),
9
+ sourceChange: jest.fn(),
10
+ ssai: {
11
+ adBreakStart: jest.fn(),
12
+ adStart: jest.fn(),
13
+ adQuartileFinished: jest.fn(),
14
+ adBreakEnd: jest.fn()
15
+ }
16
+ },
3
17
  version: '1.0',
4
18
  buffer: {
5
19
  setTargetLevel: jest.fn(),
@@ -0,0 +1,64 @@
1
+ /// <reference types="jest" />
2
+ export declare const mockPlayerUtils: {
3
+ PlayerState: {
4
+ Idle: string;
5
+ Playing: string;
6
+ Paused: string;
7
+ Buffering: string;
8
+ Finished: string;
9
+ Error: string;
10
+ };
11
+ };
12
+ export declare const mockPlayerUi: {
13
+ UIManager: {
14
+ new (): {
15
+ getTimelineMarkers: jest.Mock<any, any, any>;
16
+ removeTimelineMarker: jest.Mock<any, any, any>;
17
+ };
18
+ setLocalizationConfig: jest.Mock<any, any, any>;
19
+ };
20
+ PlaybackToggleButton: jest.Mock<any, any, any>;
21
+ VolumeToggleButton: jest.Mock<any, any, any>;
22
+ AirPlayToggleButton: jest.Mock<any, any, any>;
23
+ PictureInPictureToggleButton: jest.Mock<any, any, any>;
24
+ FullscreenToggleButton: jest.Mock<any, any, any>;
25
+ SettingsToggleButton: jest.Mock<any, any, any>;
26
+ ControlBar: jest.Mock<any, any, any>;
27
+ Container: jest.Mock<any, any, any>;
28
+ Label: jest.Mock<any, any, any>;
29
+ SettingsPanel: jest.Mock<any, any, any>;
30
+ SubtitleListBox: jest.Mock<any, any, any>;
31
+ ListBox: jest.Mock<any, any, any>;
32
+ SettingsPanelItem: jest.Mock<any, any, any>;
33
+ AudioQualitySelectBox: jest.Mock<any, any, any>;
34
+ AudioTrackSelectBox: jest.Mock<any, any, any>;
35
+ SettingsPanelPage: jest.Mock<any, any, any>;
36
+ SettingsPanelPageOpenButton: jest.Mock<any, any, any>;
37
+ SettingsPanelPageBackButton: jest.Mock<any, any, any>;
38
+ TitleBar: jest.Mock<any, any, any>;
39
+ SeekBar: jest.Mock<any, any, any>;
40
+ SeekBarLabel: jest.Mock<any, any, any>;
41
+ PlaybackTimeLabel: jest.Mock<any, any, any>;
42
+ PlaybackTimeLabelMode: {
43
+ CurrentTime: number;
44
+ TotalTime: number;
45
+ };
46
+ VolumeSlider: jest.Mock<any, any, any>;
47
+ Spacer: jest.Mock<any, any, any>;
48
+ ErrorMessageOverlay: jest.Mock<any, any, any>;
49
+ SubtitleOverlay: jest.Mock<any, any, any>;
50
+ BufferingOverlay: jest.Mock<any, any, any>;
51
+ CastStatusOverlay: jest.Mock<any, any, any>;
52
+ PlaybackToggleOverlay: jest.Mock<any, any, any>;
53
+ UIContainer: jest.Mock<any, any, any>;
54
+ PlayerUtils: {
55
+ PlayerState: {
56
+ Idle: string;
57
+ Playing: string;
58
+ Paused: string;
59
+ Buffering: string;
60
+ Finished: string;
61
+ Error: string;
62
+ };
63
+ };
64
+ };
@@ -0,0 +1,251 @@
1
+ var _a;
2
+ export const mockPlayerUtils = {
3
+ PlayerState: {
4
+ Idle: 'idle',
5
+ Playing: 'playing',
6
+ Paused: 'paused',
7
+ Buffering: 'buffering',
8
+ Finished: 'finished',
9
+ Error: 'error'
10
+ }
11
+ };
12
+ export const mockPlayerUi = {
13
+ UIManager: (_a = class {
14
+ constructor() {
15
+ this.getTimelineMarkers = jest.fn().mockReturnValue([]);
16
+ this.removeTimelineMarker = jest.fn();
17
+ }
18
+ },
19
+ _a.setLocalizationConfig = jest.fn(),
20
+ _a),
21
+ PlaybackToggleButton: jest.fn().mockImplementation(() => ({
22
+ onClick: {
23
+ unsubscribe: jest.fn(),
24
+ subscribe: jest.fn()
25
+ },
26
+ PlaybackToggleButton: jest.fn().mockImplementation(() => ({
27
+ onClick: {
28
+ unsubscribe: jest.fn(),
29
+ subscribe: jest.fn(),
30
+ },
31
+ isOn: jest.fn(),
32
+ })),
33
+ Button: jest.fn().mockImplementation(() => ({
34
+ onClick: {
35
+ unsubscribe: jest.fn(),
36
+ subscribe: jest.fn(),
37
+ },
38
+ })),
39
+ CastToggleButton: jest.fn().mockImplementation(() => ({
40
+ onClick: {
41
+ unsubscribe: jest.fn(),
42
+ subscribe: jest.fn(),
43
+ },
44
+ isOn: jest.fn(),
45
+ })),
46
+ VolumeToggleButton: jest.fn().mockImplementation(() => ({
47
+ onClick: {
48
+ unsubscribe: jest.fn(),
49
+ subscribe: jest.fn(),
50
+ },
51
+ })),
52
+ AirPlayToggleButton: jest.fn().mockImplementation(() => ({
53
+ onClick: {
54
+ unsubscribe: jest.fn(),
55
+ subscribe: jest.fn(),
56
+ },
57
+ isOn: jest.fn(),
58
+ })),
59
+ PictureInPictureToggleButton: jest.fn().mockImplementation(() => ({
60
+ onClick: {
61
+ unsubscribe: jest.fn(),
62
+ subscribe: jest.fn(),
63
+ },
64
+ })),
65
+ FullscreenToggleButton: jest.fn().mockImplementation(() => ({
66
+ onClick: {
67
+ unsubscribe: jest.fn(),
68
+ subscribe: jest.fn(),
69
+ },
70
+ })),
71
+ SettingsToggleButton: jest.fn().mockImplementation(() => ({
72
+ onClick: {
73
+ unsubscribe: jest.fn(),
74
+ subscribe: jest.fn(),
75
+ },
76
+ off: jest.fn(),
77
+ })),
78
+ ControlBar: jest.fn().mockImplementation(() => ({})),
79
+ Container: jest.fn().mockImplementation(() => ({
80
+ addComponent: jest.fn(),
81
+ })),
82
+ Label: jest.fn().mockImplementation(() => ({})),
83
+ SettingsPanel: jest.fn().mockImplementation(() => ({
84
+ hide: jest.fn(),
85
+ onHide: {
86
+ subscribe: jest.fn(),
87
+ },
88
+ onShow: {
89
+ subscribe: jest.fn(),
90
+ },
91
+ isShown: jest.fn(),
92
+ addComponent: jest.fn(),
93
+ })),
94
+ SubtitleListBox: jest.fn().mockImplementation(() => ({
95
+ onItemSelected: {
96
+ subscribe: jest.fn(),
97
+ },
98
+ })),
99
+ ListBox: jest.fn().mockImplementation(() => ({
100
+ onItemSelected: {
101
+ subscribe: jest.fn(),
102
+ },
103
+ selectItem: jest.fn(),
104
+ addItem: jest.fn(),
105
+ clearItems: jest.fn(),
106
+ })),
107
+ SettingsPanelItem: jest.fn().mockImplementation(() => ({
108
+ show: jest.fn(),
109
+ hide: jest.fn(),
110
+ })),
111
+ AudioQualitySelectBox: jest.fn().mockImplementation(() => ({})),
112
+ AudioTrackSelectBox: jest.fn().mockImplementation(() => ({})),
113
+ SettingsPanelPage: jest.fn().mockImplementation(() => ({
114
+ onActive: {
115
+ subscribeOnce: jest.fn(),
116
+ },
117
+ addComponent: jest.fn(),
118
+ })),
119
+ SettingsPanelPageOpenButton: jest.fn().mockImplementation(() => ({})),
120
+ SettingsPanelPageBackButton: jest.fn().mockImplementation(() => ({
121
+ onClick: {
122
+ unsubscribe: jest.fn(),
123
+ subscribe: jest.fn(),
124
+ },
125
+ off: jest.fn(),
126
+ })),
127
+ TitleBar: jest.fn().mockImplementation(() => ({
128
+ addComponent: jest.fn(),
129
+ })),
130
+ SeekBar: jest.fn().mockImplementation(() => ({})),
131
+ SeekBarLabel: jest.fn().mockImplementation(() => ({})),
132
+ PlaybackTimeLabel: jest.fn().mockImplementation(({ timeLabelMode }) => ({
133
+ timeLabelMode,
134
+ hideInLivePlayback: jest.fn(),
135
+ })),
136
+ PlaybackTimeLabelMode: {
137
+ CurrentTime: 0,
138
+ TotalTime: 100,
139
+ },
140
+ isOn: jest.fn()
141
+ })),
142
+ VolumeToggleButton: jest.fn().mockImplementation(() => ({
143
+ onClick: {
144
+ unsubscribe: jest.fn(),
145
+ subscribe: jest.fn()
146
+ }
147
+ })),
148
+ AirPlayToggleButton: jest.fn().mockImplementation(() => ({
149
+ onClick: {
150
+ unsubscribe: jest.fn(),
151
+ subscribe: jest.fn()
152
+ },
153
+ isOn: jest.fn()
154
+ })),
155
+ PictureInPictureToggleButton: jest.fn().mockImplementation(() => ({
156
+ onClick: {
157
+ unsubscribe: jest.fn(),
158
+ subscribe: jest.fn()
159
+ }
160
+ })),
161
+ FullscreenToggleButton: jest.fn().mockImplementation(() => ({
162
+ onClick: {
163
+ unsubscribe: jest.fn(),
164
+ subscribe: jest.fn()
165
+ }
166
+ })),
167
+ SettingsToggleButton: jest.fn().mockImplementation(() => ({
168
+ onClick: {
169
+ unsubscribe: jest.fn(),
170
+ subscribe: jest.fn()
171
+ },
172
+ off: jest.fn()
173
+ })),
174
+ ControlBar: jest.fn().mockImplementation(() => ({})),
175
+ Container: jest.fn().mockImplementation(() => ({
176
+ addComponent: jest.fn()
177
+ })),
178
+ Label: jest.fn().mockImplementation(() => ({})),
179
+ SettingsPanel: jest.fn().mockImplementation(() => ({
180
+ hide: jest.fn(),
181
+ onHide: {
182
+ subscribe: jest.fn()
183
+ },
184
+ onShow: {
185
+ subscribe: jest.fn()
186
+ },
187
+ isShown: jest.fn(),
188
+ addComponent: jest.fn()
189
+ })),
190
+ SubtitleListBox: jest.fn().mockImplementation(() => ({
191
+ onItemSelected: {
192
+ subscribe: jest.fn()
193
+ }
194
+ })),
195
+ ListBox: jest.fn().mockImplementation(() => ({
196
+ onItemSelected: {
197
+ subscribe: jest.fn()
198
+ },
199
+ selectItem: jest.fn(),
200
+ addItem: jest.fn()
201
+ })),
202
+ SettingsPanelItem: jest.fn().mockImplementation(() => ({
203
+ show: jest.fn(),
204
+ hide: jest.fn()
205
+ })),
206
+ AudioQualitySelectBox: jest.fn().mockImplementation(() => ({})),
207
+ AudioTrackSelectBox: jest.fn().mockImplementation(() => ({})),
208
+ SettingsPanelPage: jest.fn().mockImplementation(() => ({
209
+ onActive: {
210
+ subscribeOnce: jest.fn()
211
+ },
212
+ addComponent: jest.fn()
213
+ })),
214
+ SettingsPanelPageOpenButton: jest.fn().mockImplementation(() => ({})),
215
+ SettingsPanelPageBackButton: jest.fn().mockImplementation(() => ({
216
+ onClick: {
217
+ unsubscribe: jest.fn(),
218
+ subscribe: jest.fn()
219
+ },
220
+ off: jest.fn()
221
+ })),
222
+ TitleBar: jest.fn().mockImplementation(() => ({
223
+ addComponent: jest.fn()
224
+ })),
225
+ SeekBar: jest.fn().mockImplementation(() => ({})),
226
+ SeekBarLabel: jest.fn().mockImplementation(() => ({})),
227
+ PlaybackTimeLabel: jest.fn().mockImplementation(({ timeLabelMode }) => ({
228
+ timeLabelMode,
229
+ hideInLivePlayback: jest.fn()
230
+ })),
231
+ PlaybackTimeLabelMode: {
232
+ CurrentTime: 0,
233
+ TotalTime: 100
234
+ },
235
+ VolumeSlider: jest.fn().mockImplementation(() => ({})),
236
+ Spacer: jest.fn().mockImplementation(() => ({})),
237
+ ErrorMessageOverlay: jest.fn().mockImplementation(() => ({})),
238
+ SubtitleOverlay: jest.fn().mockImplementation(() => ({})),
239
+ BufferingOverlay: jest.fn().mockImplementation(() => ({})),
240
+ CastStatusOverlay: jest.fn().mockImplementation(() => ({})),
241
+ PlaybackToggleOverlay: jest.fn().mockImplementation(() => ({})),
242
+ UIContainer: jest.fn().mockImplementation(() => ({
243
+ components: [],
244
+ addComponent: jest.fn(),
245
+ cssClasses: [],
246
+ hidePlayerStateExceptions: jest.fn()
247
+ })),
248
+ PlayerUtils: {
249
+ PlayerState: mockPlayerUtils.PlayerState
250
+ }
251
+ };