@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
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Extensive and up-to-date documentation is available at https://docs.npoplayer.nl
|
|
|
11
11
|
Code quality is analysed by SonarCloud. The project can be found at https://sonarcloud.io/project/overview?id=NPOstart_npo-player
|
|
12
12
|
|
|
13
13
|
# Changelog
|
|
14
|
-
Current version: v1.
|
|
14
|
+
Current version: v1.23.0
|
|
15
15
|
|
|
16
16
|
The changelog is available at https://docs.npoplayer.nl/implementation/web/changelog/
|
|
17
17
|
|
package/lib/js/ads/ster.js
CHANGED
|
@@ -2,14 +2,14 @@ import { AdTagType, PlayerEvent } from 'bitmovin-player';
|
|
|
2
2
|
import { NpoPlayerUIVariants } from '../../types/interfaces';
|
|
3
3
|
export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
4
4
|
return new Promise((resolve) => {
|
|
5
|
-
if (streamObject.metadata.hasPreroll == 'false' || streamObject.assets.preroll ==
|
|
5
|
+
if (streamObject.metadata.hasPreroll == 'false' || streamObject.assets.preroll == undefined) {
|
|
6
6
|
resolve();
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
const prerollUrl = streamObject.assets.preroll;
|
|
10
10
|
let adIndex = 0;
|
|
11
11
|
let totalAds = 0;
|
|
12
|
-
let currentClickListener
|
|
12
|
+
let currentClickListener;
|
|
13
13
|
let adUiSet = false;
|
|
14
14
|
async function handleReady() {
|
|
15
15
|
playerapi.off(PlayerEvent.Ready, handleReady);
|
|
@@ -19,7 +19,7 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
19
19
|
type: AdTagType.VAST
|
|
20
20
|
},
|
|
21
21
|
id: 'Ad',
|
|
22
|
-
position: 'pre'
|
|
22
|
+
position: 'pre'
|
|
23
23
|
};
|
|
24
24
|
await playerapi.ads.schedule(advertConfig);
|
|
25
25
|
}
|
|
@@ -30,15 +30,17 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
30
30
|
}
|
|
31
31
|
playerapi.on(PlayerEvent.Play, handlePlay);
|
|
32
32
|
function setAdUi() {
|
|
33
|
-
|
|
33
|
+
const activeAdBreak = playerapi.ads.getActiveAdBreak();
|
|
34
34
|
if (!activeAdBreak || !activeAdBreak.ads)
|
|
35
35
|
return false;
|
|
36
36
|
npoplayer.uiManager?.release();
|
|
37
|
-
npoplayer.uiManager =
|
|
38
|
-
npoplayer.
|
|
37
|
+
npoplayer.uiManager = undefined;
|
|
38
|
+
if (npoplayer.playerContext) {
|
|
39
|
+
npoplayer.createUIManager(playerapi, npoplayer.playerContext, NpoPlayerUIVariants.AD);
|
|
40
|
+
}
|
|
39
41
|
adUiSet = true;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const adButton = npoplayer.uiComponents.adbutton;
|
|
43
|
+
const currentAd = activeAdBreak.ads[0];
|
|
42
44
|
adIndex = 1;
|
|
43
45
|
totalAds = activeAdBreak.ads.length;
|
|
44
46
|
adButton?.show();
|
|
@@ -58,7 +60,7 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
58
60
|
}
|
|
59
61
|
function handleAdStarted() {
|
|
60
62
|
playerapi.off(PlayerEvent.AdStarted, handleAdStarted);
|
|
61
|
-
|
|
63
|
+
const activeAdBreak = playerapi.ads.getActiveAdBreak();
|
|
62
64
|
if (!activeAdBreak || !activeAdBreak.ads) {
|
|
63
65
|
console.error('No active ad break data found');
|
|
64
66
|
return;
|
|
@@ -69,10 +71,9 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
69
71
|
}
|
|
70
72
|
playerapi.on(PlayerEvent.AdStarted, handleAdStarted);
|
|
71
73
|
function adClickHandler(ad, button) {
|
|
72
|
-
|
|
74
|
+
const clickThroughCallback = ad.clickThroughUrlOpened;
|
|
73
75
|
if (currentClickListener)
|
|
74
76
|
button?.onClick.unsubscribe(currentClickListener);
|
|
75
|
-
clickThroughCallback = ad.clickThroughUrlOpened;
|
|
76
77
|
currentClickListener = () => {
|
|
77
78
|
try {
|
|
78
79
|
window.open(ad.clickThroughUrl, '_blank');
|
|
@@ -84,11 +85,10 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
84
85
|
console.log(error);
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
button.onClick.subscribe(currentClickListener);
|
|
88
88
|
}
|
|
89
89
|
function handleAdFinished() {
|
|
90
90
|
playerapi.off(PlayerEvent.AdFinished, handleAdFinished);
|
|
91
|
-
|
|
91
|
+
const activeAdBreak = playerapi.ads.getActiveAdBreak();
|
|
92
92
|
if (!activeAdBreak || !activeAdBreak.ads) {
|
|
93
93
|
console.error('No active ad break data found');
|
|
94
94
|
return;
|
|
@@ -97,8 +97,8 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
97
97
|
handleAdBreakFinished();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
const adButton = npoplayer.uiComponents.adbutton;
|
|
101
|
+
const nextAd = activeAdBreak.ads[adIndex];
|
|
102
102
|
adIndex += 1;
|
|
103
103
|
adButton?.show();
|
|
104
104
|
adClickHandler(nextAd, adButton);
|
|
@@ -112,8 +112,10 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
|
|
|
112
112
|
npoplayer.uiComponents.adbutton?.hide();
|
|
113
113
|
npoplayer.uiComponents.adlabel?.hide();
|
|
114
114
|
npoplayer.uiManager?.release();
|
|
115
|
-
npoplayer.uiManager =
|
|
116
|
-
npoplayer.
|
|
115
|
+
npoplayer.uiManager = undefined;
|
|
116
|
+
if (npoplayer.playerContext) {
|
|
117
|
+
npoplayer.createUIManager(playerapi, npoplayer.playerContext, NpoPlayerUIVariants.DEFAULT);
|
|
118
|
+
}
|
|
117
119
|
adUiSet = false;
|
|
118
120
|
resolve();
|
|
119
121
|
}
|
package/lib/js/ads/ster.test.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { handlePreRolls } from './ster';
|
|
2
|
-
jest.mock(
|
|
3
|
-
jest.mock(
|
|
4
|
-
describe(
|
|
2
|
+
jest.mock('bitmovin-player');
|
|
3
|
+
jest.mock('../../npoplayer');
|
|
4
|
+
describe('handlePreRolls', () => {
|
|
5
5
|
let mockPlayerAPI;
|
|
6
6
|
let mockNpoPlayer;
|
|
7
7
|
beforeEach(() => {
|
|
8
8
|
mockPlayerAPI = {
|
|
9
9
|
ads: {
|
|
10
|
-
schedule: jest.fn().mockResolvedValue(
|
|
11
|
-
getActiveAdBreak: jest.fn()
|
|
10
|
+
schedule: jest.fn().mockResolvedValue(true),
|
|
11
|
+
getActiveAdBreak: jest.fn()
|
|
12
12
|
},
|
|
13
13
|
on: jest.fn(),
|
|
14
|
-
off: jest.fn()
|
|
14
|
+
off: jest.fn()
|
|
15
15
|
};
|
|
16
16
|
mockNpoPlayer = {
|
|
17
17
|
uiManager: {
|
|
18
|
-
release: jest.fn()
|
|
18
|
+
release: jest.fn()
|
|
19
19
|
},
|
|
20
20
|
createUIManager: jest.fn(),
|
|
21
21
|
uiComponents: {
|
|
@@ -24,33 +24,33 @@ describe("handlePreRolls", () => {
|
|
|
24
24
|
hide: jest.fn(),
|
|
25
25
|
onClick: {
|
|
26
26
|
subscribe: jest.fn(),
|
|
27
|
-
unsubscribe: jest.fn()
|
|
28
|
-
}
|
|
27
|
+
unsubscribe: jest.fn()
|
|
28
|
+
}
|
|
29
29
|
},
|
|
30
30
|
adlabel: {
|
|
31
31
|
setText: jest.fn(),
|
|
32
|
-
hide: jest.fn()
|
|
33
|
-
}
|
|
32
|
+
hide: jest.fn()
|
|
33
|
+
}
|
|
34
34
|
},
|
|
35
|
-
adBreakActive: false
|
|
35
|
+
adBreakActive: false
|
|
36
36
|
};
|
|
37
37
|
});
|
|
38
|
-
it(
|
|
38
|
+
it('should not schedule ads when hasPreroll is false', async () => {
|
|
39
39
|
const streamObject = {
|
|
40
40
|
metadata: {
|
|
41
|
-
hasPreroll:
|
|
41
|
+
hasPreroll: 'false'
|
|
42
42
|
},
|
|
43
43
|
assets: {
|
|
44
|
-
preroll:
|
|
44
|
+
preroll: 'sample_url'
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
await handlePreRolls(mockPlayerAPI, streamObject, mockNpoPlayer);
|
|
48
48
|
expect(mockPlayerAPI.ads.schedule).not.toHaveBeenCalled();
|
|
49
49
|
});
|
|
50
|
-
it(
|
|
50
|
+
it('should not schedule ads if preroll URL is missing', async () => {
|
|
51
51
|
const streamObject = {
|
|
52
52
|
metadata: {
|
|
53
|
-
hasPreroll:
|
|
53
|
+
hasPreroll: 'true'
|
|
54
54
|
},
|
|
55
55
|
assets: {}
|
|
56
56
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { removeTrailingSlash } from '../utilities/utilities.url';
|
|
2
2
|
export async function getStreamObject(npoplayer, payload) {
|
|
3
3
|
try {
|
|
4
4
|
const controller = new AbortController();
|
|
@@ -6,11 +6,11 @@ export async function getStreamObject(npoplayer, payload) {
|
|
|
6
6
|
const timeout = setTimeout(() => {
|
|
7
7
|
controller.abort();
|
|
8
8
|
}, 5000);
|
|
9
|
-
const response = await fetch(
|
|
9
|
+
const response = await fetch(removeTrailingSlash(payload.baseURL) + '/stream-link', {
|
|
10
10
|
method: 'post',
|
|
11
11
|
headers: {
|
|
12
|
-
Accept: '*/*',
|
|
13
|
-
Authorization: payload.jwt,
|
|
12
|
+
'Accept': '*/*',
|
|
13
|
+
'Authorization': payload.jwt,
|
|
14
14
|
'Content-Type': 'application/json'
|
|
15
15
|
},
|
|
16
16
|
body: JSON.stringify(payload.data),
|
|
@@ -18,11 +18,11 @@ export async function getStreamObject(npoplayer, payload) {
|
|
|
18
18
|
});
|
|
19
19
|
clearTimeout(timeout);
|
|
20
20
|
const streamApiResponse = await response.json();
|
|
21
|
-
if (
|
|
22
|
-
|
|
21
|
+
if (response.ok) {
|
|
22
|
+
return streamApiResponse;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
-
|
|
25
|
+
npoplayer.doError(`Het is niet gelukt de stream op te halen: \n ${streamApiResponse.body}`, response.status);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
catch (error) {
|
|
@@ -2,14 +2,14 @@ import { getStreamObject } from './getstreamobject';
|
|
|
2
2
|
import NpoPlayer from '../../npoplayer';
|
|
3
3
|
import fetchMock from 'jest-fetch-mock';
|
|
4
4
|
fetchMock.enableMocks();
|
|
5
|
-
jest.mock('
|
|
6
|
-
processStream: jest.fn()
|
|
5
|
+
jest.mock('../../ui/handlers/streamhandler', () => ({
|
|
6
|
+
processStream: jest.fn()
|
|
7
7
|
}));
|
|
8
8
|
describe('getStreamObject', () => {
|
|
9
9
|
let npoplayer;
|
|
10
10
|
let apiPayload;
|
|
11
11
|
const testPlayerConfig = {
|
|
12
|
-
key: 'dummy key'
|
|
12
|
+
key: 'dummy key'
|
|
13
13
|
};
|
|
14
14
|
const div = document.createElement('div');
|
|
15
15
|
beforeEach(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayerAPI } from
|
|
2
|
-
import { UIManager } from
|
|
3
|
-
import { TimeLineMarker } from
|
|
1
|
+
import { PlayerAPI } from 'bitmovin-player';
|
|
2
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
3
|
+
import { TimeLineMarker } from 'types/interfaces';
|
|
4
4
|
export declare function updateLiveMarkers(timeLineMarkers: TimeLineMarker[], player: PlayerAPI, uiManager: UIManager, autoFillTimeLineMarkerDuration: boolean): void;
|
|
@@ -4,28 +4,27 @@ export function updateLiveMarkers(timeLineMarkers, player, uiManager, autoFillTi
|
|
|
4
4
|
return;
|
|
5
5
|
}
|
|
6
6
|
removeAllMarkers(uiManager);
|
|
7
|
-
|
|
7
|
+
const currentTimeEpoch = Math.floor(Date.now() / 1000);
|
|
8
8
|
timeLineMarkers.sort((a, b) => a.time - b.time);
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const relativeTimeMarkers = timeLineMarkers.map((marker, index) => transformMarker(marker, index, timeLineMarkers, currentTimeEpoch, player, autoFillTimeLineMarkerDuration));
|
|
10
|
+
for (const marker of relativeTimeMarkers) {
|
|
11
11
|
uiManager?.addTimelineMarker(marker);
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
14
|
function transformMarker(marker, index, timeLineMarkers, currentTimeEpoch, player, autoFillTimeLineMarkerDuration) {
|
|
15
15
|
const DVR_WINDOW_LENGTH = Math.abs(player.getMaxTimeShift());
|
|
16
|
-
let duration = marker.duration
|
|
16
|
+
let duration = marker.duration === undefined ? 0 : marker.duration;
|
|
17
17
|
let startTimeRelativeToCurrent = marker.time - currentTimeEpoch;
|
|
18
18
|
if (autoFillTimeLineMarkerDuration) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
duration = timeLineMarkers[index + 1].time - marker.time;
|
|
24
|
-
}
|
|
19
|
+
duration =
|
|
20
|
+
index === timeLineMarkers.length - 1
|
|
21
|
+
? Math.min(currentTimeEpoch, marker.time + DVR_WINDOW_LENGTH) - marker.time
|
|
22
|
+
: timeLineMarkers[index + 1].time - marker.time;
|
|
25
23
|
if (startTimeRelativeToCurrent < -DVR_WINDOW_LENGTH) {
|
|
26
|
-
duration =
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
duration =
|
|
25
|
+
index === timeLineMarkers.length - 1
|
|
26
|
+
? currentTimeEpoch - (currentTimeEpoch - DVR_WINDOW_LENGTH)
|
|
27
|
+
: timeLineMarkers[index + 1].time - (currentTimeEpoch - DVR_WINDOW_LENGTH);
|
|
29
28
|
startTimeRelativeToCurrent = -DVR_WINDOW_LENGTH;
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -33,7 +32,7 @@ function transformMarker(marker, index, timeLineMarkers, currentTimeEpoch, playe
|
|
|
33
32
|
time: marker.time,
|
|
34
33
|
duration: duration,
|
|
35
34
|
title: marker.title,
|
|
36
|
-
cssClasses: ['npo-livestream-marker']
|
|
35
|
+
cssClasses: ['npo-livestream-marker']
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
38
|
function removeAllMarkers(uiManager) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { updateLiveMarkers } from './updateLiveMarkers';
|
|
2
|
-
import { UIManager } from
|
|
3
|
-
jest.mock(
|
|
2
|
+
import { UIManager } from 'bitmovin-player-ui';
|
|
3
|
+
jest.mock('bitmovin-player-ui', () => {
|
|
4
4
|
return {
|
|
5
5
|
UIManager: jest.fn().mockImplementation(() => ({
|
|
6
6
|
getTimelineMarkers: jest.fn().mockReturnValue([]),
|
|
7
7
|
addTimelineMarker: jest.fn(),
|
|
8
|
-
removeTimelineMarker: jest.fn()
|
|
9
|
-
}))
|
|
8
|
+
removeTimelineMarker: jest.fn()
|
|
9
|
+
}))
|
|
10
10
|
};
|
|
11
11
|
});
|
|
12
|
-
jest.mock(
|
|
13
|
-
PlayerAPI: jest.fn()
|
|
12
|
+
jest.mock('bitmovin-player', () => ({
|
|
13
|
+
PlayerAPI: jest.fn()
|
|
14
14
|
}));
|
|
15
15
|
describe('updateLiveMarkers', () => {
|
|
16
16
|
const player = {
|
|
@@ -25,7 +25,7 @@ describe('updateLiveMarkers', () => {
|
|
|
25
25
|
test('should correctly update UI manager with sorted and transformed markers', () => {
|
|
26
26
|
const timeLineMarkers = [
|
|
27
27
|
{ time: 3000, title: 'Marker 2' },
|
|
28
|
-
{ time: 1000, title: 'Marker 1' }
|
|
28
|
+
{ time: 1000, title: 'Marker 1' }
|
|
29
29
|
];
|
|
30
30
|
updateLiveMarkers(timeLineMarkers, player, uiManager, true);
|
|
31
31
|
expect(uiManager.getTimelineMarkers).toHaveBeenCalled();
|
|
@@ -34,19 +34,18 @@ describe('updateLiveMarkers', () => {
|
|
|
34
34
|
expect(uiManager.addTimelineMarker).toHaveBeenCalledWith(expect.objectContaining({
|
|
35
35
|
time: 1000,
|
|
36
36
|
title: 'Marker 1',
|
|
37
|
-
cssClasses: ['npo-livestream-marker']
|
|
37
|
+
cssClasses: ['npo-livestream-marker']
|
|
38
38
|
}));
|
|
39
39
|
expect(uiManager.addTimelineMarker).toHaveBeenCalledWith(expect.objectContaining({
|
|
40
40
|
time: 3000,
|
|
41
41
|
title: 'Marker 2',
|
|
42
|
-
cssClasses: ['npo-livestream-marker']
|
|
42
|
+
cssClasses: ['npo-livestream-marker']
|
|
43
43
|
}));
|
|
44
44
|
});
|
|
45
45
|
test('should remove existing markers before adding new ones', () => {
|
|
46
|
+
;
|
|
46
47
|
uiManager.getTimelineMarkers.mockReturnValue([{ time: 2000, title: 'Existing Marker' }]);
|
|
47
|
-
const timeLineMarkers = [
|
|
48
|
-
{ time: 1000, title: 'New Marker' },
|
|
49
|
-
];
|
|
48
|
+
const timeLineMarkers = [{ time: 1000, title: 'New Marker' }];
|
|
50
49
|
updateLiveMarkers(timeLineMarkers, player, uiManager, true);
|
|
51
50
|
expect(uiManager.removeTimelineMarker).toHaveBeenCalledTimes(1);
|
|
52
51
|
expect(uiManager.addTimelineMarker).toHaveBeenCalledTimes(1);
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { customSpecificErrorMessageOverlayConfig } from
|
|
2
|
-
describe(
|
|
3
|
-
it(
|
|
4
|
-
expect(customSpecificErrorMessageOverlayConfig[1000]).toBe(
|
|
1
|
+
import { customSpecificErrorMessageOverlayConfig } from './handlers/customerrors';
|
|
2
|
+
describe('Test custom error messages', () => {
|
|
3
|
+
it('should return a 1000 error message', () => {
|
|
4
|
+
expect(customSpecificErrorMessageOverlayConfig[1000]).toBe('Oeps, er gaat iets mis');
|
|
5
5
|
});
|
|
6
|
-
it(
|
|
7
|
-
expect(customSpecificErrorMessageOverlayConfig[1001]).toBe(
|
|
6
|
+
it('should return a 1001 error message', () => {
|
|
7
|
+
expect(customSpecificErrorMessageOverlayConfig[1001]).toBe('Oeps, er gaat iets mis');
|
|
8
8
|
});
|
|
9
|
-
it(
|
|
10
|
-
expect(customSpecificErrorMessageOverlayConfig[1101]).toBe(
|
|
9
|
+
it('should return a 1101 error message', () => {
|
|
10
|
+
expect(customSpecificErrorMessageOverlayConfig[1101]).toBe('De player is niet aangemaakt');
|
|
11
11
|
});
|
|
12
|
-
it(
|
|
13
|
-
expect(customSpecificErrorMessageOverlayConfig[1102]).toBe(
|
|
12
|
+
it('should return a 1102 error message', () => {
|
|
13
|
+
expect(customSpecificErrorMessageOverlayConfig[1102]).toBe('Er ging iets mis met de configuratie');
|
|
14
14
|
});
|
|
15
|
-
it(
|
|
16
|
-
expect(customSpecificErrorMessageOverlayConfig[1103]).toBe(
|
|
15
|
+
it('should return a 1103 error message', () => {
|
|
16
|
+
expect(customSpecificErrorMessageOverlayConfig[1103]).toBe('Er is iets mis met de licentie (access key)');
|
|
17
17
|
});
|
|
18
|
-
it(
|
|
19
|
-
expect(customSpecificErrorMessageOverlayConfig[1104]).toBe(
|
|
18
|
+
it('should return a 1104 error message', () => {
|
|
19
|
+
expect(customSpecificErrorMessageOverlayConfig[1104]).toBe('De video kan niet worden afgespeeld op dit domein');
|
|
20
20
|
});
|
|
21
|
-
it(
|
|
22
|
-
expect(customSpecificErrorMessageOverlayConfig[1105]).toBe(
|
|
21
|
+
it('should return a 1105 error message', () => {
|
|
22
|
+
expect(customSpecificErrorMessageOverlayConfig[1105]).toBe('De video kan niet op dit web-adres worden afgespeeld');
|
|
23
23
|
});
|
|
24
|
-
it(
|
|
25
|
-
expect(customSpecificErrorMessageOverlayConfig[1113]).toBe(
|
|
24
|
+
it('should return a 1113 error message', () => {
|
|
25
|
+
expect(customSpecificErrorMessageOverlayConfig[1113]).toBe('De video kan niet worden afgespeeld zonder web server');
|
|
26
26
|
});
|
|
27
|
-
it(
|
|
28
|
-
expect(customSpecificErrorMessageOverlayConfig[1201]).toBe(
|
|
27
|
+
it('should return a 1201 error message', () => {
|
|
28
|
+
expect(customSpecificErrorMessageOverlayConfig[1201]).toBe('Er is iets mis met de source configuratie');
|
|
29
29
|
});
|
|
30
|
-
it(
|
|
31
|
-
expect(customSpecificErrorMessageOverlayConfig[1202]({ code: 1202 })).toBe(
|
|
30
|
+
it('should return a 1202 error message', () => {
|
|
31
|
+
expect(customSpecificErrorMessageOverlayConfig[1202]({ code: 1202 })).toBe('The downloaded manifest is invalid');
|
|
32
32
|
});
|
|
33
|
-
it(
|
|
34
|
-
expect(customSpecificErrorMessageOverlayConfig[1203]).toBe(
|
|
33
|
+
it('should return a 1203 error message', () => {
|
|
34
|
+
expect(customSpecificErrorMessageOverlayConfig[1203]).toBe('Helaas, deze video is niet beschikbaar.');
|
|
35
35
|
});
|
|
36
|
-
it(
|
|
36
|
+
it('should return a 1208 error message', () => {
|
|
37
37
|
const errorMessage = customSpecificErrorMessageOverlayConfig[1208]({
|
|
38
|
-
data: { statusCode: 1 }
|
|
38
|
+
data: { statusCode: 1 }
|
|
39
39
|
});
|
|
40
|
-
expect(errorMessage).toBe(
|
|
40
|
+
expect(errorMessage).toBe('Manifest laden mislukt met HTTP fout 1');
|
|
41
41
|
});
|
|
42
|
-
it(
|
|
43
|
-
expect(customSpecificErrorMessageOverlayConfig[1400]).toBe(
|
|
42
|
+
it('should return a 1400 error message', () => {
|
|
43
|
+
expect(customSpecificErrorMessageOverlayConfig[1400]).toBe('Er is iets mis met uw internet-verbinding');
|
|
44
44
|
});
|
|
45
|
-
it(
|
|
46
|
-
expect(customSpecificErrorMessageOverlayConfig[2003]).toBe(
|
|
45
|
+
it('should return a 2003 error message', () => {
|
|
46
|
+
expect(customSpecificErrorMessageOverlayConfig[2003]).toBe('Oeps, er is iets mis met het opvragen van de DRM');
|
|
47
47
|
});
|
|
48
|
-
it(
|
|
49
|
-
expect(customSpecificErrorMessageOverlayConfig[2006]).toBe(
|
|
48
|
+
it('should return a 2006 error message', () => {
|
|
49
|
+
expect(customSpecificErrorMessageOverlayConfig[2006]).toBe('Oeps, er is iets mis met de DRM');
|
|
50
50
|
});
|
|
51
51
|
});
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { ErrorUtils } from
|
|
1
|
+
import { ErrorUtils } from 'bitmovin-player-ui';
|
|
2
2
|
export const customSpecificErrorMessageOverlayConfig = {
|
|
3
|
-
1000:
|
|
4
|
-
1001:
|
|
5
|
-
1101:
|
|
6
|
-
1102:
|
|
7
|
-
1103:
|
|
8
|
-
1104:
|
|
9
|
-
1105:
|
|
10
|
-
1106:
|
|
11
|
-
1107:
|
|
12
|
-
1108:
|
|
13
|
-
1113:
|
|
14
|
-
1201:
|
|
3
|
+
1000: 'Oeps, er gaat iets mis',
|
|
4
|
+
1001: 'Oeps, er gaat iets mis',
|
|
5
|
+
1101: 'De player is niet aangemaakt',
|
|
6
|
+
1102: 'Er ging iets mis met de configuratie',
|
|
7
|
+
1103: 'Er is iets mis met de licentie (access key)',
|
|
8
|
+
1104: 'De video kan niet worden afgespeeld op dit domein',
|
|
9
|
+
1105: 'De video kan niet op dit web-adres worden afgespeeld',
|
|
10
|
+
1106: '',
|
|
11
|
+
1107: '',
|
|
12
|
+
1108: '',
|
|
13
|
+
1113: 'De video kan niet worden afgespeeld zonder web server',
|
|
14
|
+
1201: 'Er is iets mis met de source configuratie',
|
|
15
15
|
1202: (error) => {
|
|
16
16
|
return ErrorUtils.defaultErrorMessages[error.code];
|
|
17
17
|
},
|
|
18
|
-
1203:
|
|
19
|
-
1204:
|
|
20
|
-
1205:
|
|
21
|
-
1206:
|
|
22
|
-
1207:
|
|
18
|
+
1203: 'Helaas, deze video is niet beschikbaar.',
|
|
19
|
+
1204: '',
|
|
20
|
+
1205: '',
|
|
21
|
+
1206: '',
|
|
22
|
+
1207: '',
|
|
23
23
|
1208: (error) => {
|
|
24
24
|
const statusCode = error.data.statusCode;
|
|
25
|
-
return
|
|
25
|
+
return 'Manifest laden mislukt met HTTP fout ' + statusCode;
|
|
26
26
|
},
|
|
27
|
-
1209:
|
|
28
|
-
1210:
|
|
29
|
-
1211:
|
|
30
|
-
1301:
|
|
31
|
-
1304:
|
|
32
|
-
1400:
|
|
33
|
-
1401:
|
|
34
|
-
1402:
|
|
35
|
-
1403:
|
|
36
|
-
1404:
|
|
37
|
-
2001:
|
|
38
|
-
2002:
|
|
39
|
-
2003:
|
|
40
|
-
2005:
|
|
41
|
-
2006:
|
|
42
|
-
2007:
|
|
43
|
-
2008:
|
|
44
|
-
2009:
|
|
45
|
-
2010:
|
|
46
|
-
2011:
|
|
47
|
-
2012:
|
|
48
|
-
2013:
|
|
49
|
-
2015:
|
|
50
|
-
2101:
|
|
51
|
-
3001:
|
|
52
|
-
3002:
|
|
53
|
-
3003:
|
|
54
|
-
3004:
|
|
55
|
-
4000:
|
|
27
|
+
1209: '',
|
|
28
|
+
1210: '',
|
|
29
|
+
1211: '',
|
|
30
|
+
1301: '',
|
|
31
|
+
1304: '',
|
|
32
|
+
1400: 'Er is iets mis met uw internet-verbinding',
|
|
33
|
+
1401: '',
|
|
34
|
+
1402: '',
|
|
35
|
+
1403: '',
|
|
36
|
+
1404: '',
|
|
37
|
+
2001: '',
|
|
38
|
+
2002: '',
|
|
39
|
+
2003: 'Oeps, er is iets mis met het opvragen van de DRM',
|
|
40
|
+
2005: '',
|
|
41
|
+
2006: 'Oeps, er is iets mis met de DRM',
|
|
42
|
+
2007: '',
|
|
43
|
+
2008: '',
|
|
44
|
+
2009: '',
|
|
45
|
+
2010: '',
|
|
46
|
+
2011: '',
|
|
47
|
+
2012: '',
|
|
48
|
+
2013: '',
|
|
49
|
+
2015: '',
|
|
50
|
+
2101: '',
|
|
51
|
+
3001: '',
|
|
52
|
+
3002: '',
|
|
53
|
+
3003: '',
|
|
54
|
+
3004: '',
|
|
55
|
+
4000: ''
|
|
56
56
|
};
|
|
@@ -7,7 +7,7 @@ export function handlePlayerError(player, uiComponents, input) {
|
|
|
7
7
|
player.unload();
|
|
8
8
|
if (uiComponents.controlbar)
|
|
9
9
|
uiComponents.controlbar.hide();
|
|
10
|
-
if (uiComponents.errorMessageOverlay ==
|
|
10
|
+
if (uiComponents.errorMessageOverlay == undefined)
|
|
11
11
|
return;
|
|
12
12
|
uiComponents.errorMessageOverlay.show();
|
|
13
13
|
uiComponents.errorMessageOverlay.errorLabel.setText(message ?? 'De video kan niet worden geladen');
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { handlePlayerError } from
|
|
1
|
+
import { handlePlayerError } from './error';
|
|
2
2
|
const hide = jest.fn();
|
|
3
3
|
const unload = jest.fn();
|
|
4
4
|
const setText = jest.fn();
|
|
5
5
|
const show = jest.fn();
|
|
6
|
-
const input =
|
|
6
|
+
const input = 'string';
|
|
7
7
|
const player = { unload };
|
|
8
8
|
const uiComponents = {
|
|
9
9
|
controlbar: { hide },
|
|
10
10
|
errorMessageOverlay: {
|
|
11
11
|
errorLabel: { setText },
|
|
12
|
-
show
|
|
13
|
-
}
|
|
12
|
+
show
|
|
13
|
+
}
|
|
14
14
|
};
|
|
15
|
-
describe(
|
|
15
|
+
describe('Test DRM verification', () => {
|
|
16
16
|
afterEach(() => {
|
|
17
17
|
jest.resetAllMocks();
|
|
18
18
|
});
|
|
19
|
-
it(
|
|
19
|
+
it('should call player.unload', () => {
|
|
20
20
|
handlePlayerError(player, uiComponents, input);
|
|
21
21
|
expect(unload).toHaveBeenCalled();
|
|
22
22
|
});
|
|
23
|
-
it(
|
|
23
|
+
it('should hide the controlbar', () => {
|
|
24
24
|
handlePlayerError(player, uiComponents, input);
|
|
25
25
|
expect(hide).toHaveBeenCalled();
|
|
26
26
|
});
|
|
27
|
-
it(
|
|
27
|
+
it('should not hide the controlbar', () => {
|
|
28
28
|
const components = {
|
|
29
29
|
...uiComponents,
|
|
30
|
-
controlbar: undefined
|
|
30
|
+
controlbar: undefined
|
|
31
31
|
};
|
|
32
32
|
handlePlayerError(player, components, input);
|
|
33
33
|
expect(hide).not.toHaveBeenCalled();
|
|
34
34
|
});
|
|
35
|
-
it(
|
|
35
|
+
it('should show the message overlay', () => {
|
|
36
36
|
handlePlayerError(player, uiComponents, input);
|
|
37
37
|
expect(show).toHaveBeenCalled();
|
|
38
38
|
expect(setText).toHaveBeenCalled();
|
|
39
39
|
});
|
|
40
|
-
it(
|
|
40
|
+
it('should not show the message overlay', () => {
|
|
41
41
|
handlePlayerError(player, { ...uiComponents, errorMessageOverlay: undefined }, input);
|
|
42
42
|
expect(show).not.toHaveBeenCalled();
|
|
43
43
|
});
|
|
@@ -2,5 +2,5 @@ import { type PlayerAPI } from 'bitmovin-player';
|
|
|
2
2
|
import type NpoPlayer from '../../../npoplayer';
|
|
3
3
|
import { type StreamOptions } from 'types/interfaces';
|
|
4
4
|
export declare function handleStartOffset(player: PlayerAPI, offset?: number): void;
|
|
5
|
-
export declare function shiftToProgramStart(player: PlayerAPI |
|
|
6
|
-
export declare function handleLiveOffsetLogic(npoplayer: NpoPlayer, player: PlayerAPI |
|
|
5
|
+
export declare function shiftToProgramStart(player: PlayerAPI | undefined, timestamp?: number): void;
|
|
6
|
+
export declare function handleLiveOffsetLogic(npoplayer: NpoPlayer, player: PlayerAPI | undefined, options: StreamOptions): void;
|