@npo/player 1.9.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/CHANGELOG.md +3 -0
- package/LICENSE +15 -0
- package/README.md +281 -0
- package/lib/js/ads/ster.d.ts +4 -0
- package/lib/js/ads/ster.js +159 -0
- package/lib/js/ads/ster.js.map +1 -0
- package/lib/js/ads/ster.test.d.ts +1 -0
- package/lib/js/ads/ster.test.js +91 -0
- package/lib/js/ads/ster.test.js.map +1 -0
- package/lib/js/api/getstreamobject.d.ts +3 -0
- package/lib/js/api/getstreamobject.js +19 -0
- package/lib/js/api/getstreamobject.js.map +1 -0
- package/lib/js/cdnproviders.d.ts +1 -0
- package/lib/js/cdnproviders.js +13 -0
- package/lib/js/cdnproviders.js.map +1 -0
- package/lib/js/checks/safari.d.ts +1 -0
- package/lib/js/checks/safari.js +10 -0
- package/lib/js/checks/safari.js.map +1 -0
- package/lib/js/checks/safari.test.d.ts +1 -0
- package/lib/js/checks/safari.test.js +21 -0
- package/lib/js/checks/safari.test.js.map +1 -0
- package/lib/js/drm/verifydrm.d.ts +4 -0
- package/lib/js/drm/verifydrm.js +38 -0
- package/lib/js/drm/verifydrm.js.map +1 -0
- package/lib/js/drm/verifydrm.test.d.ts +1 -0
- package/lib/js/drm/verifydrm.test.js +18 -0
- package/lib/js/drm/verifydrm.test.js.map +1 -0
- package/lib/js/fragments/setfragments.d.ts +3 -0
- package/lib/js/fragments/setfragments.js +68 -0
- package/lib/js/fragments/setfragments.js.map +1 -0
- package/lib/js/playeractions/customerrors.test.d.ts +1 -0
- package/lib/js/playeractions/customerrors.test.js +52 -0
- package/lib/js/playeractions/customerrors.test.js.map +1 -0
- package/lib/js/playeractions/handlers/customerrors.d.ts +50 -0
- package/lib/js/playeractions/handlers/customerrors.js +154 -0
- package/lib/js/playeractions/handlers/customerrors.js.map +1 -0
- package/lib/js/playeractions/handlers/error.d.ts +3 -0
- package/lib/js/playeractions/handlers/error.js +23 -0
- package/lib/js/playeractions/handlers/error.js.map +1 -0
- package/lib/js/playeractions/handlers/error.test.d.ts +1 -0
- package/lib/js/playeractions/handlers/error.test.js +45 -0
- package/lib/js/playeractions/handlers/error.test.js.map +1 -0
- package/lib/js/playeractions/handlers/handleoffsets.d.ts +6 -0
- package/lib/js/playeractions/handlers/handleoffsets.js +71 -0
- package/lib/js/playeractions/handlers/handleoffsets.js.map +1 -0
- package/lib/js/playeractions/handlers/handleoffsets.test.d.ts +1 -0
- package/lib/js/playeractions/handlers/handleoffsets.test.js +50 -0
- package/lib/js/playeractions/handlers/handleoffsets.test.js.map +1 -0
- package/lib/js/playeractions/handlers/resolvekeypress.d.ts +3 -0
- package/lib/js/playeractions/handlers/resolvekeypress.js +55 -0
- package/lib/js/playeractions/handlers/resolvekeypress.js.map +1 -0
- package/lib/js/playeractions/playeractions.d.ts +3 -0
- package/lib/js/playeractions/playeractions.js +4 -0
- package/lib/js/playeractions/playeractions.js.map +1 -0
- package/lib/js/tracking/handlers/eventbinding.d.ts +10 -0
- package/lib/js/tracking/handlers/eventbinding.js +86 -0
- package/lib/js/tracking/handlers/eventbinding.js.map +1 -0
- package/lib/js/tracking/handlers/eventlogging.d.ts +11 -0
- package/lib/js/tracking/handlers/eventlogging.js +42 -0
- package/lib/js/tracking/handlers/eventlogging.js.map +1 -0
- package/lib/js/tracking/handlers/playertrackerinit.d.ts +13 -0
- package/lib/js/tracking/handlers/playertrackerinit.js +29 -0
- package/lib/js/tracking/handlers/playertrackerinit.js.map +1 -0
- package/lib/js/tracking/handlers/playertrackerstart.d.ts +8 -0
- package/lib/js/tracking/handlers/playertrackerstart.js +29 -0
- package/lib/js/tracking/handlers/playertrackerstart.js.map +1 -0
- package/lib/js/tracking/playertracker.d.ts +4 -0
- package/lib/js/tracking/playertracker.js +10 -0
- package/lib/js/tracking/playertracker.js.map +1 -0
- package/lib/js/ui/components/adbutton.d.ts +7 -0
- package/lib/js/ui/components/adbutton.js +21 -0
- package/lib/js/ui/components/adbutton.js.map +1 -0
- package/lib/js/ui/components/adlabel.d.ts +7 -0
- package/lib/js/ui/components/adlabel.js +17 -0
- package/lib/js/ui/components/adlabel.js.map +1 -0
- package/lib/js/ui/components/buttons.d.ts +30 -0
- package/lib/js/ui/components/buttons.js +89 -0
- package/lib/js/ui/components/buttons.js.map +1 -0
- package/lib/js/ui/components/controlbar.d.ts +3 -0
- package/lib/js/ui/components/controlbar.js +47 -0
- package/lib/js/ui/components/controlbar.js.map +1 -0
- package/lib/js/ui/components/ctabar.d.ts +9 -0
- package/lib/js/ui/components/ctabar.js +41 -0
- package/lib/js/ui/components/ctabar.js.map +1 -0
- package/lib/js/ui/components/nativemobile/buttons.d.ts +13 -0
- package/lib/js/ui/components/nativemobile/buttons.js +43 -0
- package/lib/js/ui/components/nativemobile/buttons.js.map +1 -0
- package/lib/js/ui/components/nativemobile/controlbar.d.ts +2 -0
- package/lib/js/ui/components/nativemobile/controlbar.js +23 -0
- package/lib/js/ui/components/nativemobile/controlbar.js.map +1 -0
- package/lib/js/ui/components/nativemobile/ctabar.d.ts +10 -0
- package/lib/js/ui/components/nativemobile/ctabar.js +12 -0
- package/lib/js/ui/components/nativemobile/ctabar.js.map +1 -0
- package/lib/js/ui/components/nativemobile/playnext.d.ts +10 -0
- package/lib/js/ui/components/nativemobile/playnext.js +16 -0
- package/lib/js/ui/components/nativemobile/playnext.js.map +1 -0
- package/lib/js/ui/components/nativemobile/topbar.d.ts +3 -0
- package/lib/js/ui/components/nativemobile/topbar.js +21 -0
- package/lib/js/ui/components/nativemobile/topbar.js.map +1 -0
- package/lib/js/ui/components/playnext.d.ts +11 -0
- package/lib/js/ui/components/playnext.js +11 -0
- package/lib/js/ui/components/playnext.js.map +1 -0
- package/lib/js/ui/components/settingspanel.d.ts +4 -0
- package/lib/js/ui/components/settingspanel.js +130 -0
- package/lib/js/ui/components/settingspanel.js.map +1 -0
- package/lib/js/ui/components/shared/playnextscreen.d.ts +2 -0
- package/lib/js/ui/components/shared/playnextscreen.js +18 -0
- package/lib/js/ui/components/shared/playnextscreen.js.map +1 -0
- package/lib/js/ui/components/titlebar.d.ts +3 -0
- package/lib/js/ui/components/titlebar.js +9 -0
- package/lib/js/ui/components/titlebar.js.map +1 -0
- package/lib/js/ui/components/topbar.d.ts +2 -0
- package/lib/js/ui/components/topbar.js +19 -0
- package/lib/js/ui/components/topbar.js.map +1 -0
- package/lib/js/ui/handlers/listboxhandlers.d.ts +5 -0
- package/lib/js/ui/handlers/listboxhandlers.js +41 -0
- package/lib/js/ui/handlers/listboxhandlers.js.map +1 -0
- package/lib/js/ui/handlers/nicamhandler.d.ts +2 -0
- package/lib/js/ui/handlers/nicamhandler.js +32 -0
- package/lib/js/ui/handlers/nicamhandler.js.map +1 -0
- package/lib/js/ui/handlers/nicamhandler.test.d.ts +1 -0
- package/lib/js/ui/handlers/nicamhandler.test.js +34 -0
- package/lib/js/ui/handlers/nicamhandler.test.js.map +1 -0
- package/lib/js/ui/handlers/playnexthandlers.d.ts +0 -0
- package/lib/js/ui/handlers/playnexthandlers.js +2 -0
- package/lib/js/ui/handlers/playnexthandlers.js.map +1 -0
- package/lib/js/ui/handlers/timecontrolhandlers.d.ts +3 -0
- package/lib/js/ui/handlers/timecontrolhandlers.js +23 -0
- package/lib/js/ui/handlers/timecontrolhandlers.js.map +1 -0
- package/lib/js/ui/nativemobileui.d.ts +6 -0
- package/lib/js/ui/nativemobileui.js +49 -0
- package/lib/js/ui/nativemobileui.js.map +1 -0
- package/lib/js/ui/uicontainer.d.ts +3 -0
- package/lib/js/ui/uicontainer.js +61 -0
- package/lib/js/ui/uicontainer.js.map +1 -0
- package/lib/js/utilities/localizationconfig.d.ts +6 -0
- package/lib/js/utilities/localizationconfig.js +8 -0
- package/lib/js/utilities/localizationconfig.js.map +1 -0
- package/lib/js/utilities/printversion.d.ts +1 -0
- package/lib/js/utilities/printversion.js +28 -0
- package/lib/js/utilities/printversion.js.map +1 -0
- package/lib/js/utilities/utilities.d.ts +60 -0
- package/lib/js/utilities/utilities.js +110 -0
- package/lib/js/utilities/utilities.js.map +1 -0
- package/lib/lang/nl.json +72 -0
- package/lib/npoplayer.d.ts +45 -0
- package/lib/npoplayer.js +518 -0
- package/lib/npoplayer.js.map +1 -0
- package/lib/npoplayer.test.d.ts +1 -0
- package/lib/npoplayer.test.js +12 -0
- package/lib/npoplayer.test.js.map +1 -0
- package/lib/package.json +88 -0
- package/lib/src/js/ads/ster.d.ts +4 -0
- package/lib/src/js/ads/ster.test.d.ts +1 -0
- package/lib/src/js/api/getstreamobject.d.ts +3 -0
- package/lib/src/js/cdnproviders.d.ts +1 -0
- package/lib/src/js/checks/safari.d.ts +1 -0
- package/lib/src/js/checks/safari.test.d.ts +1 -0
- package/lib/src/js/drm/verifydrm.d.ts +4 -0
- package/lib/src/js/drm/verifydrm.test.d.ts +1 -0
- package/lib/src/js/fragments/setfragments.d.ts +3 -0
- package/lib/src/js/playeractions/customerrors.test.d.ts +1 -0
- package/lib/src/js/playeractions/handlers/customerrors.d.ts +50 -0
- package/lib/src/js/playeractions/handlers/error.d.ts +3 -0
- package/lib/src/js/playeractions/handlers/error.test.d.ts +1 -0
- package/lib/src/js/playeractions/handlers/handleoffsets.d.ts +6 -0
- package/lib/src/js/playeractions/handlers/handleoffsets.test.d.ts +1 -0
- package/lib/src/js/playeractions/handlers/resolvekeypress.d.ts +3 -0
- package/lib/src/js/playeractions/playeractions.d.ts +3 -0
- package/lib/src/js/tracking/handlers/eventbinding.d.ts +10 -0
- package/lib/src/js/tracking/handlers/eventlogging.d.ts +11 -0
- package/lib/src/js/tracking/handlers/playertrackerinit.d.ts +13 -0
- package/lib/src/js/tracking/handlers/playertrackerstart.d.ts +8 -0
- package/lib/src/js/tracking/playertracker.d.ts +4 -0
- package/lib/src/js/ui/components/adbutton.d.ts +7 -0
- package/lib/src/js/ui/components/adlabel.d.ts +7 -0
- package/lib/src/js/ui/components/buttons.d.ts +30 -0
- package/lib/src/js/ui/components/controlbar.d.ts +3 -0
- package/lib/src/js/ui/components/ctabar.d.ts +9 -0
- package/lib/src/js/ui/components/nativemobile/buttons.d.ts +13 -0
- package/lib/src/js/ui/components/nativemobile/controlbar.d.ts +2 -0
- package/lib/src/js/ui/components/nativemobile/ctabar.d.ts +10 -0
- package/lib/src/js/ui/components/nativemobile/playnext.d.ts +10 -0
- package/lib/src/js/ui/components/nativemobile/topbar.d.ts +3 -0
- package/lib/src/js/ui/components/playnext.d.ts +11 -0
- package/lib/src/js/ui/components/settingspanel.d.ts +4 -0
- package/lib/src/js/ui/components/shared/playnextscreen.d.ts +2 -0
- package/lib/src/js/ui/components/titlebar.d.ts +3 -0
- package/lib/src/js/ui/components/topbar.d.ts +2 -0
- package/lib/src/js/ui/handlers/listboxhandlers.d.ts +5 -0
- package/lib/src/js/ui/handlers/nicamhandler.d.ts +2 -0
- package/lib/src/js/ui/handlers/nicamhandler.test.d.ts +1 -0
- package/lib/src/js/ui/handlers/playnexthandlers.d.ts +0 -0
- package/lib/src/js/ui/handlers/timecontrolhandlers.d.ts +3 -0
- package/lib/src/js/ui/nativemobileui.d.ts +6 -0
- package/lib/src/js/ui/uicontainer.d.ts +3 -0
- package/lib/src/js/utilities/localizationconfig.d.ts +6 -0
- package/lib/src/js/utilities/printversion.d.ts +1 -0
- package/lib/src/js/utilities/utilities.d.ts +60 -0
- package/lib/src/npoplayer.d.ts +45 -0
- package/lib/src/npoplayer.test.d.ts +1 -0
- package/lib/src/types/classes.d.ts +4 -0
- package/lib/src/types/interfaces.d.ts +105 -0
- package/lib/types/classes.d.ts +4 -0
- package/lib/types/classes.js +4 -0
- package/lib/types/classes.js.map +1 -0
- package/lib/types/interfaces.d.ts +105 -0
- package/lib/types/interfaces.js +6 -0
- package/lib/types/interfaces.js.map +1 -0
- package/package.json +88 -0
- package/src/scss/components/_advert.scss +74 -0
- package/src/scss/components/_buffering.scss +6 -0
- package/src/scss/components/_container.scss +8 -0
- package/src/scss/components/_controlbars.scss +36 -0
- package/src/scss/components/_error.scss +26 -0
- package/src/scss/components/_fonts.scss +19 -0
- package/src/scss/components/_icons.scss +241 -0
- package/src/scss/components/_nicam.scss +61 -0
- package/src/scss/components/_playnext.scss +52 -0
- package/src/scss/components/_seekbar.scss +116 -0
- package/src/scss/components/_settingspanel.scss +196 -0
- package/src/scss/components/_subtitles.scss +32 -0
- package/src/scss/components/_textbuttons.scss +42 -0
- package/src/scss/components/_volumeslider.scss +23 -0
- package/src/scss/npoplayer.css +1238 -0
- package/src/scss/npoplayer.scss +37 -0
- package/src/scss/variants/_player-base.scss +64 -0
- package/src/scss/variants/_player-large.scss +56 -0
- package/src/scss/variants/_player-medium.scss +57 -0
- package/src/scss/variants/_player-small.scss +234 -0
- package/src/scss/vars/_colors.scss +24 -0
- package/src/scss/vars/_fonts.scss +20 -0
- package/src/scss/vars/_icons.scss +37 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file handles the processing of NICAM and Agerating metadata to display the relevant Kijkwijzer icons on the player
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* This function processes the ageRating and nicam metadata and adds the relevant icons to the player
|
|
6
|
+
* @function processNicam
|
|
7
|
+
* @param {StreamObject} streamObject - The stream object
|
|
8
|
+
* @param {string} containerId - The id of the player container element (this is used to avoid conflicts with multiple players on one page)
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
export function processNicam(streamObject, containerId) {
|
|
12
|
+
const nicamElement = document.querySelector(`#${containerId} .bmpui-nicam`);
|
|
13
|
+
if (nicamElement) {
|
|
14
|
+
nicamElement.innerHTML = "";
|
|
15
|
+
streamObject.metadata.ageRating && addNicamIcon(streamObject.metadata.ageRating, nicamElement);
|
|
16
|
+
streamObject.metadata.nicam?.forEach((character) => addNicamIcon(character, nicamElement));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
* This function adds the relevant Kijkwijzer icon to the player
|
|
21
|
+
* @function addNicamIcon
|
|
22
|
+
* @param {string} character - The character to add the icon for
|
|
23
|
+
* @param {Element} nicamElement - The element to add the icon to
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
function addNicamIcon(character, nicamElement) {
|
|
27
|
+
const iconClass = "nicam-icon-" + character.toLowerCase();
|
|
28
|
+
const span = document.createElement("span");
|
|
29
|
+
span.classList.add("nicam-icon", iconClass);
|
|
30
|
+
nicamElement.appendChild(span);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=nicamhandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nicamhandler.js","sourceRoot":"","sources":["../../../../../src/js/ui/handlers/nicamhandler.ts"],"names":[],"mappings":"AAAA;;EAEE;AAIF;;;;;;EAME;AACF,MAAM,UAAU,YAAY,CAAC,YAA0B,EAAE,WAAmB;IACxE,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,eAAe,CAAC,CAAC;IAC5E,IAAI,YAAY,EAAE;QACd,YAAY,CAAC,SAAS,GAAG,EAAE,CAAC;QAC5B,YAAY,CAAC,QAAQ,CAAC,SAAS,IAAI,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC/F,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,SAAiB,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;KACtG;AACL,CAAC;AAED;;;;;;EAME;AACF,SAAS,YAAY,CAAC,SAAiB,EAAE,YAAqB;IAC1D,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAC1D,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC5C,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { processNicam } from './nicamhandler';
|
|
2
|
+
describe("NICAM Processing", () => {
|
|
3
|
+
let mockElement;
|
|
4
|
+
let mockStreamObject;
|
|
5
|
+
let containerId = 'testId';
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
mockElement = { innerHTML: '', appendChild: jest.fn() };
|
|
8
|
+
document.querySelector = jest.fn().mockReturnValue(mockElement);
|
|
9
|
+
mockStreamObject = {
|
|
10
|
+
metadata: {
|
|
11
|
+
ageRating: '12',
|
|
12
|
+
nicam: ["GEWELD", "ANGST", "GROF_TAALGEBRUIK"]
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
it("processes NICAM and age rating", () => {
|
|
17
|
+
processNicam(mockStreamObject, containerId);
|
|
18
|
+
expect(document.querySelector).toHaveBeenCalledWith(`#${containerId} .bmpui-nicam`);
|
|
19
|
+
expect(mockElement.innerHTML).toBe("");
|
|
20
|
+
expect(mockElement.appendChild).toHaveBeenCalledTimes(4);
|
|
21
|
+
});
|
|
22
|
+
it("does nothing if no NICAM element found", () => {
|
|
23
|
+
document.querySelector = jest.fn().mockReturnValue(null);
|
|
24
|
+
processNicam(mockStreamObject, containerId);
|
|
25
|
+
expect(document.querySelector).toHaveBeenCalledWith(`#${containerId} .bmpui-nicam`);
|
|
26
|
+
});
|
|
27
|
+
it("does nothing if no metadata", () => {
|
|
28
|
+
mockStreamObject.metadata = {};
|
|
29
|
+
processNicam(mockStreamObject, containerId);
|
|
30
|
+
expect(document.querySelector).toHaveBeenCalledWith(`#${containerId} .bmpui-nicam`);
|
|
31
|
+
expect(mockElement.appendChild).not.toHaveBeenCalled();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=nicamhandler.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,oBAAoB,CAAC,IAAI,WAAW,eAAe,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACnC,gBAAgB,CAAC,QAAQ,GAAG,EAAE,CAAC;QAC/B,YAAY,CAAC,gBAAuB,EAAE,WAAW,CAAC,CAAC;QACnD,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,oBAAoB,CAAC,IAAI,WAAW,eAAe,CAAC,CAAC;QACpF,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playnexthandlers.js","sourceRoot":"","sources":["../../../../../src/js/ui/handlers/playnexthandlers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
|
+
const interval = 10;
|
|
3
|
+
export function rewind(player) {
|
|
4
|
+
if (player != null) {
|
|
5
|
+
if (player.isLive()) {
|
|
6
|
+
player.timeShift(player.getTimeShift() - interval);
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
player.seek(Math.max(0, player.getCurrentTime() - interval));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function forward(player) {
|
|
14
|
+
if (player != null) {
|
|
15
|
+
if (player.isLive()) {
|
|
16
|
+
player.timeShift(Math.min(0, player.getTimeShift() + interval));
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
player.seek(Math.min(player.getDuration(), player.getCurrentTime() + interval));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=timecontrolhandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timecontrolhandlers.js","sourceRoot":"","sources":["../../../../../src/js/ui/handlers/timecontrolhandlers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAIrE,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB,MAAM,UAAU,MAAM,CAAE,MAAwB;IAC5C,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE;YACjB,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,QAAQ,CAAC,CAAA;SACrD;aAAM;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,cAAc,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA;SAC/D;KACJ;AACL,CAAC;AAED,MAAM,UAAU,OAAO,CAAE,MAAwB;IAC7C,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE;YACjB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA;SAClE;aAAM;YACH,MAAM,CAAC,IAAI,CACP,IAAI,CAAC,GAAG,CACJ,MAAM,CAAC,WAAW,EAAE,EACpB,MAAM,CAAC,cAAc,EAAE,GAAG,QAAQ,CACrC,CACJ,CAAA;SACJ;KACJ;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UIContainer } from 'bitmovin-player-ui';
|
|
2
|
+
import { PlayerAPI } from 'bitmovin-player';
|
|
3
|
+
import { CustomMessages } from '../../types/interfaces';
|
|
4
|
+
export declare function sendCustomMessage(message: CustomMessages): any;
|
|
5
|
+
export declare function getCustomMessage(message: CustomMessages): {};
|
|
6
|
+
export declare function nativeMobileUIContainer(player: PlayerAPI): UIContainer;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BufferingOverlay, CastStatusOverlay, ErrorMessageOverlay, PlaybackToggleOverlay, SubtitleOverlay, UIContainer, Watermark, } from 'bitmovin-player-ui';
|
|
2
|
+
import { createPlayNextScreen } from './components/nativemobile/playnext';
|
|
3
|
+
import { createCTABar } from './components/nativemobile/ctabar';
|
|
4
|
+
import { createControlBar } from './components/nativemobile/controlbar';
|
|
5
|
+
import { createTopBar } from './components/nativemobile/topbar';
|
|
6
|
+
import { createSettingsPanel } from './components/settingspanel';
|
|
7
|
+
import { createMiddleButtons } from './components/buttons';
|
|
8
|
+
export function sendCustomMessage(message) {
|
|
9
|
+
if (window.bitmovin.customMessageHandler) {
|
|
10
|
+
return JSON.parse(window.bitmovin.customMessageHandler.sendSynchronous(message)) || {};
|
|
11
|
+
}
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
export function getCustomMessage(message) {
|
|
15
|
+
if (window.bitmovin.customMessageHandler) {
|
|
16
|
+
window.bitmovin.customMessageHandler.on(message, (data) => {
|
|
17
|
+
return JSON.parse(data || '{}');
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
export function nativeMobileUIContainer(player) {
|
|
23
|
+
const middleButtons = createMiddleButtons(player);
|
|
24
|
+
const playNextScreen = createPlayNextScreen(player);
|
|
25
|
+
const settingsPanel = createSettingsPanel(player);
|
|
26
|
+
const ctaBar = createCTABar(player);
|
|
27
|
+
const topBar = createTopBar(player, settingsPanel);
|
|
28
|
+
const controlBar = createControlBar(settingsPanel);
|
|
29
|
+
const errorMessageOverlay = new ErrorMessageOverlay();
|
|
30
|
+
// TODO: load this reponse data in the ui
|
|
31
|
+
// player.on(PlayerEvent.SourceLoaded, () => console.log('source loaded', player.getSource()));
|
|
32
|
+
return new UIContainer({
|
|
33
|
+
components: [
|
|
34
|
+
new SubtitleOverlay(),
|
|
35
|
+
new BufferingOverlay(),
|
|
36
|
+
new PlaybackToggleOverlay(),
|
|
37
|
+
new CastStatusOverlay(),
|
|
38
|
+
playNextScreen,
|
|
39
|
+
middleButtons,
|
|
40
|
+
controlBar,
|
|
41
|
+
topBar,
|
|
42
|
+
ctaBar,
|
|
43
|
+
new Watermark(),
|
|
44
|
+
errorMessageOverlay
|
|
45
|
+
],
|
|
46
|
+
cssClasses: ['npo-player', 'native-mobile'],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=nativemobileui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativemobileui.js","sourceRoot":"","sources":["../../../../src/js/ui/nativemobileui.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,WAAW,EACX,SAAS,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,UAAU,iBAAiB,CAAC,OAAuB;IACrD,IAAI,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;KACzF;IACD,OAAO,EAAE,CAAA;AACb,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAuB;IACpD,IAAI,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE;QACtC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE;YAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAA;KACL;IAED,OAAO,EAAE,CAAA;AACb,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAE,MAAiB;IACtD,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACjD,MAAM,cAAc,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAA;IACnD,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACjD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAClD,MAAM,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAA;IAElD,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAA;IAErD,yCAAyC;IACzC,+FAA+F;IAE/F,OAAO,IAAI,WAAW,CAAC;QACnB,UAAU,EAAE;YACR,IAAI,eAAe,EAAE;YACrB,IAAI,gBAAgB,EAAE;YACtB,IAAI,qBAAqB,EAAE;YAC3B,IAAI,iBAAiB,EAAE;YACvB,cAAc;YACd,aAAa;YACb,UAAU;YACV,MAAM;YACN,MAAM;YACN,IAAI,SAAS,EAAE;YACf,mBAAmB;SACtB;QACD,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;KAC9C,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { UIContainer, PlaybackToggleOverlay, BufferingOverlay, CastStatusOverlay, Watermark, SubtitleOverlay, ErrorMessageOverlay } from 'bitmovin-player-ui';
|
|
2
|
+
import { createMiddleButtons, createForwardButton, createRewindButton } from './components/buttons';
|
|
3
|
+
import { createPlayNextScreen } from './components/playnext';
|
|
4
|
+
import { createSettingsPanel } from './components/settingspanel';
|
|
5
|
+
import { createCTABar } from './components/ctabar';
|
|
6
|
+
import { createTopBar } from './components/topbar';
|
|
7
|
+
import { createControlBar } from './components/controlbar';
|
|
8
|
+
import { createTitleBar } from './components/titlebar';
|
|
9
|
+
export function createUIContainer(npoplayer, variant) {
|
|
10
|
+
let cssClassArray = ['npo-player'];
|
|
11
|
+
let uiDelay = 3000;
|
|
12
|
+
if (variant === 'default') {
|
|
13
|
+
uiDelay = 3000;
|
|
14
|
+
}
|
|
15
|
+
else if (variant === 'ad') {
|
|
16
|
+
uiDelay = -1;
|
|
17
|
+
cssClassArray.push('ster-ad');
|
|
18
|
+
}
|
|
19
|
+
const player = npoplayer.player;
|
|
20
|
+
const middleButtons = createMiddleButtons(player);
|
|
21
|
+
const rewindButton = createRewindButton(player);
|
|
22
|
+
const forwardButton = createForwardButton(player);
|
|
23
|
+
const playNextScreen = createPlayNextScreen(player, npoplayer);
|
|
24
|
+
const settingsPanel = createSettingsPanel(npoplayer);
|
|
25
|
+
const ctaBar = createCTABar(player, npoplayer, variant);
|
|
26
|
+
const topBar = createTopBar(settingsPanel);
|
|
27
|
+
const controlBar = createControlBar(npoplayer, settingsPanel, forwardButton, rewindButton);
|
|
28
|
+
const titleBar = createTitleBar(npoplayer);
|
|
29
|
+
const errorMessageOverlay = new ErrorMessageOverlay();
|
|
30
|
+
npoplayer.uiComponents.errorMessageOverlay = errorMessageOverlay;
|
|
31
|
+
const baseComponentsBefore = [
|
|
32
|
+
new SubtitleOverlay(),
|
|
33
|
+
new BufferingOverlay(),
|
|
34
|
+
new PlaybackToggleOverlay(),
|
|
35
|
+
new CastStatusOverlay(),
|
|
36
|
+
playNextScreen,
|
|
37
|
+
middleButtons,
|
|
38
|
+
];
|
|
39
|
+
const baseComponentsAfter = [
|
|
40
|
+
new Watermark(),
|
|
41
|
+
errorMessageOverlay
|
|
42
|
+
];
|
|
43
|
+
let conditionalComponents = [];
|
|
44
|
+
//only add top bar if variant = default
|
|
45
|
+
if (variant === 'default') {
|
|
46
|
+
conditionalComponents.push(controlBar);
|
|
47
|
+
conditionalComponents.push(ctaBar);
|
|
48
|
+
conditionalComponents.push(titleBar);
|
|
49
|
+
conditionalComponents.push(topBar);
|
|
50
|
+
}
|
|
51
|
+
if (variant === 'ad') {
|
|
52
|
+
conditionalComponents.push(controlBar);
|
|
53
|
+
conditionalComponents.push(ctaBar);
|
|
54
|
+
}
|
|
55
|
+
return new UIContainer({
|
|
56
|
+
components: [...baseComponentsBefore, ...conditionalComponents, ...baseComponentsAfter],
|
|
57
|
+
cssClasses: cssClassArray,
|
|
58
|
+
hideDelay: uiDelay
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=uicontainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uicontainer.js","sourceRoot":"","sources":["../../../../src/js/ui/uicontainer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,mBAAmB,EACtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,UAAU,iBAAiB,CAAE,SAAoB,EAAE,OAAe;IACpE,IAAI,aAAa,GAAG,CAAC,YAAY,CAAC,CAAA;IAClC,IAAI,OAAO,GAAU,IAAI,CAAA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ACvC,IAAI,OAAO,KAAK,SAAS,EAAE;QACvB,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACtC;IAED,IAAI,OAAO,KAAK,IAAI,EAAE;QAClB,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACtC;IAED,OAAO,IAAI,WAAW,CAAC;QACnB,UAAU,EAAE,CAAC,GAAG,oBAAoB,EAAE,GAAG,qBAAqB,EAAE,GAAG,mBAAmB,CAAC;QACvF,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,OAAO;KACrB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localizationconfig.js","sourceRoot":"","sources":["../../../../src/js/utilities/localizationconfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAE5C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE;QACV,EAAE,EAAE,MAAM,CAAC,OAA4C;KAC1D;CACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function printVersion(version: string): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// printVersion.js
|
|
2
|
+
export function printVersion(version) {
|
|
3
|
+
const asciiArt = `
|
|
4
|
+
╔▒▒╖
|
|
5
|
+
_╔╠╠╠╠╠╠╠φ_
|
|
6
|
+
_#╠╠╠╠╠╠╠╠╠╠╠#_
|
|
7
|
+
╓╔╠╠╠╠╝╝╠╠╠╠╠╠╠╠╠▒,
|
|
8
|
+
╔╬╠╠╠╠╠ '╚╠╠╠╠╠╠╠╠▒╖
|
|
9
|
+
╔╬╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╬╦
|
|
10
|
+
_╓╠╠╠╠╠╠╠╠╠╠ '╚╠╠╠╠╠╠╠╖╖
|
|
11
|
+
╠╠╠╠╠╠╠╠╠╠╠╠ ╠╠╠╠╠╠╠╠▒
|
|
12
|
+
╬╠╠╠╠╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╝
|
|
13
|
+
\`╝╠╠╠╠╠╠╠╠╠ _╔╠╠╠╠╠╠╠╠╠╩\`
|
|
14
|
+
\`╚╠╠╠╠╠╠╠ _╔╬╠╠╠╠╠╠╠╠╠╩
|
|
15
|
+
╙╠╠╠╠╠▒╗φ╬╠╠╠╠╠╠╠╠╠╠╜
|
|
16
|
+
╙╬╠╠╠╠╠╠╠╠╠╠╠╠╠╠╙
|
|
17
|
+
'╬╠╠╠╠╠╠╠╠╠╝^
|
|
18
|
+
\`╝╠╠╠╠╠╩\`
|
|
19
|
+
\`╙╙╙
|
|
20
|
+
`;
|
|
21
|
+
const title = 'NPO Player';
|
|
22
|
+
const versionString = 'version' + String(version);
|
|
23
|
+
const colorCode = '#ff6d00';
|
|
24
|
+
const titleStyle = `font-size: 24px; font-weight: bold; color: ${colorCode}; padding: 2px 4px;`;
|
|
25
|
+
const versionStyle = 'font-size: 24px; font-weight: bold; padding: 2px 4px;';
|
|
26
|
+
console.log(`%c${asciiArt}%c${title} %c${versionString}`, `color: ${colorCode}; background-color: rgb(11, 28, 54);`, titleStyle, versionStyle);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=printversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printversion.js","sourceRoot":"","sources":["../../../../src/js/utilities/printversion.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,MAAM,UAAU,YAAY,CAAE,OAAe;IACzC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;CAiBpB,CAAA;IAEG,MAAM,KAAK,GAAG,YAAY,CAAA;IAC1B,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAEjD,MAAM,SAAS,GAAG,SAAS,CAAA;IAC3B,MAAM,UAAU,GAAG,8CAA8C,SAAS,qBAAqB,CAAA;IAC/F,MAAM,YAAY,GAAG,uDAAuD,CAAA;IAE5E,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,KAAK,KAAK,MAAM,aAAa,EAAE,EAAE,UAAU,SAAS,sCAAsC,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AAClJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type LocalizableText } from 'bitmovin-player-ui/dist/js/framework/localization/i18n';
|
|
2
|
+
/**
|
|
3
|
+
* @function jwtToBase64
|
|
4
|
+
* @description Converts a JWT string to a base64 encoded string.
|
|
5
|
+
* @param {string} jwt - The JWT string to convert.
|
|
6
|
+
* @returns {string} The converted base64 string.
|
|
7
|
+
*/
|
|
8
|
+
export declare const jwtToBase64: (jwt: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* @function base64ToObject
|
|
11
|
+
* @description Converts a base64 encoded JWT string to a JSON object.
|
|
12
|
+
* @param {string} base64 - The base64 string to convert.
|
|
13
|
+
* @returns {Object} The converted JSON object.
|
|
14
|
+
*/
|
|
15
|
+
export declare const base64ToObject: (base64: string) => any;
|
|
16
|
+
/**
|
|
17
|
+
* @function noTrailingSlash
|
|
18
|
+
* @description Removes the trailing slash from the provided url if it exists.
|
|
19
|
+
* @param {string} url - The url to remove the trailing slash from.
|
|
20
|
+
* @returns {string} The url without the trailing slash.
|
|
21
|
+
*/
|
|
22
|
+
export declare const noTrailingSlash: (url: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* @function localize
|
|
25
|
+
* @description Returns the localized text for the provided key.
|
|
26
|
+
* @param {key} key - The key of the text to localize.
|
|
27
|
+
* @returns {LocalizableText} The localized text.
|
|
28
|
+
*/
|
|
29
|
+
export declare function localize(key: string): LocalizableText;
|
|
30
|
+
/**
|
|
31
|
+
* @function validateStreamLength
|
|
32
|
+
* @description Validates the provided stream duration and converts it to seconds.
|
|
33
|
+
* If the duration is null, returns -1.
|
|
34
|
+
* @param {string|number} duration - The stream duration to validate, can be either a string or a number.
|
|
35
|
+
* @returns {number} The duration in seconds or -1 if the duration is null.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateStreamLength(duration: string | number | undefined): number;
|
|
38
|
+
/**
|
|
39
|
+
* @function msToSeconds
|
|
40
|
+
* @description Converts milliseconds to seconds.
|
|
41
|
+
* @param {number} ms - The milliseconds to convert.
|
|
42
|
+
* @returns {number} The converted milliseconds.
|
|
43
|
+
*/
|
|
44
|
+
export declare function msToSeconds(ms: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* @function validatePrid
|
|
47
|
+
* @description Validates the provided prid. If the prid is null or empty, returns 'unknown'.
|
|
48
|
+
* @param {string|null} prid - The prid to validate.
|
|
49
|
+
* @returns {string} The validated prid or 'unknown' if the prid is null or empty.
|
|
50
|
+
*/
|
|
51
|
+
export declare function validatePrid(prid: string | null): string;
|
|
52
|
+
/**
|
|
53
|
+
* @function getModuleExport
|
|
54
|
+
* @description Returns the default export of a module if it exists, otherwise returns the module itself.
|
|
55
|
+
* This is used to support both ES6 and CommonJS modules.
|
|
56
|
+
* @param {unkown} module - The module to get the export from.
|
|
57
|
+
* @returns {unknown} module - The multicompatible module export.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getModuleExport(module: unknown): unknown;
|
|
60
|
+
export declare function airPlaySupported(): boolean;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file contains small utility functions that have no relation to the broader player logic
|
|
3
|
+
*/
|
|
4
|
+
import { i18n } from 'bitmovin-player-ui/dist/js/framework/localization/i18n';
|
|
5
|
+
/**
|
|
6
|
+
* @function jwtToBase64
|
|
7
|
+
* @description Converts a JWT string to a base64 encoded string.
|
|
8
|
+
* @param {string} jwt - The JWT string to convert.
|
|
9
|
+
* @returns {string} The converted base64 string.
|
|
10
|
+
*/
|
|
11
|
+
export const jwtToBase64 = (jwt) => {
|
|
12
|
+
return jwt.toString().split('.')[1].replace('-', '+').replace('_', '/');
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @function base64ToObject
|
|
16
|
+
* @description Converts a base64 encoded JWT string to a JSON object.
|
|
17
|
+
* @param {string} base64 - The base64 string to convert.
|
|
18
|
+
* @returns {Object} The converted JSON object.
|
|
19
|
+
*/
|
|
20
|
+
export const base64ToObject = (base64) => {
|
|
21
|
+
return JSON.parse(decodeURIComponent(window
|
|
22
|
+
.atob(base64)
|
|
23
|
+
.split('')
|
|
24
|
+
.map(function (c) {
|
|
25
|
+
return ('%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2));
|
|
26
|
+
})
|
|
27
|
+
.join('')));
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @function noTrailingSlash
|
|
31
|
+
* @description Removes the trailing slash from the provided url if it exists.
|
|
32
|
+
* @param {string} url - The url to remove the trailing slash from.
|
|
33
|
+
* @returns {string} The url without the trailing slash.
|
|
34
|
+
*/
|
|
35
|
+
export const noTrailingSlash = (url) => {
|
|
36
|
+
return url.slice(-1) === '/' ? (url = url.slice(0, -1)) : url;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @function localize
|
|
40
|
+
* @description Returns the localized text for the provided key.
|
|
41
|
+
* @param {key} key - The key of the text to localize.
|
|
42
|
+
* @returns {LocalizableText} The localized text.
|
|
43
|
+
*/
|
|
44
|
+
export function localize(key) {
|
|
45
|
+
return i18n.getLocalizer(key);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @function validateStreamLength
|
|
49
|
+
* @description Validates the provided stream duration and converts it to seconds.
|
|
50
|
+
* If the duration is null, returns -1.
|
|
51
|
+
* @param {string|number} duration - The stream duration to validate, can be either a string or a number.
|
|
52
|
+
* @returns {number} The duration in seconds or -1 if the duration is null.
|
|
53
|
+
*/
|
|
54
|
+
export function validateStreamLength(duration) {
|
|
55
|
+
return duration !== null ? msToSeconds(Number(duration)) : -1;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @function msToSeconds
|
|
59
|
+
* @description Converts milliseconds to seconds.
|
|
60
|
+
* @param {number} ms - The milliseconds to convert.
|
|
61
|
+
* @returns {number} The converted milliseconds.
|
|
62
|
+
*/
|
|
63
|
+
export function msToSeconds(ms) {
|
|
64
|
+
return ms / 1000;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @function validatePrid
|
|
68
|
+
* @description Validates the provided prid. If the prid is null or empty, returns 'unknown'.
|
|
69
|
+
* @param {string|null} prid - The prid to validate.
|
|
70
|
+
* @returns {string} The validated prid or 'unknown' if the prid is null or empty.
|
|
71
|
+
*/
|
|
72
|
+
export function validatePrid(prid) {
|
|
73
|
+
return prid !== '' && prid !== null ? prid : 'unknown';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @function getModuleExport
|
|
77
|
+
* @description Returns the default export of a module if it exists, otherwise returns the module itself.
|
|
78
|
+
* This is used to support both ES6 and CommonJS modules.
|
|
79
|
+
* @param {unkown} module - The module to get the export from.
|
|
80
|
+
* @returns {unknown} module - The multicompatible module export.
|
|
81
|
+
*/
|
|
82
|
+
export function getModuleExport(module) {
|
|
83
|
+
if (typeof module === 'object' && module !== null && 'default' in module) {
|
|
84
|
+
return module.default;
|
|
85
|
+
}
|
|
86
|
+
return module;
|
|
87
|
+
}
|
|
88
|
+
export function airPlaySupported() {
|
|
89
|
+
let hasAirPlay = false;
|
|
90
|
+
if (window.WebKitPlaybackTargetAvailabilityEvent == null || undefined) {
|
|
91
|
+
console.log('WebkitPlaybackTargetAvailabilityEvent is not available');
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
console.log('WebkitPlaybackTargetAvailabilityEvent is available');
|
|
95
|
+
window.addEventListener('webkitplaybacktargetavailabilitychanged', function (event) {
|
|
96
|
+
console.log('event', event);
|
|
97
|
+
switch (event.availability) {
|
|
98
|
+
case "available":
|
|
99
|
+
console.log('Airplay is available');
|
|
100
|
+
hasAirPlay = true;
|
|
101
|
+
break;
|
|
102
|
+
case "not-available":
|
|
103
|
+
console.log('Airplay is not available');
|
|
104
|
+
hasAirPlay = false;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return hasAirPlay;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../../src/js/utilities/utilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,IAAI,EAEP,MAAM,wDAAwD,CAAA;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAC3E,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC7C,OAAO,IAAI,CAAC,KAAK,CACb,kBAAkB,CACd,MAAM;SACD,IAAI,CAAC,MAAM,CAAC;SACZ,KAAK,CAAC,EAAE,CAAC;SACT,GAAG,CAAC,UAAU,CAAC;QACZ,OAAO,CACH,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACxD,CAAA;IACL,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,C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AI,IAAI,SAAS,EAAE;QAC5E,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAA;QACrE,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAA;IACjE,MAAM,CAAC,gBAAgB,CAAC,yCAAyC,EAAE,UAAS,KAAU;QAClF,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC3B,QAAQ,KAAK,CAAC,YAAY,EAAE;YACxB,KAAK,WAAW;gBACZ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;gBACnC,UAAU,GAAG,IAAI,CAAC;gBAClB,MAAM;YACV,KAAK,eAAe;gBAChB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;gBACvC,UAAU,GAAG,KAAK,CAAC;gBACnB,MAAM;SACb;IACL,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
package/lib/lang/nl.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings.video.quality": "Kwaliteit",
|
|
3
|
+
"settings.audio.quality": "Audio kwaliteit",
|
|
4
|
+
"settings.audio.track": "Audio Track",
|
|
5
|
+
"settings.audio.mute": "Mute",
|
|
6
|
+
"settings.audio.volume": "Volume",
|
|
7
|
+
"settings.subtitles.window.color": "Venster kleur",
|
|
8
|
+
"settings.subtitles.window.opacity": "Venster zichtbaarheid",
|
|
9
|
+
"settings.subtitles": "Ondertiteling",
|
|
10
|
+
"settings.subtitles.font.color": "Tekst kleur",
|
|
11
|
+
"settings.subtitles.font.opacity": "Tekst opacity",
|
|
12
|
+
"settings.subtitles.background.color": "Background color",
|
|
13
|
+
"settings.subtitles.background.opacity": "Background opacity",
|
|
14
|
+
"colors.white": "wit",
|
|
15
|
+
"colors.black": "zwart",
|
|
16
|
+
"colors.red": "rood",
|
|
17
|
+
"colors.green": "groen",
|
|
18
|
+
"colors.blue": "blauw",
|
|
19
|
+
"colors.cyan": "cyaan",
|
|
20
|
+
"colors.yellow": "geel",
|
|
21
|
+
"colors.magenta": "magenta",
|
|
22
|
+
"percent": "{value}%",
|
|
23
|
+
"settings.subtitles.font.size": "Tekst grootte",
|
|
24
|
+
"settings.subtitles.characterEdge": "Character edge",
|
|
25
|
+
"settings.subtitles.characterEdge.raised": "raised",
|
|
26
|
+
"settings.subtitles.characterEdge.depressed": "depressed",
|
|
27
|
+
"settings.subtitles.characterEdge.uniform": "uniform",
|
|
28
|
+
"settings.subtitles.characterEdge.dropshadowed": "drop shadowed",
|
|
29
|
+
"settings.subtitles.font.family": "Lettertype",
|
|
30
|
+
"settings.subtitles.font.family.monospacedserif": "monospaced serif",
|
|
31
|
+
"settings.subtitles.font.family.proportionalserif": "proportional serif",
|
|
32
|
+
"settings.subtitles.font.family.monospacedsansserif": "monospaced sans serif",
|
|
33
|
+
"settings.subtitles.font.family.proportionalsansserif": "proportional sans serif",
|
|
34
|
+
"settings.subtitles.font.family.casual": "casual",
|
|
35
|
+
"settings.subtitles.font.family.cursive": "cursive",
|
|
36
|
+
"settings.subtitles.font.family.smallcapital": "small capital",
|
|
37
|
+
"settings.time.hours": "Uren",
|
|
38
|
+
"settings.time.minutes": "Minuten",
|
|
39
|
+
"settings.time.seconds": "Secondes",
|
|
40
|
+
"ads.remainingTime": "De advertentie duurt nog {remainingTime} seconden.",
|
|
41
|
+
"settings": "Instellingen",
|
|
42
|
+
"fullscreen": "Volledig scherm",
|
|
43
|
+
"speed": "Snelheid",
|
|
44
|
+
"playPause": "Play/Pauzeer",
|
|
45
|
+
"play": "Play",
|
|
46
|
+
"pause": "Pauzeer",
|
|
47
|
+
"open": "open",
|
|
48
|
+
"close": "sluit",
|
|
49
|
+
"pictureInPicture": "Picture-in-Picture",
|
|
50
|
+
"appleAirplay": "Apple AirPlay",
|
|
51
|
+
"googleCast": "Google Cast",
|
|
52
|
+
"vr": "VR",
|
|
53
|
+
"off": "Geen",
|
|
54
|
+
"auto": "automatisch",
|
|
55
|
+
"back": "Terug",
|
|
56
|
+
"reset": "Reset",
|
|
57
|
+
"replay": "Replay",
|
|
58
|
+
"normal": "normaal",
|
|
59
|
+
"default": "standaard",
|
|
60
|
+
"live": "Live",
|
|
61
|
+
"subtitle.example": "voorbeeld ondertiteling",
|
|
62
|
+
"subtitle.select": "Selecteer ondertiteling",
|
|
63
|
+
"playingOn": "Speelt af op <strong>{castDeviceName}</strong>",
|
|
64
|
+
"connectingTo": "Maakt verbinding met <strong>{castDeviceName}</strong>...",
|
|
65
|
+
"watermarkLink": "Link to Homepage",
|
|
66
|
+
"controlBar": "Video speler controls",
|
|
67
|
+
"player": "Video speler",
|
|
68
|
+
"seekBar": "Video tijdlijn",
|
|
69
|
+
"seekBar.value": "Waarde",
|
|
70
|
+
"seekBar.timeshift": "Timeshift",
|
|
71
|
+
"seekBar.durationText": "out of"
|
|
72
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type StreamTracker, type NPOTag } from '@npotag/tag';
|
|
2
|
+
import { type InitialisationProps } from '@npotag/tag/dist/types/src/npoTag';
|
|
3
|
+
import { type PlayerAPI, type PlayerConfig, type SourceConfig } from 'bitmovin-player';
|
|
4
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
5
|
+
import { LogEmitter } from './types/classes';
|
|
6
|
+
import { type ApiPayload, type Fragments, type NPOTagObject, type Profile, type Section, type StreamObject, type StreamOptions, type UIComponents } from './types/interfaces';
|
|
7
|
+
export default class NpoPlayer {
|
|
8
|
+
playerConfig: PlayerConfig;
|
|
9
|
+
sourceConfig: SourceConfig;
|
|
10
|
+
streamObject: StreamObject;
|
|
11
|
+
player: PlayerAPI | null;
|
|
12
|
+
uiManager: UIManager | null;
|
|
13
|
+
npoTag: NPOTagObject | undefined;
|
|
14
|
+
streamTracker: StreamTracker | null;
|
|
15
|
+
logEmitter: LogEmitter;
|
|
16
|
+
uiComponents: UIComponents;
|
|
17
|
+
fragment: Section | null;
|
|
18
|
+
container: HTMLElement;
|
|
19
|
+
streamOptions: StreamOptions;
|
|
20
|
+
jwt: string;
|
|
21
|
+
apiPayload: ApiPayload;
|
|
22
|
+
adBreakActive: boolean;
|
|
23
|
+
version: string;
|
|
24
|
+
constructor(_container: HTMLElement, _playerConfig: PlayerConfig, _npotag?: InitialisationProps | null, _npotaginstance?: NPOTag);
|
|
25
|
+
initPlayer(_container: HTMLElement, playerConfig: PlayerConfig): void;
|
|
26
|
+
loadStream(_jwt: string, options?: StreamOptions): Promise<void>;
|
|
27
|
+
createUIManager(player: PlayerAPI, variant: string): Promise<void>;
|
|
28
|
+
setFragments(fragments: Fragments): Promise<void>;
|
|
29
|
+
decideProfile(preferredDRM?: string): Promise<Profile>;
|
|
30
|
+
processSourceConfig(_sourceConfig: SourceConfig | undefined, _streamObject: StreamObject, drm?: string | null): SourceConfig;
|
|
31
|
+
doError(input: any): void;
|
|
32
|
+
keyPress(e: KeyboardEvent): void;
|
|
33
|
+
setVolume(volume: number): void;
|
|
34
|
+
increaseVolume(): void;
|
|
35
|
+
decreaseVolume(): void;
|
|
36
|
+
goForward(seconds: number): void;
|
|
37
|
+
goBackwards(seconds: number): void;
|
|
38
|
+
watchFromStart(): void;
|
|
39
|
+
showPlayNextScreen(): void;
|
|
40
|
+
hidePlayNextScreen(): void;
|
|
41
|
+
doPlayNext(): void;
|
|
42
|
+
destroy(): boolean;
|
|
43
|
+
unload(): boolean;
|
|
44
|
+
isFairPlayDrmSupported(ks?: any): boolean;
|
|
45
|
+
}
|