@npo/player 1.19.0 → 1.20.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.
- package/README.md +1 -1
- package/lib/js/drm/handlers/decideprofile.js +17 -17
- package/lib/js/drm/handlers/decideprofile.test.d.ts +1 -0
- package/lib/js/drm/handlers/decideprofile.test.js +33 -0
- package/lib/js/fragments/removefragments.test.d.ts +1 -0
- package/lib/js/fragments/removefragments.test.js +26 -0
- package/lib/js/fragments/setfragments.test.d.ts +1 -0
- package/lib/js/fragments/setfragments.test.js +72 -0
- package/lib/js/playeractions/handlers/processsourceconfig.js +13 -7
- package/lib/js/playeractions/handlers/removereplayclass.test.d.ts +1 -0
- package/lib/js/playeractions/handlers/removereplayclass.test.js +28 -0
- package/lib/js/playeractions/handlers/resolvekeypress.test.d.ts +1 -0
- package/lib/js/playeractions/handlers/resolvekeypress.test.js +80 -0
- package/lib/js/tracking/handlers/eventlogging.test.d.ts +1 -0
- package/lib/js/tracking/handlers/eventlogging.test.js +46 -0
- package/lib/js/ui/handlers/listboxhandlers.js +0 -1
- package/lib/js/ui/handlers/nicamhandler.d.ts +3 -0
- package/lib/js/ui/handlers/nicamhandler.js +16 -0
- package/lib/js/ui/nativemobileuicontainer.js +2 -2
- package/lib/js/ui/nativemobileuifactory.js +12 -12
- package/lib/npoplayer.d.ts +4 -2
- package/lib/npoplayer.js +37 -11
- package/lib/package.json +5 -5
- package/lib/src/js/drm/handlers/decideprofile.test.d.ts +1 -0
- package/lib/src/js/fragments/removefragments.test.d.ts +1 -0
- package/lib/src/js/fragments/setfragments.test.d.ts +1 -0
- package/lib/src/js/playeractions/handlers/removereplayclass.test.d.ts +1 -0
- package/lib/src/js/playeractions/handlers/resolvekeypress.test.d.ts +1 -0
- package/lib/src/js/tracking/handlers/eventlogging.test.d.ts +1 -0
- package/lib/src/js/ui/handlers/nicamhandler.d.ts +3 -0
- package/lib/src/npoplayer.d.ts +4 -2
- package/lib/src/types/interfaces.d.ts +10 -0
- package/lib/tests/mocks/mockNpoplayer.d.ts +2 -0
- package/lib/tests/mocks/mockNpoplayer.js +115 -0
- package/lib/types/interfaces.d.ts +10 -0
- package/package.json +5 -5
- package/src/scss/components/_advert.scss +5 -5
- package/src/scss/components/_hugeplaybacktogglebutton.scss +1 -0
- package/src/scss/components/_metadata.scss +17 -0
- package/src/scss/components/_nicam.scss +20 -0
- package/src/scss/components/_replay.scss +0 -1
- package/src/scss/components/_seekbarthumbnail.scss +0 -1
- package/src/scss/components/_subtitles.scss +1 -1
- package/src/scss/npoplayer.css +35 -30
- package/src/scss/variants/_player-base.scss +6 -1
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npo/player",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "NPO Player",
|
|
5
5
|
"author": "Publieke Omroep <player@npo.nl>",
|
|
6
6
|
"contributors": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Arjan Kruithof"
|
|
10
10
|
],
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": "^18
|
|
12
|
+
"node": "^18 || ^20"
|
|
13
13
|
},
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"main": "./lib/npoplayer",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"webpack-dev-server": "^4.11.1"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@npotag/tag": "^3.0.
|
|
85
|
-
"bitmovin-player": "8.
|
|
86
|
-
"bitmovin-player-ui": "
|
|
84
|
+
"@npotag/tag": "^3.0.1",
|
|
85
|
+
"bitmovin-player": "8.151.0",
|
|
86
|
+
"bitmovin-player-ui": "3.54.0"
|
|
87
87
|
},
|
|
88
88
|
"browserslist": [
|
|
89
89
|
"defaults",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { PlayerAPI } from 'bitmovin-player';
|
|
2
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
1
3
|
import { StreamObject, StreamOptions } from 'types/interfaces';
|
|
2
4
|
export declare function processNicam(streamObject: StreamObject, nicamElement: HTMLElement | null, streamOptions: StreamOptions | null): void;
|
|
3
5
|
export declare function addNicamIcon(character: string, nicamElement: Element): void;
|
|
6
|
+
export declare function showNicamAfterUiDelay(player: PlayerAPI, uiManager: UIManager | null): void;
|
package/lib/src/npoplayer.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export default class NpoPlayer {
|
|
|
32
32
|
createUIManager(player: PlayerAPI, variant: NpoPlayerUIVariants): Promise<void>;
|
|
33
33
|
doError(input: any, status?: number): void;
|
|
34
34
|
keyPress(e: KeyboardEvent): void;
|
|
35
|
+
play(): void;
|
|
36
|
+
pause(): void;
|
|
35
37
|
setVolume(volume: number): void;
|
|
36
38
|
increaseVolume(): void;
|
|
37
39
|
decreaseVolume(): void;
|
|
@@ -42,7 +44,7 @@ export default class NpoPlayer {
|
|
|
42
44
|
cancelPlayNextScreen(): void;
|
|
43
45
|
hidePlayNextScreen(): void;
|
|
44
46
|
doPlayNext(): void;
|
|
45
|
-
destroy(asyncMode?: boolean): Promise<boolean
|
|
46
|
-
unload(asyncMode?: boolean): Promise<boolean
|
|
47
|
+
destroy(asyncMode?: boolean): Promise<boolean> | boolean;
|
|
48
|
+
unload(asyncMode?: boolean): Promise<boolean> | boolean;
|
|
47
49
|
printVersion(): void;
|
|
48
50
|
}
|
|
@@ -15,6 +15,15 @@ export interface ApiPayload {
|
|
|
15
15
|
baseURL: string;
|
|
16
16
|
jwt: string;
|
|
17
17
|
data: Record<string, unknown>;
|
|
18
|
+
ster?: SterData;
|
|
19
|
+
}
|
|
20
|
+
interface SterData {
|
|
21
|
+
identifier: string;
|
|
22
|
+
site?: string;
|
|
23
|
+
deviceType?: number;
|
|
24
|
+
os?: string;
|
|
25
|
+
osVersion?: string;
|
|
26
|
+
player?: string;
|
|
18
27
|
}
|
|
19
28
|
export interface DRMProfile {
|
|
20
29
|
profileName: string;
|
|
@@ -86,6 +95,7 @@ export interface StreamOptions {
|
|
|
86
95
|
ageRating?: string;
|
|
87
96
|
nicam?: string[] | null;
|
|
88
97
|
playNext?: PlayNext;
|
|
98
|
+
ster?: SterData;
|
|
89
99
|
}
|
|
90
100
|
export interface UIComponents {
|
|
91
101
|
errorMessageOverlay?: ErrorMessageOverlay;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export const mockNpoPlayer = {
|
|
2
|
+
playerConfig: {
|
|
3
|
+
key: jest.fn().mockReturnValue('mock-key'),
|
|
4
|
+
source: {
|
|
5
|
+
dash: jest.fn().mockReturnValue('mock-dash'),
|
|
6
|
+
hls: jest.fn().mockReturnValue('mock-hls'),
|
|
7
|
+
progressive: jest.fn().mockReturnValue('mock-progressive'),
|
|
8
|
+
poster: jest.fn().mockReturnValue('mock-poster')
|
|
9
|
+
},
|
|
10
|
+
playback: {
|
|
11
|
+
autoplay: jest.fn().mockReturnValue(true),
|
|
12
|
+
muted: jest.fn().mockReturnValue(false)
|
|
13
|
+
},
|
|
14
|
+
style: {
|
|
15
|
+
width: jest.fn().mockReturnValue('100%'),
|
|
16
|
+
aspectratio: jest.fn().mockReturnValue('16:9')
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
sourceConfig: {},
|
|
20
|
+
streamObject: {},
|
|
21
|
+
uiManager: null,
|
|
22
|
+
canceledPlayNextScreen: false,
|
|
23
|
+
npoTag: undefined,
|
|
24
|
+
fragment: null,
|
|
25
|
+
logEmitter: {},
|
|
26
|
+
uiComponents: {
|
|
27
|
+
settingsPanel: {
|
|
28
|
+
isShown: jest.fn().mockReturnValue(true),
|
|
29
|
+
hide: jest.fn(),
|
|
30
|
+
activePage: jest.fn(),
|
|
31
|
+
navigationStack: jest.fn(),
|
|
32
|
+
settingsPanelEvents: jest.fn(),
|
|
33
|
+
hideTimeout: jest.fn(),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
container: document.createElement('div'),
|
|
37
|
+
initPlayer: jest.fn(),
|
|
38
|
+
loadStream: jest.fn(),
|
|
39
|
+
createUIManager: jest.fn(),
|
|
40
|
+
doError: jest.fn(),
|
|
41
|
+
player: {
|
|
42
|
+
getCurrentTime: jest.fn().mockReturnValue(10),
|
|
43
|
+
},
|
|
44
|
+
streamTracker: {
|
|
45
|
+
start: jest.fn(),
|
|
46
|
+
buffering: jest.fn(),
|
|
47
|
+
buffering_complete: jest.fn(),
|
|
48
|
+
complete: jest.fn(),
|
|
49
|
+
fullscreen: jest.fn(),
|
|
50
|
+
load: jest.fn(),
|
|
51
|
+
load_complete: jest.fn(),
|
|
52
|
+
pause: jest.fn(),
|
|
53
|
+
resume: jest.fn(),
|
|
54
|
+
stop: jest.fn(),
|
|
55
|
+
windowed: jest.fn(),
|
|
56
|
+
time: jest.fn(),
|
|
57
|
+
seek: jest.fn(),
|
|
58
|
+
},
|
|
59
|
+
adBreakActive: false,
|
|
60
|
+
streamOptions: {},
|
|
61
|
+
jwt: '',
|
|
62
|
+
apiPayload: {},
|
|
63
|
+
version: '',
|
|
64
|
+
drmProfile: {},
|
|
65
|
+
variant: '',
|
|
66
|
+
isShowingPlayNextScreen: false,
|
|
67
|
+
keyPress: function (e) {
|
|
68
|
+
jest.fn();
|
|
69
|
+
},
|
|
70
|
+
setVolume: function (volume) {
|
|
71
|
+
jest.fn();
|
|
72
|
+
},
|
|
73
|
+
increaseVolume: function () {
|
|
74
|
+
jest.fn();
|
|
75
|
+
},
|
|
76
|
+
decreaseVolume: function () {
|
|
77
|
+
jest.fn();
|
|
78
|
+
},
|
|
79
|
+
goForward: function (seconds) {
|
|
80
|
+
jest.fn();
|
|
81
|
+
},
|
|
82
|
+
goBackwards: function (seconds) {
|
|
83
|
+
jest.fn();
|
|
84
|
+
},
|
|
85
|
+
watchFromStart: function () {
|
|
86
|
+
jest.fn();
|
|
87
|
+
},
|
|
88
|
+
showPlayNextScreen: function () {
|
|
89
|
+
jest.fn();
|
|
90
|
+
},
|
|
91
|
+
cancelPlayNextScreen: function () {
|
|
92
|
+
jest.fn();
|
|
93
|
+
},
|
|
94
|
+
hidePlayNextScreen: function () {
|
|
95
|
+
jest.fn();
|
|
96
|
+
},
|
|
97
|
+
doPlayNext: function () {
|
|
98
|
+
jest.fn();
|
|
99
|
+
},
|
|
100
|
+
destroy: function (asyncMode) {
|
|
101
|
+
throw new Error('Function not implemented.');
|
|
102
|
+
},
|
|
103
|
+
unload: function (asyncMode) {
|
|
104
|
+
throw new Error('Function not implemented.');
|
|
105
|
+
},
|
|
106
|
+
printVersion: function () {
|
|
107
|
+
jest.fn();
|
|
108
|
+
},
|
|
109
|
+
play: function () {
|
|
110
|
+
throw new Error('Function not implemented.');
|
|
111
|
+
},
|
|
112
|
+
pause: function () {
|
|
113
|
+
throw new Error('Function not implemented.');
|
|
114
|
+
}
|
|
115
|
+
};
|
|
@@ -15,6 +15,15 @@ export interface ApiPayload {
|
|
|
15
15
|
baseURL: string;
|
|
16
16
|
jwt: string;
|
|
17
17
|
data: Record<string, unknown>;
|
|
18
|
+
ster?: SterData;
|
|
19
|
+
}
|
|
20
|
+
interface SterData {
|
|
21
|
+
identifier: string;
|
|
22
|
+
site?: string;
|
|
23
|
+
deviceType?: number;
|
|
24
|
+
os?: string;
|
|
25
|
+
osVersion?: string;
|
|
26
|
+
player?: string;
|
|
18
27
|
}
|
|
19
28
|
export interface DRMProfile {
|
|
20
29
|
profileName: string;
|
|
@@ -86,6 +95,7 @@ export interface StreamOptions {
|
|
|
86
95
|
ageRating?: string;
|
|
87
96
|
nicam?: string[] | null;
|
|
88
97
|
playNext?: PlayNext;
|
|
98
|
+
ster?: SterData;
|
|
89
99
|
}
|
|
90
100
|
export interface UIComponents {
|
|
91
101
|
errorMessageOverlay?: ErrorMessageOverlay;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npo/player",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "NPO Player",
|
|
5
5
|
"author": "Publieke Omroep <player@npo.nl>",
|
|
6
6
|
"contributors": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Arjan Kruithof"
|
|
10
10
|
],
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": "^18
|
|
12
|
+
"node": "^18 || ^20"
|
|
13
13
|
},
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"main": "./lib/npoplayer",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"webpack-dev-server": "^4.11.1"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@npotag/tag": "^3.0.
|
|
85
|
-
"bitmovin-player": "8.
|
|
86
|
-
"bitmovin-player-ui": "
|
|
84
|
+
"@npotag/tag": "^3.0.1",
|
|
85
|
+
"bitmovin-player": "8.151.0",
|
|
86
|
+
"bitmovin-player-ui": "3.54.0"
|
|
87
87
|
},
|
|
88
88
|
"browserslist": [
|
|
89
89
|
"defaults",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
.bmpui-seekbar-bufferlevel {
|
|
19
19
|
position: relative;
|
|
20
20
|
z-index: 2;
|
|
21
|
-
background-color:
|
|
21
|
+
background-color: #fff;
|
|
22
22
|
opacity: 0.6;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.bmpui-seekbar-backdrop {
|
|
26
|
-
background-color:
|
|
26
|
+
background-color: #fff;
|
|
27
27
|
opacity: 0.3;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.bmpui-seekbar-playbackposition {
|
|
31
31
|
position: relative;
|
|
32
32
|
z-index: 3;
|
|
33
|
-
background:
|
|
33
|
+
background: #fff;
|
|
34
34
|
backdrop-filter: blur(50px);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
align-items: center;
|
|
43
43
|
top: 24px;
|
|
44
44
|
left: 24px;
|
|
45
|
-
font-family:
|
|
45
|
+
font-family: 'NPOSansBold', sans-serif;
|
|
46
46
|
font-weight: 700;
|
|
47
47
|
|
|
48
48
|
&::before {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
width: fit-content;
|
|
81
81
|
|
|
82
82
|
.bmpui-label {
|
|
83
|
-
font-family:
|
|
83
|
+
font-family: 'NPOSansRegular', sans-serif;
|
|
84
84
|
font-weight: normal;
|
|
85
85
|
font-size: 12px;
|
|
86
86
|
line-height: 0;
|
|
@@ -2,12 +2,21 @@
|
|
|
2
2
|
padding: 24px 18px;
|
|
3
3
|
color: var(--npo-player-textcolor);
|
|
4
4
|
|
|
5
|
+
.bmpui-container-wrapper {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: auto auto;
|
|
8
|
+
grid-template-rows: auto auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
.bmpui-label-metadata-title {
|
|
6
12
|
font-family: var(--fontBold);
|
|
7
13
|
font-style: normal;
|
|
8
14
|
font-weight: 700;
|
|
9
15
|
font-size: 16px;
|
|
10
16
|
line-height: 19.2px;
|
|
17
|
+
grid-column: 1;
|
|
18
|
+
grid-row: 1;
|
|
19
|
+
gap: 0;
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
.bmpui-label-metadata-description {
|
|
@@ -18,6 +27,8 @@
|
|
|
18
27
|
line-height: 20px;
|
|
19
28
|
margin: 4px 0;
|
|
20
29
|
opacity: 0.65;
|
|
30
|
+
grid-column: 1;
|
|
31
|
+
grid-row: 2;
|
|
21
32
|
|
|
22
33
|
// Max 4 lines
|
|
23
34
|
display: -webkit-box;
|
|
@@ -26,4 +37,10 @@
|
|
|
26
37
|
overflow: hidden;
|
|
27
38
|
text-overflow: ellipsis;
|
|
28
39
|
}
|
|
40
|
+
|
|
41
|
+
.bmpui-nicam {
|
|
42
|
+
grid-column: 2;
|
|
43
|
+
grid-row: 1;
|
|
44
|
+
justify-content: end;
|
|
45
|
+
}
|
|
29
46
|
}
|
|
@@ -77,4 +77,24 @@
|
|
|
77
77
|
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 102 102'><g><path d='M1,51a50,50,0,1,1,50,50A50.018,50.018,0,0,1,1,51Z' fill='%23fff'/><path d='M7.4,51A43.6,43.6,0,1,1,51,94.6,43.51,43.51,0,0,1,7.4,51ZM82.2,66.9,35.1,19.7A35.793,35.793,0,0,0,19.7,35.1L66.8,82.2A35.552,35.552,0,0,0,82.2,66.9Z'/></g></svg>");
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// show nicam on default state
|
|
83
|
+
&.bmpui-player-state-prepared,
|
|
84
|
+
&.bmpui-player-state-prepared.bmpui-layout-max-width-400,
|
|
85
|
+
&.bmpui-player-state-prepared.bmpui-layout-max-width-600,
|
|
86
|
+
&.show-nicam:not(.bmpui-player-state-paused).bmpui-layout-max-width-400,
|
|
87
|
+
&.show-nicam:not(.bmpui-player-state-paused).bmpui-layout-max-width-600 {
|
|
88
|
+
.bmpui-metadata,
|
|
89
|
+
.bmpui-metadata.bmpui-title-bar {
|
|
90
|
+
display: block;
|
|
91
|
+
opacity: 1;
|
|
92
|
+
visibility: visible;
|
|
93
|
+
background: none;
|
|
94
|
+
|
|
95
|
+
.bmpui-label-metadata-title,
|
|
96
|
+
.bmpui-label-metadata-description {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
80
100
|
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
writing-mode: horizontal-tb;
|
|
22
22
|
width: 100% !important;
|
|
23
|
+
inset: none !important;
|
|
23
24
|
display: block !important;
|
|
24
25
|
bottom: 18px !important;
|
|
25
26
|
left: 0 !important;
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
top: auto !important;
|
|
28
29
|
font-size: 1em !important;
|
|
29
30
|
font-weight: 400 !important;
|
|
30
|
-
inset: none !important;
|
|
31
31
|
padding: 0 18px;
|
|
32
32
|
|
|
33
33
|
@container (min-width: 600px) {
|