@npo/player 1.17.2 → 1.18.1
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.
- package/README.md +2 -1
- package/lib/js/ads/ster.js +8 -10
- package/lib/js/ads/ster.test.js +0 -1
- package/lib/js/api/getstreamobject.js +0 -1
- package/lib/js/api/getstreamobject.test.js +0 -1
- package/lib/js/cdnproviders.js +10 -7
- package/lib/js/checks/apple.js +0 -1
- package/lib/js/checks/apple.test.js +0 -1
- package/lib/js/drm/drm.js +0 -1
- package/lib/js/drm/handlers/decideprofile.js +0 -1
- package/lib/js/drm/handlers/verifydrm.js +0 -1
- package/lib/js/drm/handlers/verifydrm.test.js +0 -1
- package/lib/js/fragments/removefragments.js +0 -1
- package/lib/js/fragments/setfragments.js +0 -1
- package/lib/js/playeractions/customerrors.test.js +0 -1
- package/lib/js/playeractions/handlers/customerrors.js +0 -1
- package/lib/js/playeractions/handlers/error.js +0 -1
- package/lib/js/playeractions/handlers/error.test.js +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.js +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.test.js +0 -1
- package/lib/js/playeractions/handlers/mediasessionactions.js +0 -1
- package/lib/js/playeractions/handlers/processplayerconfig.js +0 -1
- package/lib/js/playeractions/handlers/processsourceconfig.js +10 -6
- package/lib/js/playeractions/handlers/resolvekeypress.js +0 -1
- package/lib/js/playeractions/playeractions.js +0 -1
- package/lib/js/tracking/handlers/eventbinding.js +1 -3
- package/lib/js/tracking/handlers/eventlogging.js +0 -1
- package/lib/js/tracking/handlers/playertrackerinit.js +0 -1
- package/lib/js/tracking/handlers/playertrackerstart.js +0 -1
- package/lib/js/tracking/playertracker.js +0 -1
- package/lib/js/ui/components/adbutton.js +0 -1
- package/lib/js/ui/components/adlabel.js +0 -1
- package/lib/js/ui/components/audio/controlbar.js +0 -1
- package/lib/js/ui/components/buttons.d.ts +6 -0
- package/lib/js/ui/components/buttons.js +16 -3
- package/lib/js/ui/components/controlbar.js +0 -1
- package/lib/js/ui/components/ctabar.js +0 -1
- package/lib/js/ui/components/nativemobile/addFragments.js +0 -1
- package/lib/js/ui/components/nativemobile/buttons.js +0 -1
- package/lib/js/ui/components/nativemobile/controlbar.js +0 -1
- package/lib/js/ui/components/nativemobile/ctabar.js +0 -1
- package/lib/js/ui/components/nativemobile/playnext.js +0 -7
- package/lib/js/ui/components/nativemobile/titlebar.js +0 -1
- package/lib/js/ui/components/nativemobile/topbar.js +0 -1
- package/lib/js/ui/components/playnext.js +3 -3
- package/lib/js/ui/components/seekbar.js +0 -1
- package/lib/js/ui/components/settingspanel.js +4 -5
- package/lib/js/ui/components/shared/playnextscreen.d.ts +2 -2
- package/lib/js/ui/components/shared/playnextscreen.js +30 -13
- package/lib/js/ui/components/titlebar.js +0 -1
- package/lib/js/ui/components/topbar.js +0 -1
- package/lib/js/ui/handlers/accessibilityhandler.js +0 -1
- package/lib/js/ui/handlers/listboxhandlers.js +0 -1
- package/lib/js/ui/handlers/nicamhandler.d.ts +1 -1
- package/lib/js/ui/handlers/nicamhandler.js +1 -3
- package/lib/js/ui/handlers/nicamhandler.test.js +10 -15
- package/lib/js/ui/handlers/playnexthandlers.js +0 -1
- package/lib/js/ui/handlers/streamhandler.d.ts +3 -3
- package/lib/js/ui/handlers/streamhandler.js +4 -5
- package/lib/js/ui/handlers/timecontrolhandlers.js +0 -1
- package/lib/js/ui/nativemobileuicontainer.js +0 -1
- package/lib/js/ui/nativemobileuifactory.js +1 -2
- package/lib/js/ui/uicontainer.js +0 -1
- package/lib/js/utilities/localizationconfig.js +0 -1
- package/lib/js/utilities/printversion.js +0 -1
- package/lib/js/utilities/utilities.js +0 -1
- package/lib/js/utilities/utilities.test.js +0 -1
- package/lib/npoplayer.d.ts +3 -0
- package/lib/npoplayer.js +40 -11
- package/lib/npoplayer.test.js +0 -1
- package/lib/package.json +1 -1
- package/lib/src/js/ui/components/buttons.d.ts +6 -0
- package/lib/src/js/ui/components/shared/playnextscreen.d.ts +2 -2
- package/lib/src/js/ui/handlers/nicamhandler.d.ts +1 -1
- package/lib/src/js/ui/handlers/streamhandler.d.ts +3 -3
- package/lib/src/npoplayer.d.ts +3 -0
- package/lib/src/types/interfaces.d.ts +8 -1
- package/lib/types/classes.js +0 -1
- package/lib/types/interfaces.d.ts +8 -1
- package/lib/types/interfaces.js +0 -1
- package/package.json +1 -1
- package/src/scss/components/_playnext.scss +21 -33
- package/src/scss/components/_seekbarthumbnail.scss +1 -0
- package/src/scss/components/_subtitles.scss +16 -0
- package/src/scss/components/_textbuttons.scss +18 -18
- package/src/scss/npoplayer.css +17 -12
- package/src/scss/variants/_player-large.scss +10 -0
- package/src/scss/variants/_player-medium.scss +6 -0
- package/src/scss/variants/_player-small.scss +6 -0
- package/lib/js/ads/ster.js.map +0 -1
- package/lib/js/ads/ster.test.js.map +0 -1
- package/lib/js/api/getstreamobject.js.map +0 -1
- package/lib/js/api/getstreamobject.test.js.map +0 -1
- package/lib/js/cdnproviders.js.map +0 -1
- package/lib/js/checks/apple.js.map +0 -1
- package/lib/js/checks/apple.test.js.map +0 -1
- package/lib/js/drm/drm.js.map +0 -1
- package/lib/js/drm/handlers/decideprofile.js.map +0 -1
- package/lib/js/drm/handlers/verifydrm.js.map +0 -1
- package/lib/js/drm/handlers/verifydrm.test.js.map +0 -1
- package/lib/js/fragments/removefragments.js.map +0 -1
- package/lib/js/fragments/setfragments.js.map +0 -1
- package/lib/js/playeractions/customerrors.test.js.map +0 -1
- package/lib/js/playeractions/handlers/customerrors.js.map +0 -1
- package/lib/js/playeractions/handlers/error.js.map +0 -1
- package/lib/js/playeractions/handlers/error.test.js.map +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.js.map +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.test.js.map +0 -1
- package/lib/js/playeractions/handlers/mediasessionactions.js.map +0 -1
- package/lib/js/playeractions/handlers/processplayerconfig.js.map +0 -1
- package/lib/js/playeractions/handlers/processsourceconfig.js.map +0 -1
- package/lib/js/playeractions/handlers/resolvekeypress.js.map +0 -1
- package/lib/js/playeractions/playeractions.js.map +0 -1
- package/lib/js/tracking/handlers/eventbinding.js.map +0 -1
- package/lib/js/tracking/handlers/eventlogging.js.map +0 -1
- package/lib/js/tracking/handlers/playertrackerinit.js.map +0 -1
- package/lib/js/tracking/handlers/playertrackerstart.js.map +0 -1
- package/lib/js/tracking/playertracker.js.map +0 -1
- package/lib/js/ui/components/adbutton.js.map +0 -1
- package/lib/js/ui/components/adlabel.js.map +0 -1
- package/lib/js/ui/components/audio/controlbar.js.map +0 -1
- package/lib/js/ui/components/buttons.js.map +0 -1
- package/lib/js/ui/components/controlbar.js.map +0 -1
- package/lib/js/ui/components/ctabar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/addFragments.js.map +0 -1
- package/lib/js/ui/components/nativemobile/buttons.js.map +0 -1
- package/lib/js/ui/components/nativemobile/controlbar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/ctabar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/playnext.js.map +0 -1
- package/lib/js/ui/components/nativemobile/titlebar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/topbar.js.map +0 -1
- package/lib/js/ui/components/playnext.js.map +0 -1
- package/lib/js/ui/components/seekbar.js.map +0 -1
- package/lib/js/ui/components/settingspanel.js.map +0 -1
- package/lib/js/ui/components/shared/playnextscreen.js.map +0 -1
- package/lib/js/ui/components/titlebar.js.map +0 -1
- package/lib/js/ui/components/topbar.js.map +0 -1
- package/lib/js/ui/handlers/accessibilityhandler.js.map +0 -1
- package/lib/js/ui/handlers/listboxhandlers.js.map +0 -1
- package/lib/js/ui/handlers/nicamhandler.js.map +0 -1
- package/lib/js/ui/handlers/nicamhandler.test.js.map +0 -1
- package/lib/js/ui/handlers/playnexthandlers.js.map +0 -1
- package/lib/js/ui/handlers/streamhandler.js.map +0 -1
- package/lib/js/ui/handlers/timecontrolhandlers.js.map +0 -1
- package/lib/js/ui/nativemobileuicontainer.js.map +0 -1
- package/lib/js/ui/nativemobileuifactory.js.map +0 -1
- package/lib/js/ui/uicontainer.js.map +0 -1
- package/lib/js/utilities/localizationconfig.js.map +0 -1
- package/lib/js/utilities/printversion.js.map +0 -1
- package/lib/js/utilities/utilities.js.map +0 -1
- package/lib/js/utilities/utilities.test.js.map +0 -1
- package/lib/npoplayer.js.map +0 -1
- package/lib/npoplayer.test.js.map +0 -1
- package/lib/types/classes.js.map +0 -1
- package/lib/types/interfaces.js.map +0 -1
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
import { processNicam } from './nicamhandler';
|
|
2
|
-
describe(
|
|
2
|
+
describe('NICAM Processing', () => {
|
|
3
3
|
let mockElement;
|
|
4
4
|
let mockStreamObject;
|
|
5
5
|
let mockStreamOptions;
|
|
6
|
-
let containerId = 'testId';
|
|
7
6
|
beforeEach(() => {
|
|
8
7
|
mockElement = { innerHTML: '', appendChild: jest.fn() };
|
|
9
8
|
document.querySelector = jest.fn().mockReturnValue(mockElement);
|
|
10
9
|
mockStreamObject = {
|
|
11
10
|
metadata: {
|
|
12
11
|
ageRating: '12',
|
|
13
|
-
nicam: [
|
|
12
|
+
nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
15
|
mockStreamOptions = {
|
|
17
16
|
ageRating: '12',
|
|
18
|
-
nicam: [
|
|
17
|
+
nicam: ['DRUGS_EN_ALCOHOL']
|
|
19
18
|
};
|
|
20
19
|
});
|
|
21
|
-
it(
|
|
22
|
-
processNicam(mockStreamObject,
|
|
23
|
-
expect(
|
|
24
|
-
expect(mockElement.innerHTML).toBe("");
|
|
20
|
+
it('processes NICAM and age rating with streamOptions taking priority', () => {
|
|
21
|
+
processNicam(mockStreamObject, mockElement, mockStreamOptions);
|
|
22
|
+
expect(mockElement.innerHTML).toBe('');
|
|
25
23
|
expect(mockElement.appendChild).toHaveBeenCalledTimes(2);
|
|
26
24
|
});
|
|
27
|
-
it(
|
|
25
|
+
it('does nothing if no NICAM element found', () => {
|
|
28
26
|
document.querySelector = jest.fn().mockReturnValue(null);
|
|
29
|
-
processNicam(mockStreamObject,
|
|
30
|
-
expect(document.querySelector).toHaveBeenCalledWith(`#${containerId} .bmpui-nicam`);
|
|
27
|
+
processNicam(mockStreamObject, mockElement, mockStreamOptions);
|
|
31
28
|
});
|
|
32
|
-
it(
|
|
29
|
+
it('does nothing if no metadata and no streamOptions', () => {
|
|
33
30
|
mockStreamObject.metadata = {};
|
|
34
31
|
mockStreamOptions = {};
|
|
35
|
-
processNicam(mockStreamObject,
|
|
36
|
-
expect(document.querySelector).toHaveBeenCalledWith(`#${containerId} .bmpui-nicam`);
|
|
32
|
+
processNicam(mockStreamObject, mockElement, mockStreamOptions);
|
|
37
33
|
expect(mockElement.appendChild).not.toHaveBeenCalled();
|
|
38
34
|
});
|
|
39
35
|
});
|
|
40
|
-
//# sourceMappingURL=nicamhandler.test.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type StreamObject, type StreamOptions } from
|
|
2
|
-
import { PlayerAPI, SourceConfig } from
|
|
3
|
-
import { UIManager } from
|
|
1
|
+
import { type StreamObject, type StreamOptions } from '../../../types/interfaces';
|
|
2
|
+
import { PlayerAPI, SourceConfig } from 'bitmovin-player';
|
|
3
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
4
4
|
export declare function processStream(streamObject: StreamObject | undefined, container: HTMLElement, streamOptions: StreamOptions | null, player: PlayerAPI, uiManager: UIManager, sourceConfig: SourceConfig): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { processNicam } from
|
|
1
|
+
import { processNicam } from './nicamhandler';
|
|
2
2
|
import * as playerAction from '../../playeractions/playeractions';
|
|
3
|
-
import { PlayerEvent } from
|
|
4
|
-
import { setFragments } from
|
|
3
|
+
import { PlayerEvent } from 'bitmovin-player';
|
|
4
|
+
import { setFragments } from '../../fragments/setfragments';
|
|
5
5
|
export function processStream(streamObject, container, streamOptions, player, uiManager, sourceConfig) {
|
|
6
6
|
if (!streamObject)
|
|
7
7
|
return;
|
|
@@ -21,7 +21,7 @@ export function processStream(streamObject, container, streamOptions, player, ui
|
|
|
21
21
|
element.textContent = sourceConfig.title || '';
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
processNicam(streamObject, container.
|
|
24
|
+
processNicam(streamObject, container.querySelector('.bmpui-nicam'), streamOptions);
|
|
25
25
|
if (streamOptions?.startOffset != null)
|
|
26
26
|
playerAction.handleStartOffset(player, streamOptions.startOffset);
|
|
27
27
|
const isLiveStream = streamObject.stream.isLiveStream && streamObject.stream.hasDvrWindow;
|
|
@@ -38,4 +38,3 @@ export function processStream(streamObject, container, streamOptions, player, ui
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
//# sourceMappingURL=streamhandler.js.map
|
|
@@ -36,7 +36,7 @@ export function nativeMobileUiFactory(player, config = {}) {
|
|
|
36
36
|
};
|
|
37
37
|
const updateUI = () => {
|
|
38
38
|
if (_streamObject.metadata?.ageRating) {
|
|
39
|
-
processNicam(_streamObject, 'ui-container', null);
|
|
39
|
+
processNicam(_streamObject, document.querySelector('#ui-container .bmpui-nicam'), null);
|
|
40
40
|
}
|
|
41
41
|
const isLiveStream = _streamObject.stream?.isLiveStream && _streamObject.stream?.hasDvrWindow;
|
|
42
42
|
if (isLiveStream) {
|
|
@@ -93,4 +93,3 @@ export function nativeMobileUiFactory(player, config = {}) {
|
|
|
93
93
|
});
|
|
94
94
|
return mobileUIManager;
|
|
95
95
|
}
|
|
96
|
-
//# sourceMappingURL=nativemobileuifactory.js.map
|
package/lib/js/ui/uicontainer.js
CHANGED
|
@@ -24,4 +24,3 @@ export function printVersion(version) {
|
|
|
24
24
|
const versionStyle = 'font-size: 24px; font-weight: bold; padding: 2px 4px;';
|
|
25
25
|
console.log(`%c${asciiArt}%c${title} %c${versionString}`, `color: ${colorCode}; background-color: rgb(11, 28, 54);`, titleStyle, versionStyle);
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=printversion.js.map
|
package/lib/npoplayer.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export default class NpoPlayer {
|
|
|
24
24
|
version: string;
|
|
25
25
|
drmProfile: DRMProfile;
|
|
26
26
|
variant: NpoPlayerUIVariants;
|
|
27
|
+
isShowingPlayNextScreen: boolean;
|
|
28
|
+
canceledPlayNextScreen: boolean;
|
|
27
29
|
constructor(_container: HTMLElement, _playerConfig: PlayerConfig, _npotag?: InitialisationProps | null, _npotaginstance?: NPOTag | undefined, _variant?: NpoPlayerUIVariants);
|
|
28
30
|
initPlayer(_container: HTMLElement, playerConfig: PlayerConfig, variant: NpoPlayerUIVariants): void;
|
|
29
31
|
loadStream(source: string, options?: StreamOptions): Promise<void>;
|
|
@@ -37,6 +39,7 @@ export default class NpoPlayer {
|
|
|
37
39
|
goBackwards(seconds: number): void;
|
|
38
40
|
watchFromStart(): void;
|
|
39
41
|
showPlayNextScreen(): void;
|
|
42
|
+
cancelPlayNextScreen(): void;
|
|
40
43
|
hidePlayNextScreen(): void;
|
|
41
44
|
doPlayNext(): void;
|
|
42
45
|
destroy(): boolean;
|
package/lib/npoplayer.js
CHANGED
|
@@ -43,6 +43,8 @@ export default class NpoPlayer {
|
|
|
43
43
|
initPlayerTracker(this, _npotag, _npotaginstance);
|
|
44
44
|
this.logEmitter = new LogEmitter();
|
|
45
45
|
this.uiComponents = {};
|
|
46
|
+
this.isShowingPlayNextScreen = false;
|
|
47
|
+
this.canceledPlayNextScreen = false;
|
|
46
48
|
this.initPlayer(this.container, _playerConfig, this.variant);
|
|
47
49
|
}
|
|
48
50
|
initPlayer(_container, playerConfig, variant) {
|
|
@@ -55,6 +57,7 @@ export default class NpoPlayer {
|
|
|
55
57
|
}, true);
|
|
56
58
|
}
|
|
57
59
|
async loadStream(source, options = {}) {
|
|
60
|
+
this.streamOptions = options;
|
|
58
61
|
if (this.player == null) {
|
|
59
62
|
console.error('Er is nog geen player geladen.');
|
|
60
63
|
return;
|
|
@@ -110,7 +113,7 @@ export default class NpoPlayer {
|
|
|
110
113
|
startPlayerTracker(this, utility.validateStreamLength(_streamObject.metadata.duration, false), this.version, _streamObject.metadata.prid);
|
|
111
114
|
}
|
|
112
115
|
else {
|
|
113
|
-
this.doError(`Het is niet gelukt de stream op te halen: \n Input is valide token of media object.`, 500);
|
|
116
|
+
this.doError(`Het is niet gelukt de stream op te halen: \n Input is geen valide token of media object.`, 500);
|
|
114
117
|
}
|
|
115
118
|
this.player.off(PlayerEvent.SourceLoaded, () => { void addAccessibilityAttributes(this.container, this.streamObject.metadata); });
|
|
116
119
|
this.player.on(PlayerEvent.SourceLoaded, () => { void addAccessibilityAttributes(this.container, this.streamObject.metadata); });
|
|
@@ -118,16 +121,16 @@ export default class NpoPlayer {
|
|
|
118
121
|
this.player.on(PlayerEvent.AdBreakFinished, () => { void addAccessibilityAttributes(this.container, this.streamObject.metadata); });
|
|
119
122
|
if (this.sourceConfig?.metadata) {
|
|
120
123
|
this.sourceConfig.metadata.jwt = source;
|
|
121
|
-
this.sourceConfig.metadata.
|
|
124
|
+
this.sourceConfig.metadata.streamLinkAsJsonString = JSON.stringify(this.streamObject);
|
|
122
125
|
this.sourceConfig.metadata.npoTagSession = String(this.npoTag?.npoTagInstance?.getSerializedSessionInfo());
|
|
123
126
|
}
|
|
124
|
-
|
|
125
|
-
this.
|
|
126
|
-
});
|
|
127
|
-
if (options?.prid != null) {
|
|
128
|
-
this.player.on(PlayerEvent.PlaybackFinished, () => {
|
|
127
|
+
if (options?.playNext?.showPlayNext === true) {
|
|
128
|
+
this.player.on(PlayerEvent.TimeChanged, () => {
|
|
129
129
|
this.showPlayNextScreen();
|
|
130
130
|
});
|
|
131
|
+
this.player.on(PlayerEvent.Paused, () => {
|
|
132
|
+
this.hidePlayNextScreen();
|
|
133
|
+
});
|
|
131
134
|
}
|
|
132
135
|
if (options?.startOffset != null)
|
|
133
136
|
playerAction.handleStartOffset(this.player, options.startOffset);
|
|
@@ -208,21 +211,48 @@ export default class NpoPlayer {
|
|
|
208
211
|
playerAction.shiftToProgramStart(this.player, this.streamOptions.liveProgramTime);
|
|
209
212
|
}
|
|
210
213
|
showPlayNextScreen() {
|
|
211
|
-
|
|
214
|
+
if (this.player == null || !this.streamOptions.playNext?.showPlayNext)
|
|
215
|
+
return;
|
|
216
|
+
this.player.off(PlayerEvent.TimeChanged, () => {
|
|
217
|
+
this.showPlayNextScreen();
|
|
218
|
+
});
|
|
219
|
+
const videoDuration = this.player.getDuration();
|
|
220
|
+
const overlayDuration = this.streamOptions.playNext?.duration || 10;
|
|
221
|
+
const offset = this.streamOptions.playNext?.offset || overlayDuration;
|
|
222
|
+
const showPlayNextAt = videoDuration - offset;
|
|
223
|
+
if (!this.isShowingPlayNextScreen && this.player.getCurrentTime() > showPlayNextAt && !this.canceledPlayNextScreen) {
|
|
224
|
+
this.isShowingPlayNextScreen = true;
|
|
225
|
+
showPlayNextScreen(overlayDuration, this.container, this.streamOptions.playNext?.proceedCallback);
|
|
226
|
+
}
|
|
227
|
+
else if (this.isShowingPlayNextScreen && this.player.getCurrentTime() < showPlayNextAt) {
|
|
228
|
+
this.isShowingPlayNextScreen = false;
|
|
229
|
+
hidePlayNextScreen(this.container);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
cancelPlayNextScreen() {
|
|
233
|
+
this.canceledPlayNextScreen = true;
|
|
234
|
+
this.hidePlayNextScreen();
|
|
235
|
+
void this.streamOptions.playNext?.cancelCallback?.();
|
|
212
236
|
}
|
|
213
237
|
hidePlayNextScreen() {
|
|
214
|
-
|
|
238
|
+
this.player?.off(PlayerEvent.Paused, () => {
|
|
239
|
+
this.hidePlayNextScreen();
|
|
240
|
+
});
|
|
241
|
+
this.isShowingPlayNextScreen = false;
|
|
242
|
+
hidePlayNextScreen(this.container);
|
|
215
243
|
}
|
|
216
244
|
doPlayNext() {
|
|
217
245
|
this.hidePlayNextScreen();
|
|
218
|
-
void this.
|
|
246
|
+
void this.streamOptions.playNext?.proceedCallback?.();
|
|
219
247
|
}
|
|
220
248
|
destroy() {
|
|
221
249
|
try {
|
|
222
250
|
if (this.npoTag != null) {
|
|
223
251
|
clearInterval(this.npoTag.heartbeatInterval);
|
|
224
252
|
}
|
|
253
|
+
logEvent(this, 'stop');
|
|
225
254
|
this.uiManager?.release();
|
|
255
|
+
this.uiManager = null;
|
|
226
256
|
void this.player?.destroy();
|
|
227
257
|
return true;
|
|
228
258
|
}
|
|
@@ -254,4 +284,3 @@ window.bitmovin.playerui.UIFactory = {
|
|
|
254
284
|
return nativeMobileUiFactory(player, config);
|
|
255
285
|
}
|
|
256
286
|
};
|
|
257
|
-
//# sourceMappingURL=npoplayer.js.map
|
package/lib/npoplayer.test.js
CHANGED
package/lib/package.json
CHANGED
|
@@ -16,6 +16,12 @@ export declare function createPlayNextButton(player: PlayerAPI, npoplayer: NpoPl
|
|
|
16
16
|
ariaLabel: string;
|
|
17
17
|
hidden: false;
|
|
18
18
|
}>;
|
|
19
|
+
export declare function createCancelPlayNextButton(player: PlayerAPI, npoplayer: NpoPlayer): Button<{
|
|
20
|
+
cssClass: string;
|
|
21
|
+
text: string;
|
|
22
|
+
ariaLabel: string;
|
|
23
|
+
hidden: false;
|
|
24
|
+
}>;
|
|
19
25
|
export declare function createskipIntroButton(player: PlayerAPI): Button<{
|
|
20
26
|
cssClass: string;
|
|
21
27
|
text: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function showPlayNextScreen(
|
|
2
|
-
export declare function hidePlayNextScreen(): void;
|
|
1
|
+
export declare function showPlayNextScreen(overlayDuration: number, containerEl: HTMLElement, proceedCallBack?: () => void): void;
|
|
2
|
+
export declare function hidePlayNextScreen(containerEl: HTMLElement): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StreamObject, StreamOptions } from 'types/interfaces';
|
|
2
|
-
export declare function processNicam(streamObject: StreamObject,
|
|
2
|
+
export declare function processNicam(streamObject: StreamObject, nicamElement: HTMLElement | null, streamOptions: StreamOptions | null): void;
|
|
3
3
|
export declare function addNicamIcon(character: string, nicamElement: Element): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type StreamObject, type StreamOptions } from
|
|
2
|
-
import { PlayerAPI, SourceConfig } from
|
|
3
|
-
import { UIManager } from
|
|
1
|
+
import { type StreamObject, type StreamOptions } from '../../../types/interfaces';
|
|
2
|
+
import { PlayerAPI, SourceConfig } from 'bitmovin-player';
|
|
3
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
4
4
|
export declare function processStream(streamObject: StreamObject | undefined, container: HTMLElement, streamOptions: StreamOptions | null, player: PlayerAPI, uiManager: UIManager, sourceConfig: SourceConfig): void;
|
package/lib/src/npoplayer.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export default class NpoPlayer {
|
|
|
24
24
|
version: string;
|
|
25
25
|
drmProfile: DRMProfile;
|
|
26
26
|
variant: NpoPlayerUIVariants;
|
|
27
|
+
isShowingPlayNextScreen: boolean;
|
|
28
|
+
canceledPlayNextScreen: boolean;
|
|
27
29
|
constructor(_container: HTMLElement, _playerConfig: PlayerConfig, _npotag?: InitialisationProps | null, _npotaginstance?: NPOTag | undefined, _variant?: NpoPlayerUIVariants);
|
|
28
30
|
initPlayer(_container: HTMLElement, playerConfig: PlayerConfig, variant: NpoPlayerUIVariants): void;
|
|
29
31
|
loadStream(source: string, options?: StreamOptions): Promise<void>;
|
|
@@ -37,6 +39,7 @@ export default class NpoPlayer {
|
|
|
37
39
|
goBackwards(seconds: number): void;
|
|
38
40
|
watchFromStart(): void;
|
|
39
41
|
showPlayNextScreen(): void;
|
|
42
|
+
cancelPlayNextScreen(): void;
|
|
40
43
|
hidePlayNextScreen(): void;
|
|
41
44
|
doPlayNext(): void;
|
|
42
45
|
destroy(): boolean;
|
|
@@ -83,9 +83,9 @@ export interface StreamOptions {
|
|
|
83
83
|
liveProgramTime?: number;
|
|
84
84
|
endpoint?: string;
|
|
85
85
|
preferredDRM?: string;
|
|
86
|
-
prid?: string;
|
|
87
86
|
ageRating?: string;
|
|
88
87
|
nicam?: string[] | null;
|
|
88
|
+
playNext?: PlayNext;
|
|
89
89
|
}
|
|
90
90
|
export interface UIComponents {
|
|
91
91
|
errorMessageOverlay?: ErrorMessageOverlay;
|
|
@@ -131,4 +131,11 @@ export declare enum NpoPlayerUIVariants {
|
|
|
131
131
|
AUDIO = "audio",
|
|
132
132
|
AD = "ad"
|
|
133
133
|
}
|
|
134
|
+
export interface PlayNext {
|
|
135
|
+
showPlayNext?: boolean;
|
|
136
|
+
duration?: number;
|
|
137
|
+
offset?: number;
|
|
138
|
+
proceedCallback?: () => void;
|
|
139
|
+
cancelCallback?: () => void;
|
|
140
|
+
}
|
|
134
141
|
export {};
|
package/lib/types/classes.js
CHANGED
|
@@ -83,9 +83,9 @@ export interface StreamOptions {
|
|
|
83
83
|
liveProgramTime?: number;
|
|
84
84
|
endpoint?: string;
|
|
85
85
|
preferredDRM?: string;
|
|
86
|
-
prid?: string;
|
|
87
86
|
ageRating?: string;
|
|
88
87
|
nicam?: string[] | null;
|
|
88
|
+
playNext?: PlayNext;
|
|
89
89
|
}
|
|
90
90
|
export interface UIComponents {
|
|
91
91
|
errorMessageOverlay?: ErrorMessageOverlay;
|
|
@@ -131,4 +131,11 @@ export declare enum NpoPlayerUIVariants {
|
|
|
131
131
|
AUDIO = "audio",
|
|
132
132
|
AD = "ad"
|
|
133
133
|
}
|
|
134
|
+
export interface PlayNext {
|
|
135
|
+
showPlayNext?: boolean;
|
|
136
|
+
duration?: number;
|
|
137
|
+
offset?: number;
|
|
138
|
+
proceedCallback?: () => void;
|
|
139
|
+
cancelCallback?: () => void;
|
|
140
|
+
}
|
|
134
141
|
export {};
|
package/lib/types/interfaces.js
CHANGED
package/package.json
CHANGED
|
@@ -6,47 +6,35 @@
|
|
|
6
6
|
left: 0;
|
|
7
7
|
right: 0;
|
|
8
8
|
background-color: rgba(0, 0, 0, 0.07);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
&.show {
|
|
9
|
+
z-index: 10;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
|
|
12
|
+
&.show {
|
|
15
13
|
display: block;
|
|
16
14
|
}
|
|
15
|
+
|
|
17
16
|
.bmpui-container-wrapper {
|
|
18
17
|
position: relative;
|
|
19
18
|
height: 100%;
|
|
20
19
|
display: flex;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
align-items: flex-end;
|
|
21
|
+
justify-content: flex-end;
|
|
22
|
+
padding: 16px;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
|
|
25
|
+
.bmpui-ui-textbutton {
|
|
26
|
+
margin-left: 8px;
|
|
27
|
+
pointer-events: all;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ui-playNextButton {
|
|
31
|
+
background-color: var(--npo-player-textcolor);
|
|
32
|
+
width: 200px;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
|
|
34
35
|
.bmpui-label {
|
|
35
|
-
|
|
36
|
-
position: absolute;
|
|
37
|
-
bottom: -2em;
|
|
38
|
-
width: 100em;
|
|
39
|
-
text-align: center;
|
|
40
|
-
font-weight: 700;
|
|
41
|
-
left: calc(-50em + 3.5em);
|
|
42
|
-
font-size: 22px;
|
|
36
|
+
color: var(--npo-player-graycolor-dark);
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
@keyframes progress {
|
|
49
|
-
0% {
|
|
50
|
-
stroke-dasharray: 0 100;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
@-moz-document url-prefix() {
|
|
19
19
|
backdrop-filter: brightness(1);
|
|
20
20
|
}
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
.bmpui-ui-textbutton {
|
|
24
|
+
padding: 6px 14px;
|
|
25
|
+
background: rgba(3, 14, 30, 0.6);
|
|
26
|
+
border: 1px solid #ffffff;
|
|
27
|
+
backdrop-filter: blur(10px);
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
height: 36px;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
font-weight: 700;
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
33
|
+
.bmpui-label {
|
|
34
|
+
display: block;
|
|
35
|
+
font-family: var(--fontBold) !important;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
line-height: 16.8px;
|
|
38
|
+
align-items: center;
|
|
39
|
+
text-align: center;
|
|
40
|
+
color: #ffffff;
|
|
41
41
|
}
|
|
42
42
|
}
|