@npo/player 1.22.5 → 1.23.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/ads/ster.js +20 -18
- package/lib/js/ads/ster.test.js +17 -17
- package/lib/js/api/getstreamobject.js +7 -7
- package/lib/js/api/getstreamobject.test.js +3 -3
- package/lib/js/markers/updateLiveMarkers.d.ts +3 -3
- package/lib/js/markers/updateLiveMarkers.js +14 -15
- package/lib/js/markers/updateLiveMarkers.test.js +11 -12
- package/lib/js/playeractions/customerrors.test.js +33 -33
- package/lib/js/playeractions/handlers/customerrors.js +48 -48
- package/lib/js/playeractions/handlers/error.js +1 -1
- package/lib/js/playeractions/handlers/error.test.js +11 -11
- package/lib/js/playeractions/handlers/handleoffsets.d.ts +2 -2
- package/lib/js/playeractions/handlers/handleoffsets.js +6 -6
- package/lib/js/playeractions/handlers/handleoffsets.test.js +12 -12
- package/lib/js/playeractions/handlers/mediasessionactions.d.ts +1 -1
- package/lib/js/playeractions/handlers/mediasessionactions.js +20 -15
- package/lib/js/playeractions/handlers/processplayerconfig.d.ts +2 -2
- package/lib/js/playeractions/handlers/processplayerconfig.js +4 -4
- package/lib/js/playeractions/handlers/processsourceconfig.d.ts +2 -1
- package/lib/js/playeractions/handlers/processsourceconfig.js +52 -46
- package/lib/js/playeractions/handlers/removereplayclass.d.ts +1 -1
- package/lib/js/playeractions/handlers/removereplayclass.test.d.ts +1 -1
- package/lib/js/playeractions/handlers/removereplayclass.test.js +7 -6
- package/lib/js/playeractions/playeractions.d.ts +4 -5
- package/lib/js/playeractions/playeractions.js +4 -5
- package/lib/js/settings/settings.user-agent.d.ts +1 -0
- package/lib/js/settings/settings.user-agent.js +1 -0
- package/lib/js/tracking/handlers/eventbinding.js +9 -9
- package/lib/js/tracking/handlers/eventlogging.js +2 -2
- package/lib/js/tracking/handlers/eventlogging.test.js +2 -2
- package/lib/js/tracking/handlers/playertrackerinit.d.ts +1 -1
- package/lib/js/tracking/handlers/playertrackerinit.js +5 -11
- package/lib/js/tracking/handlers/playertrackerstart.d.ts +1 -1
- package/lib/js/tracking/handlers/playertrackerstart.js +5 -10
- package/lib/js/utilities/utilities.element.d.ts +10 -0
- package/lib/js/utilities/utilities.element.js +8 -0
- package/lib/js/utilities/utilities.element.test.js +25 -0
- package/lib/js/utilities/utilities.jwt.d.ts +3 -0
- package/lib/js/utilities/utilities.jwt.js +22 -0
- package/lib/js/utilities/utilities.jwt.test.js +32 -0
- package/lib/js/utilities/utilities.locale.d.ts +2 -0
- package/lib/js/utilities/utilities.locale.js +4 -0
- package/lib/js/utilities/utilities.locale.test.js +10 -0
- package/lib/js/utilities/utilities.module.d.ts +1 -0
- package/lib/js/utilities/utilities.module.js +4 -0
- package/lib/js/utilities/utilities.module.test.js +19 -0
- package/lib/js/utilities/utilities.stream.d.ts +7 -0
- package/lib/js/utilities/utilities.stream.js +10 -0
- package/lib/js/utilities/utilities.stream.test.js +32 -0
- package/lib/js/utilities/utilities.text.d.ts +1 -0
- package/lib/js/utilities/utilities.text.js +3 -0
- package/lib/js/utilities/utilities.text.test.js +18 -0
- package/lib/js/utilities/utilities.time.d.ts +1 -0
- package/lib/js/utilities/utilities.time.js +3 -0
- package/lib/js/utilities/utilities.time.test.js +8 -0
- package/lib/js/utilities/utilities.url.d.ts +3 -0
- package/lib/js/utilities/utilities.url.js +29 -0
- package/lib/js/utilities/utilities.url.test.js +46 -0
- package/lib/js/utilities/utilities.user-agent.d.ts +3 -0
- package/lib/js/utilities/utilities.user-agent.js +13 -0
- package/lib/js/utilities/utilities.user-agent.test.js +60 -0
- package/lib/js/utilities/utilities.version.d.ts +1 -0
- package/lib/js/utilities/{printversion.js → utilities.version.js} +8 -8
- package/lib/js/utilities/utilities.version.test.js +26 -0
- package/lib/lang/nl.json +2 -1
- package/lib/npoplayer-bridge.test.d.ts +1 -1
- package/lib/npoplayer-bridge.test.js +6 -5
- package/lib/npoplayer.d.ts +14 -10
- package/lib/npoplayer.js +115 -123
- package/lib/npoplayer.test.js +3 -3
- package/lib/package.json +19 -12
- package/lib/services/a11y/setup.d.ts +2 -0
- package/lib/services/a11y/setup.js +18 -0
- package/lib/services/a11y/setup.test.js +109 -0
- package/lib/services/avTypeHandlers/getAVType.d.ts +2 -0
- package/lib/services/avTypeHandlers/getAVType.js +9 -0
- package/lib/services/avTypeHandlers/getAVType.test.js +18 -0
- package/lib/services/drmHandlers/constants.d.ts +15 -0
- package/lib/services/drmHandlers/constants.js +13 -0
- package/lib/services/drmHandlers/decideprofile.d.ts +2 -0
- package/lib/services/drmHandlers/decideprofile.js +51 -0
- package/lib/services/drmHandlers/decideprofile.test.js +34 -0
- package/lib/services/drmHandlers/drmhandlers.d.ts +2 -0
- package/lib/services/drmHandlers/drmhandlers.js +2 -0
- package/lib/services/drmHandlers/utils.d.ts +5 -0
- package/lib/services/drmHandlers/utils.js +26 -0
- package/lib/services/drmHandlers/utils.test.js +74 -0
- package/lib/services/drmHandlers/verifydrm.d.ts +2 -0
- package/lib/services/drmHandlers/verifydrm.js +40 -0
- package/lib/services/drmHandlers/verifydrm.test.js +89 -0
- package/lib/services/eventListenerHandlers/removeEventListeners.d.ts +2 -0
- package/lib/services/eventListenerHandlers/removeEventListeners.js +18 -0
- package/lib/services/eventListenerHandlers/removeEventListeners.test.js +27 -0
- package/lib/services/keyboardHandlers/resolvekeypress.d.ts +2 -0
- package/lib/services/keyboardHandlers/resolvekeypress.js +49 -0
- package/lib/{js/playeractions/handlers → services/keyboardHandlers}/resolvekeypress.test.js +21 -13
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.d.ts +6 -0
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.js +35 -0
- package/lib/services/localStorageHandlers/localStorageHandlers.d.ts +4 -0
- package/lib/services/localStorageHandlers/localStorageHandlers.js +33 -0
- package/lib/services/localStorageHandlers/localStorageHandlers.test.js +109 -0
- package/lib/services/npoPlayerAPI/npoPlayerAPI.d.ts +30 -0
- package/lib/services/npoPlayerAPI/npoPlayerAPI.js +91 -0
- package/lib/services/npoPlayerAPI/npoPlayerAPI.test.js +51 -0
- package/lib/services/segmentHandlers/addSegmentEventListeners.d.ts +2 -0
- package/lib/services/segmentHandlers/addSegmentEventListeners.js +14 -0
- package/lib/services/segmentHandlers/addSegmentEventListeners.test.js +43 -0
- package/lib/services/segmentHandlers/convertFragmentToSegment.d.ts +2 -0
- package/lib/services/segmentHandlers/convertFragmentToSegment.js +8 -0
- package/lib/services/segmentHandlers/convertFragmentToSegment.test.js +17 -0
- package/lib/services/segmentHandlers/handleSegmentSeek.d.ts +5 -0
- package/lib/services/segmentHandlers/handleSegmentSeek.js +15 -0
- package/lib/services/segmentHandlers/handleSegmentSeek.test.js +73 -0
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.d.ts +2 -0
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.js +21 -0
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +1 -0
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.js +34 -0
- package/lib/services/segmentHandlers/initSegment.d.ts +7 -0
- package/lib/services/segmentHandlers/initSegment.js +10 -0
- package/lib/services/segmentHandlers/initSegment.test.d.ts +1 -0
- package/lib/services/segmentHandlers/initSegment.test.js +36 -0
- package/lib/services/segmentHandlers/setSegmentMarkers.d.ts +2 -0
- package/lib/services/segmentHandlers/setSegmentMarkers.js +25 -0
- package/lib/services/segmentHandlers/setSegmentMarkers.test.d.ts +1 -0
- package/lib/services/segmentHandlers/setSegmentMarkers.test.js +32 -0
- package/lib/services/services.d.ts +14 -0
- package/lib/services/services.js +47 -0
- package/lib/src/js/markers/updateLiveMarkers.d.ts +3 -3
- package/lib/src/js/playeractions/handlers/handleoffsets.d.ts +2 -2
- package/lib/src/js/playeractions/handlers/mediasessionactions.d.ts +1 -1
- package/lib/src/js/playeractions/handlers/processplayerconfig.d.ts +2 -2
- package/lib/src/js/playeractions/handlers/processsourceconfig.d.ts +2 -1
- package/lib/src/js/playeractions/handlers/removereplayclass.d.ts +1 -1
- package/lib/src/js/playeractions/handlers/removereplayclass.test.d.ts +1 -1
- package/lib/src/js/playeractions/playeractions.d.ts +4 -5
- package/lib/src/js/settings/settings.user-agent.d.ts +1 -0
- package/lib/src/js/tracking/handlers/playertrackerinit.d.ts +1 -1
- package/lib/src/js/tracking/handlers/playertrackerstart.d.ts +1 -1
- package/lib/src/js/utilities/utilities.element.d.ts +10 -0
- package/lib/src/js/utilities/utilities.element.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.jwt.d.ts +3 -0
- package/lib/src/js/utilities/utilities.jwt.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.locale.d.ts +2 -0
- package/lib/src/js/utilities/utilities.locale.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.module.d.ts +1 -0
- package/lib/src/js/utilities/utilities.module.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.stream.d.ts +7 -0
- package/lib/src/js/utilities/utilities.stream.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.text.d.ts +1 -0
- package/lib/src/js/utilities/utilities.text.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.time.d.ts +1 -0
- package/lib/src/js/utilities/utilities.time.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.url.d.ts +3 -0
- package/lib/src/js/utilities/utilities.url.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.user-agent.d.ts +3 -0
- package/lib/src/js/utilities/utilities.user-agent.test.d.ts +1 -0
- package/lib/src/js/utilities/utilities.version.d.ts +1 -0
- package/lib/src/js/utilities/utilities.version.test.d.ts +1 -0
- package/lib/src/npoplayer-bridge.test.d.ts +1 -1
- package/lib/src/npoplayer.d.ts +14 -10
- package/lib/src/services/a11y/setup.d.ts +2 -0
- package/lib/src/services/a11y/setup.test.d.ts +1 -0
- package/lib/src/services/avTypeHandlers/getAVType.d.ts +2 -0
- package/lib/src/services/avTypeHandlers/getAVType.test.d.ts +1 -0
- package/lib/src/services/drmHandlers/constants.d.ts +15 -0
- package/lib/src/services/drmHandlers/decideprofile.d.ts +2 -0
- package/lib/src/services/drmHandlers/decideprofile.test.d.ts +1 -0
- package/lib/src/services/drmHandlers/drmhandlers.d.ts +2 -0
- package/lib/src/services/drmHandlers/utils.d.ts +5 -0
- package/lib/src/services/drmHandlers/utils.test.d.ts +1 -0
- package/lib/src/services/drmHandlers/verifydrm.d.ts +2 -0
- package/lib/src/services/drmHandlers/verifydrm.test.d.ts +1 -0
- package/lib/src/services/eventListenerHandlers/removeEventListeners.d.ts +2 -0
- package/lib/src/services/eventListenerHandlers/removeEventListeners.test.d.ts +1 -0
- package/lib/src/services/keyboardHandlers/resolvekeypress.d.ts +2 -0
- package/lib/src/services/keyboardHandlers/resolvekeypress.test.d.ts +1 -0
- package/lib/src/services/liveStreamHandlers/handleLiveStreamControls.d.ts +6 -0
- package/lib/src/services/localStorageHandlers/localStorageHandlers.d.ts +4 -0
- package/lib/src/services/localStorageHandlers/localStorageHandlers.test.d.ts +1 -0
- package/lib/src/services/npoPlayerAPI/npoPlayerAPI.d.ts +30 -0
- package/lib/src/services/npoPlayerAPI/npoPlayerAPI.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/addSegmentEventListeners.d.ts +2 -0
- package/lib/src/services/segmentHandlers/addSegmentEventListeners.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/convertFragmentToSegment.d.ts +2 -0
- package/lib/src/services/segmentHandlers/convertFragmentToSegment.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/handleSegmentSeek.d.ts +5 -0
- package/lib/src/services/segmentHandlers/handleSegmentSeek.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.d.ts +2 -0
- package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/initSegment.d.ts +7 -0
- package/lib/src/services/segmentHandlers/initSegment.test.d.ts +1 -0
- package/lib/src/services/segmentHandlers/setSegmentMarkers.d.ts +2 -0
- package/lib/src/services/segmentHandlers/setSegmentMarkers.test.d.ts +1 -0
- package/lib/src/services/services.d.ts +14 -0
- package/lib/src/types/events.d.ts +91 -0
- package/lib/src/types/interfaces.d.ts +39 -15
- package/lib/{js → src}/ui/components/adbutton.d.ts +1 -1
- package/lib/{js → src}/ui/components/adlabel.d.ts +1 -1
- package/lib/{js → src}/ui/components/audio/controlbar.d.ts +1 -1
- package/lib/{js → src}/ui/components/buttons.d.ts +3 -3
- package/lib/src/ui/components/controlbar.d.ts +3 -0
- package/lib/{js → src}/ui/components/ctabar.d.ts +2 -2
- package/lib/src/ui/components/nativemobile/controlbar.d.ts +3 -0
- package/lib/src/ui/components/nativemobile/topbar.d.ts +3 -0
- package/lib/{js → src}/ui/components/playnext.d.ts +1 -1
- package/lib/src/{js/ui → ui}/components/seekbar.d.ts +1 -1
- package/lib/src/{js/ui → ui}/components/settingspanel.d.ts +1 -1
- package/lib/{js → src}/ui/components/titlebar.d.ts +1 -1
- package/lib/src/ui/components/topbar.d.ts +3 -0
- package/lib/src/ui/handlers/accessibilityhandler.test.d.ts +1 -0
- package/lib/src/ui/handlers/domhandlers.d.ts +3 -0
- package/lib/src/ui/handlers/domhandlers.test.d.ts +1 -0
- package/lib/{js → src}/ui/handlers/nicamhandler.d.ts +2 -2
- package/lib/src/ui/handlers/nicamhandler.test.d.ts +1 -0
- package/lib/{js → src}/ui/handlers/playnextstreen.test.d.ts +1 -1
- package/lib/src/{js/ui → ui}/handlers/streamhandler.d.ts +2 -2
- package/lib/{js → src}/ui/nativemobileuicontainer.d.ts +1 -1
- package/lib/src/ui/nativemobileuifactory.test.d.ts +1 -0
- package/lib/{js → src}/ui/uicontainer.d.ts +2 -3
- package/lib/tests/mocks/mockNpoplayer.js +18 -15
- package/lib/tests/mocks/mockPlayerAPI.d.ts +3 -0
- package/lib/tests/mocks/mockPlayerAPI.js +181 -0
- package/lib/tests/mocks/mockPlayerContext.d.ts +2 -0
- package/lib/tests/mocks/mockPlayerContext.js +40 -0
- package/lib/types/events.d.ts +91 -0
- package/lib/types/events.js +1 -0
- package/lib/types/interfaces.d.ts +39 -15
- package/lib/types/interfaces.js +12 -0
- package/lib/{src/js/ui → ui}/components/adbutton.d.ts +1 -1
- package/lib/{src/js/ui → ui}/components/adlabel.d.ts +1 -1
- package/lib/{src/js/ui → ui}/components/audio/controlbar.d.ts +1 -1
- package/lib/{js/ui → ui}/components/audio/controlbar.js +2 -2
- package/lib/{src/js/ui → ui}/components/buttons.d.ts +3 -3
- package/lib/{js/ui → ui}/components/buttons.js +7 -7
- package/lib/ui/components/controlbar.d.ts +3 -0
- package/lib/{js/ui → ui}/components/controlbar.js +5 -2
- package/lib/{src/js/ui → ui}/components/ctabar.d.ts +3 -3
- package/lib/{js/ui → ui}/components/ctabar.js +4 -6
- package/lib/{js/ui → ui}/components/nativemobile/buttons.js +8 -6
- package/lib/ui/components/nativemobile/controlbar.d.ts +3 -0
- package/lib/{js/ui → ui}/components/nativemobile/controlbar.js +6 -4
- package/lib/{js/ui → ui}/components/nativemobile/ctabar.js +1 -1
- package/lib/ui/components/nativemobile/topbar.d.ts +3 -0
- package/lib/{js/ui → ui}/components/nativemobile/topbar.js +6 -3
- package/lib/{src/js/ui → ui}/components/playnext.d.ts +1 -1
- package/lib/{js/ui → ui}/components/playnext.js +1 -1
- package/lib/{js/ui → ui}/components/seekbar.d.ts +1 -1
- package/lib/{js/ui → ui}/components/seekbar.js +1 -1
- package/lib/{js/ui → ui}/components/settingspanel.d.ts +1 -1
- package/lib/{js/ui → ui}/components/settingspanel.js +23 -40
- package/lib/{src/js/ui → ui}/components/titlebar.d.ts +1 -1
- package/lib/ui/components/topbar.d.ts +3 -0
- package/lib/{js/ui → ui}/components/topbar.js +8 -4
- package/lib/{js/ui → ui}/handlers/accessibilityhandler.js +10 -10
- package/lib/ui/handlers/accessibilityhandler.test.d.ts +1 -0
- package/lib/ui/handlers/domhandlers.d.ts +3 -0
- package/lib/ui/handlers/domhandlers.js +7 -0
- package/lib/ui/handlers/domhandlers.test.d.ts +1 -0
- package/lib/ui/handlers/domhandlers.test.js +51 -0
- package/lib/{js/ui → ui}/handlers/listboxhandlers.js +7 -7
- package/lib/{src/js/ui → ui}/handlers/nicamhandler.d.ts +2 -2
- package/lib/{js/ui → ui}/handlers/nicamhandler.js +31 -10
- package/lib/ui/handlers/nicamhandler.test.d.ts +1 -0
- package/lib/{js/ui → ui}/handlers/nicamhandler.test.js +4 -3
- package/lib/{js/ui → ui}/handlers/playnextscreen.js +1 -1
- package/lib/{src/js/ui → ui}/handlers/playnextstreen.test.d.ts +1 -1
- package/lib/{js/ui → ui}/handlers/playnextstreen.test.js +5 -3
- package/lib/{js/ui → ui}/handlers/streamhandler.d.ts +2 -2
- package/lib/ui/handlers/streamhandler.js +51 -0
- package/lib/{src/js/ui → ui}/nativemobileuicontainer.d.ts +1 -1
- package/lib/{js/ui → ui}/nativemobileuicontainer.js +8 -13
- package/lib/{js/ui → ui}/nativemobileuifactory.js +20 -23
- package/lib/ui/nativemobileuifactory.test.d.ts +1 -0
- package/lib/{js/ui → ui}/nativemobileuifactory.test.js +8 -6
- package/lib/{src/js/ui → ui}/uicontainer.d.ts +2 -3
- package/lib/{js/ui → ui}/uicontainer.js +31 -45
- package/package.json +19 -12
- package/src/{scss → style}/components/_controlbars.scss +4 -0
- package/src/{scss → style}/components/_icons.scss +6 -0
- package/src/style/components/_poster.scss +3 -0
- package/src/{scss → style}/components/_settingspanel.scss +15 -1
- package/src/{scss → style}/components/_subtitles.scss +25 -16
- package/src/{scss → style}/npoplayer.css +30 -20
- package/src/{scss → style}/npoplayer.scss +3 -0
- package/src/{scss → style}/variants/_player-small.scss +9 -8
- package/lib/js/checks/apple.d.ts +0 -2
- package/lib/js/checks/apple.js +0 -19
- package/lib/js/checks/apple.test.js +0 -20
- package/lib/js/drm/drm.d.ts +0 -2
- package/lib/js/drm/drm.js +0 -2
- package/lib/js/drm/handlers/decideprofile.d.ts +0 -3
- package/lib/js/drm/handlers/decideprofile.js +0 -53
- package/lib/js/drm/handlers/decideprofile.test.js +0 -33
- package/lib/js/drm/handlers/verifydrm.d.ts +0 -4
- package/lib/js/drm/handlers/verifydrm.js +0 -24
- package/lib/js/drm/handlers/verifydrm.test.js +0 -17
- package/lib/js/fragments/removefragments.d.ts +0 -2
- package/lib/js/fragments/removefragments.js +0 -5
- package/lib/js/fragments/removefragments.test.js +0 -26
- package/lib/js/fragments/setfragments.d.ts +0 -6
- package/lib/js/fragments/setfragments.js +0 -78
- package/lib/js/fragments/setfragments.test.js +0 -72
- package/lib/js/playeractions/handlers/resolvekeypress.d.ts +0 -3
- package/lib/js/playeractions/handlers/resolvekeypress.js +0 -52
- package/lib/js/ui/components/controlbar.d.ts +0 -3
- package/lib/js/ui/components/nativemobile/addFragments.d.ts +0 -1
- package/lib/js/ui/components/nativemobile/addFragments.js +0 -7
- package/lib/js/ui/components/nativemobile/controlbar.d.ts +0 -3
- package/lib/js/ui/components/nativemobile/topbar.d.ts +0 -3
- package/lib/js/ui/components/topbar.d.ts +0 -3
- package/lib/js/ui/handlers/domhandlers.d.ts +0 -3
- package/lib/js/ui/handlers/domhandlers.js +0 -7
- package/lib/js/ui/handlers/domhandlers.test.js +0 -50
- package/lib/js/ui/handlers/streamhandler.js +0 -40
- package/lib/js/utilities/printversion.d.ts +0 -1
- package/lib/js/utilities/utilities.d.ts +0 -16
- package/lib/js/utilities/utilities.js +0 -78
- package/lib/js/utilities/utilities.test.js +0 -50
- package/lib/src/js/checks/apple.d.ts +0 -2
- package/lib/src/js/drm/drm.d.ts +0 -2
- package/lib/src/js/drm/handlers/decideprofile.d.ts +0 -3
- package/lib/src/js/drm/handlers/verifydrm.d.ts +0 -4
- package/lib/src/js/fragments/removefragments.d.ts +0 -2
- package/lib/src/js/fragments/setfragments.d.ts +0 -6
- package/lib/src/js/playeractions/handlers/resolvekeypress.d.ts +0 -3
- package/lib/src/js/ui/components/controlbar.d.ts +0 -3
- package/lib/src/js/ui/components/nativemobile/addFragments.d.ts +0 -1
- package/lib/src/js/ui/components/nativemobile/controlbar.d.ts +0 -3
- package/lib/src/js/ui/components/nativemobile/topbar.d.ts +0 -3
- package/lib/src/js/ui/components/topbar.d.ts +0 -3
- package/lib/src/js/ui/handlers/domhandlers.d.ts +0 -3
- package/lib/src/js/utilities/printversion.d.ts +0 -1
- package/lib/src/js/utilities/utilities.d.ts +0 -16
- /package/lib/js/{utilities/localizationconfig.d.ts → settings/localization.d.ts} +0 -0
- /package/lib/js/{utilities/localizationconfig.js → settings/localization.js} +0 -0
- /package/lib/js/{checks/apple.test.d.ts → utilities/utilities.element.test.d.ts} +0 -0
- /package/lib/js/{drm/handlers/decideprofile.test.d.ts → utilities/utilities.jwt.test.d.ts} +0 -0
- /package/lib/js/{drm/handlers/verifydrm.test.d.ts → utilities/utilities.locale.test.d.ts} +0 -0
- /package/lib/js/{fragments/removefragments.test.d.ts → utilities/utilities.module.test.d.ts} +0 -0
- /package/lib/js/{fragments/setfragments.test.d.ts → utilities/utilities.stream.test.d.ts} +0 -0
- /package/lib/js/{playeractions/handlers/resolvekeypress.test.d.ts → utilities/utilities.text.test.d.ts} +0 -0
- /package/lib/js/{ui/handlers/accessibilityhandler.test.d.ts → utilities/utilities.time.test.d.ts} +0 -0
- /package/lib/js/{ui/handlers/domhandlers.test.d.ts → utilities/utilities.url.test.d.ts} +0 -0
- /package/lib/js/{ui/handlers/nicamhandler.test.d.ts → utilities/utilities.user-agent.test.d.ts} +0 -0
- /package/lib/js/{ui/nativemobileuifactory.test.d.ts → utilities/utilities.version.test.d.ts} +0 -0
- /package/lib/{js/utilities/utilities.test.d.ts → services/a11y/setup.test.d.ts} +0 -0
- /package/lib/{src/js/checks/apple.test.d.ts → services/avTypeHandlers/getAVType.test.d.ts} +0 -0
- /package/lib/{src/js/drm/handlers → services/drmHandlers}/decideprofile.test.d.ts +0 -0
- /package/lib/{src/js/drm/handlers/verifydrm.test.d.ts → services/drmHandlers/utils.test.d.ts} +0 -0
- /package/lib/{src/js/fragments/removefragments.test.d.ts → services/drmHandlers/verifydrm.test.d.ts} +0 -0
- /package/lib/{src/js/fragments/setfragments.test.d.ts → services/eventListenerHandlers/removeEventListeners.test.d.ts} +0 -0
- /package/lib/{src/js/playeractions/handlers → services/keyboardHandlers}/resolvekeypress.test.d.ts +0 -0
- /package/lib/{src/js/ui/handlers/accessibilityhandler.test.d.ts → services/localStorageHandlers/localStorageHandlers.test.d.ts} +0 -0
- /package/lib/{src/js/ui/handlers/domhandlers.test.d.ts → services/npoPlayerAPI/npoPlayerAPI.test.d.ts} +0 -0
- /package/lib/{src/js/ui/handlers/nicamhandler.test.d.ts → services/segmentHandlers/addSegmentEventListeners.test.d.ts} +0 -0
- /package/lib/{src/js/ui/nativemobileuifactory.test.d.ts → services/segmentHandlers/convertFragmentToSegment.test.d.ts} +0 -0
- /package/lib/{src/js/utilities/utilities.test.d.ts → services/segmentHandlers/handleSegmentSeek.test.d.ts} +0 -0
- /package/lib/src/js/{utilities/localizationconfig.d.ts → settings/localization.d.ts} +0 -0
- /package/lib/{js → src}/ui/components/nativemobile/buttons.d.ts +0 -0
- /package/lib/{js → src}/ui/components/nativemobile/ctabar.d.ts +0 -0
- /package/lib/{js → src}/ui/components/nativemobile/titlebar.d.ts +0 -0
- /package/lib/{js → src}/ui/handlers/accessibilityhandler.d.ts +0 -0
- /package/lib/{js → src}/ui/handlers/listboxhandlers.d.ts +0 -0
- /package/lib/{js → src}/ui/handlers/playnextscreen.d.ts +0 -0
- /package/lib/{js → src}/ui/handlers/timecontrolhandlers.d.ts +0 -0
- /package/lib/{js → src}/ui/nativemobileuifactory.d.ts +0 -0
- /package/lib/{js/ui → ui}/components/adbutton.js +0 -0
- /package/lib/{js/ui → ui}/components/adlabel.js +0 -0
- /package/lib/{src/js/ui → ui}/components/nativemobile/buttons.d.ts +0 -0
- /package/lib/{src/js/ui → ui}/components/nativemobile/ctabar.d.ts +0 -0
- /package/lib/{src/js/ui → ui}/components/nativemobile/titlebar.d.ts +0 -0
- /package/lib/{js/ui → ui}/components/nativemobile/titlebar.js +0 -0
- /package/lib/{js/ui → ui}/components/titlebar.js +0 -0
- /package/lib/{src/js/ui → ui}/handlers/accessibilityhandler.d.ts +0 -0
- /package/lib/{js/ui → ui}/handlers/accessibilityhandler.test.js +0 -0
- /package/lib/{src/js/ui → ui}/handlers/listboxhandlers.d.ts +0 -0
- /package/lib/{src/js/ui → ui}/handlers/playnextscreen.d.ts +0 -0
- /package/lib/{src/js/ui → ui}/handlers/timecontrolhandlers.d.ts +0 -0
- /package/lib/{js/ui → ui}/handlers/timecontrolhandlers.js +0 -0
- /package/lib/{src/js/ui → ui}/nativemobileuifactory.d.ts +0 -0
- /package/src/{scss → style}/components/_advert.scss +0 -0
- /package/src/{scss → style}/components/_audio.scss +0 -0
- /package/src/{scss → style}/components/_buffering.scss +0 -0
- /package/src/{scss → style}/components/_error.scss +0 -0
- /package/src/{scss → style}/components/_hugeplaybacktogglebutton.scss +0 -0
- /package/src/{scss → style}/components/_metadata.scss +0 -0
- /package/src/{scss → style}/components/_nicam.scss +0 -0
- /package/src/{scss → style}/components/_playnext.scss +0 -0
- /package/src/{scss → style}/components/_replay.scss +0 -0
- /package/src/{scss → style}/components/_seekbar.scss +0 -0
- /package/src/{scss → style}/components/_seekbarthumbnail.scss +0 -0
- /package/src/{scss → style}/components/_textbuttons.scss +0 -0
- /package/src/{scss → style}/components/_volumeslider.scss +0 -0
- /package/src/{scss → style}/components/audio/_bottombar.scss +0 -0
- /package/src/{scss → style}/components/audio/_buffering.scss +0 -0
- /package/src/{scss → style}/components/audio/_errors.scss +0 -0
- /package/src/{scss → style}/components/audio/_metadata.scss +0 -0
- /package/src/{scss → style}/components/audio/_playbutton.scss +0 -0
- /package/src/{scss → style}/components/audio/_poster.scss +0 -0
- /package/src/{scss → style}/components/audio/_replay.scss +0 -0
- /package/src/{scss → style}/components/audio/_seekbar.scss +0 -0
- /package/src/{scss → style}/components/audio/_topbar.scss +0 -0
- /package/src/{scss → style}/components/audio/_vars.scss +0 -0
- /package/src/{scss → style}/components/audio/_volumeslider.scss +0 -0
- /package/src/{scss → style}/variants/_player-audio.scss +0 -0
- /package/src/{scss → style}/variants/_player-base.scss +0 -0
- /package/src/{scss → style}/variants/_player-debug.scss +0 -0
- /package/src/{scss → style}/variants/_player-large.scss +0 -0
- /package/src/{scss → style}/variants/_player-medium.scss +0 -0
- /package/src/{scss → style}/variants/_player-native-mobile.scss +0 -0
- /package/src/{scss → style}/vars/_audio.scss +0 -0
- /package/src/{scss → style}/vars/_colors.scss +0 -0
- /package/src/{scss → style}/vars/_fonts.scss +0 -0
- /package/src/{scss → style}/vars/_icons.scss +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlayerEvent } from 'bitmovin-player';
|
|
2
2
|
export function handleStartOffset(player, offset) {
|
|
3
|
-
if (offset ==
|
|
3
|
+
if (offset == undefined || player.isLive()) {
|
|
4
4
|
if (player.isLive()) {
|
|
5
5
|
console.warn('handleStartOffset was called but the player is playing live content.');
|
|
6
6
|
}
|
|
@@ -17,9 +17,9 @@ export function handleStartOffset(player, offset) {
|
|
|
17
17
|
player.on(PlayerEvent.AdError, seek);
|
|
18
18
|
}
|
|
19
19
|
export function shiftToProgramStart(player, timestamp) {
|
|
20
|
-
if (player ==
|
|
20
|
+
if (player == undefined)
|
|
21
21
|
return;
|
|
22
|
-
if (timestamp ==
|
|
22
|
+
if (timestamp == undefined || !player.isLive()) {
|
|
23
23
|
if (!player.isLive()) {
|
|
24
24
|
console.warn('shiftToProgramStart was called but the player is playing VOD content.');
|
|
25
25
|
}
|
|
@@ -28,11 +28,11 @@ export function shiftToProgramStart(player, timestamp) {
|
|
|
28
28
|
player.timeShift(timestamp);
|
|
29
29
|
}
|
|
30
30
|
export function handleLiveOffsetLogic(npoplayer, player, options) {
|
|
31
|
-
if (player ==
|
|
31
|
+
if (player == undefined)
|
|
32
32
|
return;
|
|
33
|
-
if (npoplayer.uiComponents.watchFromStartButton ==
|
|
33
|
+
if (npoplayer.uiComponents.watchFromStartButton == undefined)
|
|
34
34
|
return;
|
|
35
|
-
if (options?.liveProgramTime ==
|
|
35
|
+
if (options?.liveProgramTime == undefined) {
|
|
36
36
|
npoplayer.uiComponents.watchFromStartButton.hide();
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleStartOffset, shiftToProgramStart } from
|
|
1
|
+
import { handleStartOffset, shiftToProgramStart } from './handleoffsets';
|
|
2
2
|
const isLive = () => true;
|
|
3
3
|
const onReady = jest.fn();
|
|
4
4
|
const timeShift = jest.fn();
|
|
@@ -7,42 +7,42 @@ const timestamp = 10;
|
|
|
7
7
|
const player = {
|
|
8
8
|
isLive,
|
|
9
9
|
on: onReady,
|
|
10
|
-
timeShift
|
|
10
|
+
timeShift
|
|
11
11
|
};
|
|
12
|
-
describe(
|
|
12
|
+
describe('Test offset handling', () => {
|
|
13
13
|
afterEach(() => {
|
|
14
14
|
jest.resetAllMocks();
|
|
15
15
|
});
|
|
16
|
-
it(
|
|
16
|
+
it('should not seek when player is live', () => {
|
|
17
17
|
handleStartOffset(player, offset);
|
|
18
18
|
expect(onReady).not.toHaveBeenCalled();
|
|
19
19
|
});
|
|
20
|
-
it(
|
|
20
|
+
it('should not seek when offset is undefined', () => {
|
|
21
21
|
handleStartOffset({ ...player, isLive: () => false });
|
|
22
22
|
expect(onReady).not.toHaveBeenCalled();
|
|
23
23
|
});
|
|
24
|
-
it(
|
|
24
|
+
it('should seek when player is not live and offset is defined', () => {
|
|
25
25
|
handleStartOffset({ ...player, isLive: () => false }, offset);
|
|
26
26
|
expect(onReady).toHaveBeenCalled();
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
|
-
describe(
|
|
29
|
+
describe('Test programStart shift', () => {
|
|
30
30
|
afterEach(() => {
|
|
31
31
|
jest.resetAllMocks();
|
|
32
32
|
});
|
|
33
|
-
it(
|
|
34
|
-
shiftToProgramStart(
|
|
33
|
+
it('should not call timeshift when player is null', () => {
|
|
34
|
+
shiftToProgramStart(undefined, timestamp);
|
|
35
35
|
expect(timeShift).not.toHaveBeenCalled();
|
|
36
36
|
});
|
|
37
|
-
it(
|
|
37
|
+
it('should not call timeshift when timestamp is undefined', () => {
|
|
38
38
|
shiftToProgramStart(player);
|
|
39
39
|
expect(timeShift).not.toHaveBeenCalled();
|
|
40
40
|
});
|
|
41
|
-
it(
|
|
41
|
+
it('should not call timeshift when player is not live', () => {
|
|
42
42
|
shiftToProgramStart({ ...player, isLive: () => false }, timestamp);
|
|
43
43
|
expect(timeShift).not.toHaveBeenCalled();
|
|
44
44
|
});
|
|
45
|
-
it(
|
|
45
|
+
it('should not call timeshift when player is live and timestamp is set', () => {
|
|
46
46
|
shiftToProgramStart(player, timestamp);
|
|
47
47
|
expect(timeShift).toHaveBeenCalled();
|
|
48
48
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PlayerAPI, SourceConfig } from
|
|
1
|
+
import { PlayerAPI, SourceConfig } from 'bitmovin-player';
|
|
2
2
|
export declare function setupMediaSessionActionHandlers(player: PlayerAPI, sourceConfig: SourceConfig, _streamObject: any): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayerEvent } from
|
|
1
|
+
import { PlayerEvent } from 'bitmovin-player';
|
|
2
2
|
export function setupMediaSessionActionHandlers(player, sourceConfig, _streamObject) {
|
|
3
3
|
player.on(PlayerEvent.Playing, () => {
|
|
4
4
|
if (!('mediaSession' in navigator)) {
|
|
@@ -38,13 +38,13 @@ export function setupMediaSessionActionHandlers(player, sourceConfig, _streamObj
|
|
|
38
38
|
function setMediaSessionMetadata() {
|
|
39
39
|
const metadata = {
|
|
40
40
|
title: sourceConfig.title,
|
|
41
|
-
artist: _streamObject.metadata.broadcaster || ''
|
|
41
|
+
artist: _streamObject.metadata.broadcaster || ''
|
|
42
42
|
};
|
|
43
43
|
if (sourceConfig.poster || _streamObject.metadata.poster) {
|
|
44
44
|
metadata.artwork = [
|
|
45
45
|
{
|
|
46
|
-
src: sourceConfig.poster || _streamObject.metadata.poster
|
|
47
|
-
}
|
|
46
|
+
src: sourceConfig.poster || _streamObject.metadata.poster
|
|
47
|
+
}
|
|
48
48
|
];
|
|
49
49
|
}
|
|
50
50
|
navigator.mediaSession.metadata = new MediaMetadata(metadata);
|
|
@@ -58,29 +58,34 @@ export function setupMediaSessionActionHandlers(player, sourceConfig, _streamObj
|
|
|
58
58
|
const skipTime = details.seekOffset || defaultSkipTime;
|
|
59
59
|
player.seek(Math.max(player.getCurrentTime() - skipTime, 0));
|
|
60
60
|
updatePositionState();
|
|
61
|
-
}
|
|
62
|
-
},
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
63
64
|
action: 'seekforward',
|
|
64
65
|
handler: (details) => {
|
|
65
66
|
const skipTime = details.seekOffset || defaultSkipTime;
|
|
66
67
|
player.seek(Math.min(player.getCurrentTime() + skipTime, player.getDuration()));
|
|
67
68
|
updatePositionState();
|
|
68
|
-
}
|
|
69
|
-
},
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
70
72
|
action: 'seekto',
|
|
71
73
|
handler: (details) => {
|
|
72
74
|
if (details.seekTime) {
|
|
73
75
|
player.seek(details.seekTime);
|
|
74
76
|
}
|
|
75
77
|
updatePositionState();
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
78
81
|
action: 'play',
|
|
79
|
-
handler: () => player.play()
|
|
80
|
-
},
|
|
82
|
+
handler: () => player.play()
|
|
83
|
+
},
|
|
84
|
+
{
|
|
81
85
|
action: 'pause',
|
|
82
|
-
handler: () => player.pause()
|
|
83
|
-
},
|
|
86
|
+
handler: () => player.pause()
|
|
87
|
+
},
|
|
88
|
+
{
|
|
84
89
|
action: 'stop',
|
|
85
90
|
handler: () => player.unload()
|
|
86
91
|
}
|
|
@@ -99,7 +104,7 @@ export function setupMediaSessionActionHandlers(player, sourceConfig, _streamObj
|
|
|
99
104
|
navigator.mediaSession.setPositionState({
|
|
100
105
|
duration: player.getDuration(),
|
|
101
106
|
playbackRate: player.getPlaybackSpeed(),
|
|
102
|
-
position: player.getCurrentTime()
|
|
107
|
+
position: player.getCurrentTime()
|
|
103
108
|
});
|
|
104
109
|
}
|
|
105
110
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type PlayerConfig } from
|
|
2
|
-
import NpoPlayer from
|
|
1
|
+
import { type PlayerConfig } from 'bitmovin-player';
|
|
2
|
+
import NpoPlayer from 'npoplayer';
|
|
3
3
|
export declare function processPlayerConfig(npoplayer: NpoPlayer, playerConfig: PlayerConfig): PlayerConfig;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LogLevel } from
|
|
2
|
-
import {
|
|
1
|
+
import { LogLevel } from 'bitmovin-player';
|
|
2
|
+
import { isSafari } from '../../utilities/utilities.user-agent';
|
|
3
3
|
export function processPlayerConfig(npoplayer, playerConfig) {
|
|
4
|
-
|
|
5
|
-
if (isSafari(
|
|
4
|
+
const processedConfig = playerConfig;
|
|
5
|
+
if (isSafari()) {
|
|
6
6
|
processedConfig.playback = {
|
|
7
7
|
autoplay: false
|
|
8
8
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { StreamObject, StreamOptions } from 'types/interfaces';
|
|
2
2
|
import { SourceConfig } from 'bitmovin-player';
|
|
3
|
-
|
|
3
|
+
import { NpoPlayerServices } from '../../../services/services';
|
|
4
|
+
export declare function processSourceConfig(NpoPlayerServices: NpoPlayerServices, _sourceConfig: SourceConfig | undefined, _streamObject: StreamObject, drm: string | undefined, streamOptions: StreamOptions, version: string, npoTagPartyId: string | undefined, npoPlayerServices: NpoPlayerServices): Promise<SourceConfig>;
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import { HttpResponseType } from 'bitmovin-player';
|
|
2
2
|
import { npoCdnProviders } from '../../cdnproviders';
|
|
3
|
-
import {
|
|
3
|
+
import { replaceSpecialCharacters } from '../../utilities/utilities.text';
|
|
4
4
|
async function setDrm(sourceConfig, drm, _streamObject, useWidevineServerCertificate) {
|
|
5
5
|
const npoDrmGateway = 'https://npo-drm-gateway.samgcloud.nepworldwide.nl/authentication?custom_data=';
|
|
6
6
|
switch (drm) {
|
|
7
|
-
case 'fairplay':
|
|
7
|
+
case 'fairplay': {
|
|
8
8
|
sourceConfig.drm = {
|
|
9
9
|
fairplay: {
|
|
10
10
|
certificateURL: 'https://fairplay.npo.nl/certificate/fairplay.cer',
|
|
11
11
|
LA_URL: npoDrmGateway + _streamObject.stream.drmToken,
|
|
12
|
-
prepareMessage: event => {
|
|
12
|
+
prepareMessage: (event) => {
|
|
13
13
|
return new Uint8Array(event.message);
|
|
14
14
|
},
|
|
15
|
-
prepareContentId: url => {
|
|
15
|
+
prepareContentId: (url) => {
|
|
16
16
|
const link = document.createElement('a');
|
|
17
|
-
const trimmedUrl = url
|
|
18
|
-
.split('')
|
|
19
|
-
.filter(char => !(char.codePointAt(0) == null))
|
|
20
|
-
.join('');
|
|
17
|
+
const trimmedUrl = [...url].filter((char) => !(char.codePointAt(0) == undefined)).join('');
|
|
21
18
|
link.href = trimmedUrl.replace('T', '');
|
|
22
19
|
return link.hostname;
|
|
23
20
|
},
|
|
24
|
-
prepareLicense: license => {
|
|
21
|
+
prepareLicense: (license) => {
|
|
25
22
|
let binary = '';
|
|
26
23
|
const bytes = new Uint8Array(license);
|
|
27
24
|
const len = bytes.byteLength;
|
|
28
25
|
for (let i = 0; i < len; i++) {
|
|
29
|
-
binary += String.
|
|
26
|
+
binary += String.fromCodePoint(bytes[i]);
|
|
30
27
|
}
|
|
31
28
|
return window.btoa(binary);
|
|
32
29
|
},
|
|
@@ -35,7 +32,8 @@ async function setDrm(sourceConfig, drm, _streamObject, useWidevineServerCertifi
|
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
34
|
break;
|
|
38
|
-
|
|
35
|
+
}
|
|
36
|
+
case 'widevine': {
|
|
39
37
|
try {
|
|
40
38
|
sourceConfig.drm = {
|
|
41
39
|
widevine: {
|
|
@@ -43,7 +41,7 @@ async function setDrm(sourceConfig, drm, _streamObject, useWidevineServerCertifi
|
|
|
43
41
|
audioRobustness: 'SW_SECURE_CRYPTO',
|
|
44
42
|
videoRobustness: 'SW_SECURE_CRYPTO',
|
|
45
43
|
serverCertificate: useWidevineServerCertificate
|
|
46
|
-
? await (
|
|
44
|
+
? await getServerCertificate('https://widevine.npoplayer.nl/widevine_player_cert.bin')
|
|
47
45
|
: undefined
|
|
48
46
|
}
|
|
49
47
|
};
|
|
@@ -52,25 +50,40 @@ async function setDrm(sourceConfig, drm, _streamObject, useWidevineServerCertifi
|
|
|
52
50
|
console.error('Error:', error);
|
|
53
51
|
}
|
|
54
52
|
break;
|
|
55
|
-
|
|
53
|
+
}
|
|
54
|
+
case 'playready': {
|
|
56
55
|
sourceConfig.drm = {
|
|
57
56
|
playready: {
|
|
58
57
|
LA_URL: npoDrmGateway + _streamObject.stream.drmToken
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
break;
|
|
61
|
+
}
|
|
62
62
|
}
|
|
63
63
|
return sourceConfig;
|
|
64
64
|
}
|
|
65
|
+
async function getServerCertificate(url) {
|
|
66
|
+
const response = await fetch(url);
|
|
67
|
+
return response.arrayBuffer();
|
|
68
|
+
}
|
|
69
|
+
const getSubtitleLabels = function (data) {
|
|
70
|
+
if (data.label === 'nl') {
|
|
71
|
+
return 'Nederlands';
|
|
72
|
+
}
|
|
73
|
+
return data.label;
|
|
74
|
+
};
|
|
75
|
+
const getQualityLabels = function (data) {
|
|
76
|
+
return data.height + 'p';
|
|
77
|
+
};
|
|
65
78
|
function setStreamProfile(sourceConfig, _sourceConfig, _streamObject) {
|
|
66
79
|
const streamProfile = _streamObject.stream.streamProfile;
|
|
67
80
|
const streamURL = _streamObject.stream.streamURL;
|
|
68
81
|
const configMapping = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
hls: _sourceConfig.hls,
|
|
83
|
+
dash: _sourceConfig.dash,
|
|
84
|
+
progressive: _sourceConfig.progressive
|
|
72
85
|
};
|
|
73
|
-
if (
|
|
86
|
+
if (Object.prototype.hasOwnProperty.call(configMapping, streamProfile)) {
|
|
74
87
|
const value = configMapping[streamProfile];
|
|
75
88
|
if (typeof value === 'string' || value === undefined) {
|
|
76
89
|
sourceConfig[streamProfile] = value === '' ? undefined : value ?? streamURL ?? '';
|
|
@@ -78,33 +91,36 @@ function setStreamProfile(sourceConfig, _sourceConfig, _streamObject) {
|
|
|
78
91
|
else if (Array.isArray(value) && streamProfile === 'progressive') {
|
|
79
92
|
sourceConfig.progressive = value;
|
|
80
93
|
}
|
|
81
|
-
Object.keys(configMapping)
|
|
82
|
-
.filter(profile => profile !== streamProfile)
|
|
83
|
-
.forEach(profile => {
|
|
94
|
+
for (const profile of Object.keys(configMapping).filter((profile) => profile !== streamProfile)) {
|
|
84
95
|
if (profile === 'progressive') {
|
|
85
96
|
sourceConfig[profile] = undefined;
|
|
86
97
|
}
|
|
87
98
|
else {
|
|
88
99
|
sourceConfig[profile] = '';
|
|
89
100
|
}
|
|
90
|
-
}
|
|
101
|
+
}
|
|
91
102
|
}
|
|
92
103
|
return sourceConfig;
|
|
93
104
|
}
|
|
94
|
-
export async function processSourceConfig(_sourceConfig = {}, _streamObject, drm =
|
|
105
|
+
export async function processSourceConfig(NpoPlayerServices, _sourceConfig = {}, _streamObject, drm = undefined, streamOptions, version, npoTagPartyId, npoPlayerServices) {
|
|
95
106
|
let sourceConfig = {};
|
|
96
|
-
sourceConfig.title =
|
|
97
|
-
|
|
98
|
-
sourceConfig.description =
|
|
99
|
-
_sourceConfig.description ??
|
|
100
|
-
_streamObject.metadata.description ??
|
|
101
|
-
'';
|
|
107
|
+
sourceConfig.title = _sourceConfig.title ?? _streamObject.metadata.title ?? '';
|
|
108
|
+
sourceConfig.description = _sourceConfig.description ?? _streamObject.metadata.description ?? '';
|
|
102
109
|
sourceConfig.poster = decidePoster(_streamObject, _sourceConfig, streamOptions);
|
|
103
110
|
sourceConfig.metadata = {
|
|
104
111
|
title: sourceConfig.title,
|
|
105
112
|
description: sourceConfig.description,
|
|
106
113
|
poster: sourceConfig.poster
|
|
107
114
|
};
|
|
115
|
+
if (streamOptions.fragments || _streamObject.segment) {
|
|
116
|
+
const segment = streamOptions.fragments
|
|
117
|
+
? NpoPlayerServices.convertFragmentToSegment(streamOptions.fragments)
|
|
118
|
+
: _streamObject.segment;
|
|
119
|
+
if (segment) {
|
|
120
|
+
;
|
|
121
|
+
sourceConfig.markers = NpoPlayerServices.segmentMarkersHandler(segment, sourceConfig.metadata.title);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
108
124
|
sourceConfig.subtitleTracks =
|
|
109
125
|
_sourceConfig.subtitleTracks ??
|
|
110
126
|
(_streamObject.assets.subtitles
|
|
@@ -117,8 +133,7 @@ export async function processSourceConfig(_sourceConfig = {}, _streamObject, drm
|
|
|
117
133
|
}))
|
|
118
134
|
: undefined);
|
|
119
135
|
sourceConfig.thumbnailTrack =
|
|
120
|
-
_sourceConfig.thumbnailTrack ??
|
|
121
|
-
_streamObject.assets.scrubbingThumbnail
|
|
136
|
+
_sourceConfig.thumbnailTrack ?? _streamObject.assets.scrubbingThumbnail
|
|
122
137
|
? { url: _streamObject.assets.scrubbingThumbnail }
|
|
123
138
|
: undefined;
|
|
124
139
|
sourceConfig.options = _sourceConfig.options;
|
|
@@ -130,33 +145,24 @@ export async function processSourceConfig(_sourceConfig = {}, _streamObject, drm
|
|
|
130
145
|
cdnString = 'OFFLINE';
|
|
131
146
|
}
|
|
132
147
|
else {
|
|
133
|
-
|
|
148
|
+
for (const [key, value] of npoCdnProviders.entries()) {
|
|
134
149
|
if (streamSource.includes(key)) {
|
|
135
150
|
cdnString = value;
|
|
136
151
|
}
|
|
137
|
-
}
|
|
152
|
+
}
|
|
138
153
|
}
|
|
139
|
-
if (sourceConfig.analytics ==
|
|
154
|
+
if (sourceConfig.analytics == undefined)
|
|
140
155
|
sourceConfig.analytics = {};
|
|
141
156
|
sourceConfig.analytics.cdnProvider = cdnString;
|
|
142
157
|
sourceConfig.analytics.videoId = _streamObject.metadata.prid;
|
|
143
158
|
sourceConfig.analytics.title = _streamObject.metadata.title;
|
|
144
159
|
sourceConfig.analytics.customData2 = _streamObject.user.type;
|
|
145
|
-
sourceConfig.analytics.customData3 = _streamObject.stream.avType;
|
|
160
|
+
sourceConfig.analytics.customData3 = npoPlayerServices.getAVType(_streamObject.stream.avType);
|
|
146
161
|
sourceConfig.analytics.customData4 = npoTagPartyId;
|
|
147
162
|
sourceConfig.analytics.customData5 = version;
|
|
148
163
|
sourceConfig.analytics = {
|
|
149
164
|
...sourceConfig.analytics,
|
|
150
|
-
..._sourceConfig.analytics
|
|
151
|
-
};
|
|
152
|
-
const getSubtitleLabels = function (data) {
|
|
153
|
-
if (data.label === 'nl') {
|
|
154
|
-
return 'Nederlands';
|
|
155
|
-
}
|
|
156
|
-
return data.label;
|
|
157
|
-
};
|
|
158
|
-
const getQualityLabels = function (data) {
|
|
159
|
-
return data.height + 'p';
|
|
165
|
+
..._sourceConfig.analytics
|
|
160
166
|
};
|
|
161
167
|
if (sourceConfig.progressive !== '') {
|
|
162
168
|
sourceConfig.labeling = {
|
|
@@ -174,13 +180,13 @@ export async function processSourceConfig(_sourceConfig = {}, _streamObject, drm
|
|
|
174
180
|
}
|
|
175
181
|
function decidePoster(streamObject, sourceConfig, streamOptions) {
|
|
176
182
|
if (sourceConfig.poster) {
|
|
177
|
-
return
|
|
183
|
+
return replaceSpecialCharacters(sourceConfig.poster);
|
|
178
184
|
}
|
|
179
185
|
if (streamObject.metadata.poster && !streamObject.metadata.posterIsDefault) {
|
|
180
186
|
return streamObject.metadata.poster;
|
|
181
187
|
}
|
|
182
188
|
if (streamObject.metadata.posterIsDefault && streamOptions.customFallbackPoster) {
|
|
183
|
-
return
|
|
189
|
+
return replaceSpecialCharacters(streamOptions.customFallbackPoster);
|
|
184
190
|
}
|
|
185
191
|
return streamObject.metadata.poster ?? '';
|
|
186
192
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PlayerAPI } from 'bitmovin-player';
|
|
2
|
-
export declare function removeReplayClass(player: PlayerAPI |
|
|
2
|
+
export declare function removeReplayClass(player: PlayerAPI | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
1
2
|
import { removeReplayClass } from './removereplayclass';
|
|
2
3
|
import { PlayerEvent } from 'bitmovin-player';
|
|
3
4
|
describe('removeReplayClass', () => {
|
|
@@ -12,21 +13,21 @@ describe('removeReplayClass', () => {
|
|
|
12
13
|
mockPlayerContainer.appendChild(mockPlayerWrapper);
|
|
13
14
|
mockPlayer = {
|
|
14
15
|
off: jest.fn(),
|
|
15
|
-
getContainer: jest.fn().mockReturnValue(mockPlayerContainer)
|
|
16
|
+
getContainer: jest.fn().mockReturnValue(mockPlayerContainer)
|
|
16
17
|
};
|
|
17
18
|
});
|
|
18
19
|
it('should remove "bmpui-player-state-finished" and "bmpui-player-state-replay" classes from the player container', () => {
|
|
19
20
|
removeReplayClass(mockPlayer);
|
|
20
|
-
expect(mockPlayerWrapper.
|
|
21
|
-
expect(mockPlayerWrapper.
|
|
22
|
-
expect(mockPlayerWrapper.
|
|
21
|
+
expect(mockPlayerWrapper).not.toHaveClass('bmpui-player-state-finished');
|
|
22
|
+
expect(mockPlayerWrapper).not.toHaveClass('bmpui-player-state-replay');
|
|
23
|
+
expect(mockPlayerWrapper).toHaveClass('bmpui-player-state-paused');
|
|
23
24
|
});
|
|
24
25
|
it('should unregister the Seek event listener', () => {
|
|
25
26
|
removeReplayClass(mockPlayer);
|
|
26
27
|
expect(mockPlayer.off).toHaveBeenCalledWith(PlayerEvent.Seek, expect.any(Function));
|
|
27
28
|
});
|
|
28
|
-
it('should not unregister the Seek event listener if the player is
|
|
29
|
-
removeReplayClass(
|
|
29
|
+
it('should not unregister the Seek event listener if the player is undefined', () => {
|
|
30
|
+
removeReplayClass(undefined);
|
|
30
31
|
expect(mockPlayer.off).not.toHaveBeenCalled();
|
|
31
32
|
});
|
|
32
33
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { processSourceConfig } from "./handlers/processsourceconfig";
|
|
1
|
+
export { handleStartOffset, handleLiveOffsetLogic, shiftToProgramStart } from './handlers/handleoffsets';
|
|
2
|
+
export { handlePlayerError } from './handlers/error';
|
|
3
|
+
export { processPlayerConfig } from './handlers/processplayerconfig';
|
|
4
|
+
export { processSourceConfig } from './handlers/processsourceconfig';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { processSourceConfig } from "./handlers/processsourceconfig";
|
|
1
|
+
export { handleStartOffset, handleLiveOffsetLogic, shiftToProgramStart } from './handlers/handleoffsets';
|
|
2
|
+
export { handlePlayerError } from './handlers/error';
|
|
3
|
+
export { processPlayerConfig } from './handlers/processplayerconfig';
|
|
4
|
+
export { processSourceConfig } from './handlers/processsourceconfig';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const supportedKeySystems: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const supportedKeySystems = ['com.apple.fps.1_0', 'com.apple.fps.2_0'];
|
|
@@ -2,10 +2,10 @@ import { PlayerEvent, ViewMode } from 'bitmovin-player';
|
|
|
2
2
|
import { logEvent } from './eventlogging';
|
|
3
3
|
const logEventHandlers = new Map();
|
|
4
4
|
export function bindPlayerEvents(npoplayer, player) {
|
|
5
|
-
if (player ==
|
|
5
|
+
if (player == undefined)
|
|
6
6
|
return;
|
|
7
7
|
let isSeeking = false;
|
|
8
|
-
|
|
8
|
+
const isLiveStream = npoplayer.streamObject.stream.isLiveStream;
|
|
9
9
|
let currentTime = 0;
|
|
10
10
|
let isNewSource = true;
|
|
11
11
|
const timeDifference = (time) => {
|
|
@@ -16,7 +16,7 @@ export function bindPlayerEvents(npoplayer, player) {
|
|
|
16
16
|
};
|
|
17
17
|
const logEventHandler = (eventName) => {
|
|
18
18
|
return (e) => {
|
|
19
|
-
const eventTime = e.time
|
|
19
|
+
const eventTime = e.time === undefined ? undefined : timeDifference(e.time);
|
|
20
20
|
logEvent(npoplayer, eventName, eventTime);
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -27,14 +27,14 @@ export function bindPlayerEvents(npoplayer, player) {
|
|
|
27
27
|
const timeDifferencePosition = -1 * (Date.now() / 1000 - e.position);
|
|
28
28
|
const timeDifferenceTarget = -1 * (Date.now() / 1000 - e.target);
|
|
29
29
|
data = {
|
|
30
|
-
seek_from: parseFloat(timeDifferencePosition.toFixed(3)),
|
|
31
|
-
stream_position: parseFloat(timeDifferenceTarget.toFixed(3))
|
|
30
|
+
seek_from: Number.parseFloat(timeDifferencePosition.toFixed(3)),
|
|
31
|
+
stream_position: Number.parseFloat(timeDifferenceTarget.toFixed(3))
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
else if (e.type === 'seek') {
|
|
35
35
|
data = {
|
|
36
36
|
seek_from: e.position,
|
|
37
|
-
stream_position: e.seekTarget
|
|
37
|
+
stream_position: e.seekTarget
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
logEvent(npoplayer, e.type, data);
|
|
@@ -93,14 +93,14 @@ export function bindPlayerEvents(npoplayer, player) {
|
|
|
93
93
|
{ event: PlayerEvent.Seek, handler: seekHandler },
|
|
94
94
|
{ event: PlayerEvent.TimeShift, handler: seekHandler },
|
|
95
95
|
{ event: PlayerEvent.TimeChanged, handler: handleTime },
|
|
96
|
-
{ event: PlayerEvent.ViewModeChanged, handler: handleViewModeChange }
|
|
96
|
+
{ event: PlayerEvent.ViewModeChanged, handler: handleViewModeChange }
|
|
97
97
|
];
|
|
98
|
-
|
|
98
|
+
for (const { event, name, handler } of playerEvents) {
|
|
99
99
|
const effectiveName = name || 'unnamed_event';
|
|
100
100
|
const eventHandler = handler || logEventHandler(effectiveName);
|
|
101
101
|
logEventHandlers.set(event, eventHandler);
|
|
102
102
|
player.on(event, eventHandler);
|
|
103
|
-
}
|
|
103
|
+
}
|
|
104
104
|
if (npoplayer.streamObject.assets.preroll === null) {
|
|
105
105
|
logEventHandlers.set(PlayerEvent.Playing, handlePlaying);
|
|
106
106
|
player.on(PlayerEvent.Playing, handlePlaying);
|
|
@@ -4,8 +4,8 @@ export function logEvent(npoplayer, event, data) {
|
|
|
4
4
|
try {
|
|
5
5
|
npoplayer.player.getCurrentTime();
|
|
6
6
|
}
|
|
7
|
-
catch (
|
|
8
|
-
console.warn('Er gaat iets mis met de player API',
|
|
7
|
+
catch (error) {
|
|
8
|
+
console.warn('Er gaat iets mis met de player API', error);
|
|
9
9
|
}
|
|
10
10
|
const streamOptions = { stream_position: npoplayer.player.getCurrentTime() };
|
|
11
11
|
const eventHandlers = {
|
|
@@ -6,7 +6,7 @@ describe('logEvent', () => {
|
|
|
6
6
|
npoplayer = mockNpoPlayer;
|
|
7
7
|
});
|
|
8
8
|
it('should not log event if player is not available', () => {
|
|
9
|
-
npoplayer.player =
|
|
9
|
+
npoplayer.player = undefined;
|
|
10
10
|
if (npoplayer.streamTracker && npoplayer.player) {
|
|
11
11
|
logEvent(npoplayer, 'start');
|
|
12
12
|
expect(npoplayer.streamTracker.start).not.toHaveBeenCalled();
|
|
@@ -14,7 +14,7 @@ describe('logEvent', () => {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
it('should not log event if streamTracker is not available', () => {
|
|
17
|
-
npoplayer.streamTracker =
|
|
17
|
+
npoplayer.streamTracker = undefined;
|
|
18
18
|
if (npoplayer.streamTracker) {
|
|
19
19
|
logEvent(npoplayer, 'start');
|
|
20
20
|
expect(npoplayer.logEmitter.emit).not.toHaveBeenCalled();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type NPOTag } from '@npotag/tag';
|
|
2
2
|
import { type InitialisationProps } from '@npotag/tag/dist/types/src/npoTag';
|
|
3
3
|
import type NpoPlayer from '../../../npoplayer';
|
|
4
|
-
export declare function initPlayerTracker(npoplayer: NpoPlayer, _npotag?: InitialisationProps |
|
|
4
|
+
export declare function initPlayerTracker(npoplayer: NpoPlayer, _npotag?: InitialisationProps | undefined, _npotaginstance?: NPOTag): void;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { newATInternetPlugin, newGovoltePlugin, newPageTracker, newTag } from '@npotag/tag';
|
|
2
|
-
const npoTagPlugins = [
|
|
3
|
-
newGovoltePlugin({ maxRetryCount: 5, delayBetweenRetriesInMs: 3000 }),
|
|
4
|
-
newATInternetPlugin()
|
|
5
|
-
];
|
|
2
|
+
const npoTagPlugins = [newGovoltePlugin({ maxRetryCount: 5, delayBetweenRetriesInMs: 3000 }), newATInternetPlugin()];
|
|
6
3
|
export function initPlayerTracker(npoplayer, _npotag, _npotaginstance) {
|
|
7
|
-
if (
|
|
4
|
+
if (npoplayer.npoTag == undefined) {
|
|
8
5
|
npoplayer.npoTag = {
|
|
9
6
|
npoTagInstance: undefined,
|
|
10
|
-
pageTracker:
|
|
7
|
+
pageTracker: undefined,
|
|
11
8
|
heartbeatInterval: undefined
|
|
12
9
|
};
|
|
13
10
|
}
|
|
14
|
-
npoplayer.npoTag.npoTagInstance =
|
|
15
|
-
|
|
16
|
-
? newTag(_npotag, npoTagPlugins)
|
|
17
|
-
: _npotaginstance;
|
|
18
|
-
if (npoplayer.npoTag.npoTagInstance != null) {
|
|
11
|
+
npoplayer.npoTag.npoTagInstance = _npotag == undefined ? _npotaginstance : newTag(_npotag, npoTagPlugins);
|
|
12
|
+
if (npoplayer.npoTag.npoTagInstance != undefined) {
|
|
19
13
|
npoplayer.npoTag.pageTracker = newPageTracker(npoplayer.npoTag.npoTagInstance);
|
|
20
14
|
}
|
|
21
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function startPlayerTracker(playerInstance: any, duration: number, version: string, source: string |
|
|
1
|
+
export declare function startPlayerTracker(playerInstance: any, duration: number, version: string, source: string | undefined): void;
|