@npo/player 1.22.5 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/js/ads/ster.js +21 -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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { processNicam } from './nicamhandler';
|
|
2
|
+
import * as playerAction from '../../js/playeractions/playeractions';
|
|
3
|
+
import { PlayerEvent } from 'bitmovin-player';
|
|
4
|
+
import { initSegment } from '../../services/segmentHandlers/initSegment';
|
|
5
|
+
import { handleLiveStreamControls } from '../../services/liveStreamHandlers/handleLiveStreamControls';
|
|
6
|
+
import { removeEventListeners } from '../../services/eventListenerHandlers/removeEventListeners';
|
|
7
|
+
export function processStream(streamObject, container, streamOptions, player, uiManager, sourceConfig, playerContext) {
|
|
8
|
+
if (!streamObject)
|
|
9
|
+
return;
|
|
10
|
+
if (uiManager == undefined)
|
|
11
|
+
return;
|
|
12
|
+
removeEventListeners(playerContext);
|
|
13
|
+
processNicam(streamObject, container.querySelector('.bmpui-nicam'), streamOptions);
|
|
14
|
+
initSegment(playerContext, {
|
|
15
|
+
segment: streamObject.segment,
|
|
16
|
+
fragment: streamOptions?.fragments
|
|
17
|
+
});
|
|
18
|
+
if (streamOptions?.startOffset) {
|
|
19
|
+
playerAction.handleStartOffset(player, streamOptions.startOffset);
|
|
20
|
+
}
|
|
21
|
+
const isLiveStream = streamObject.stream.isLiveStream;
|
|
22
|
+
const isLiveStreamNoDvr = isLiveStream && streamObject.stream.hasDvrWindow === false;
|
|
23
|
+
const isAudioOnly = streamObject.stream.avType === 'aod' || streamObject.stream.avType === 'audio';
|
|
24
|
+
const playerContainer = container.querySelector('.bmpui-ui-uicontainer');
|
|
25
|
+
const poster = container.querySelector('.bitmovinplayer-poster');
|
|
26
|
+
const audioOnlyClass = 'audio-only';
|
|
27
|
+
const liveStreamNoDvrClass = 'livestream-no-dvr';
|
|
28
|
+
if (isLiveStream && !isLiveStreamNoDvr) {
|
|
29
|
+
handleLiveStreamControls(playerContext);
|
|
30
|
+
}
|
|
31
|
+
if (isLiveStreamNoDvr) {
|
|
32
|
+
playerContainer?.classList.add(liveStreamNoDvrClass);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
playerContainer?.classList.remove(liveStreamNoDvrClass);
|
|
36
|
+
}
|
|
37
|
+
if (isAudioOnly) {
|
|
38
|
+
playerContainer?.classList.add(audioOnlyClass);
|
|
39
|
+
poster?.classList.add(audioOnlyClass);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
playerContainer?.classList.remove(audioOnlyClass);
|
|
43
|
+
poster?.classList.remove(audioOnlyClass);
|
|
44
|
+
}
|
|
45
|
+
const isAutoplayEnabled = player.getConfig()?.playback?.autoplay ?? false;
|
|
46
|
+
if (isAutoplayEnabled && (sourceConfig?.progressive || streamObject?.stream?.streamProfile === 'progressive')) {
|
|
47
|
+
player.on(PlayerEvent.SourceLoaded, () => {
|
|
48
|
+
player?.play();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UIContainer } from 'bitmovin-player-ui';
|
|
2
2
|
import { PlayerAPI } from 'bitmovin-player';
|
|
3
|
-
import { CustomMessageHandlerInterface, CustomMessages } from '
|
|
3
|
+
import { CustomMessageHandlerInterface, CustomMessages } from '../types/interfaces';
|
|
4
4
|
export declare function sendCustomMessage(message: CustomMessages, data?: CustomMessageHandlerInterface): CustomMessageHandlerInterface;
|
|
5
5
|
export declare function nativeMobileUIContainer(player: PlayerAPI): UIContainer;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { BufferingOverlay, CastStatusOverlay, ErrorMessageOverlay, PlaybackToggleOverlay, PlayerUtils, SubtitleOverlay, UIContainer
|
|
1
|
+
import { BufferingOverlay, CastStatusOverlay, ErrorMessageOverlay, PlaybackToggleOverlay, PlayerUtils, SubtitleOverlay, UIContainer } from 'bitmovin-player-ui';
|
|
2
2
|
import { createCTABar } from './components/nativemobile/ctabar';
|
|
3
3
|
import { createControlBar } from './components/nativemobile/controlbar';
|
|
4
4
|
import { createTopBar } from './components/nativemobile/topbar';
|
|
5
|
-
import { createSettingsPanel } from './components/settingspanel';
|
|
6
5
|
import { createMiddleButtons } from './components/nativemobile/buttons';
|
|
7
6
|
import { createTitleBar } from './components/nativemobile/titlebar';
|
|
8
7
|
const defaultData = {
|
|
9
|
-
defaultActionRequired: true
|
|
8
|
+
defaultActionRequired: true
|
|
10
9
|
};
|
|
11
10
|
export function sendCustomMessage(message, data) {
|
|
12
11
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
else {
|
|
17
|
-
return JSON.parse(window.bitmovin.customMessageHandler.sendSynchronous(message));
|
|
18
|
-
}
|
|
12
|
+
return data === undefined
|
|
13
|
+
? JSON.parse(window.bitmovin.customMessageHandler.sendSynchronous(message))
|
|
14
|
+
: JSON.parse(window.bitmovin.customMessageHandler.sendSynchronous(message, JSON.stringify(data)));
|
|
19
15
|
}
|
|
20
16
|
catch {
|
|
21
17
|
return defaultData;
|
|
@@ -23,10 +19,9 @@ export function sendCustomMessage(message, data) {
|
|
|
23
19
|
}
|
|
24
20
|
export function nativeMobileUIContainer(player) {
|
|
25
21
|
const middleButtons = createMiddleButtons(player);
|
|
26
|
-
const settingsPanel = createSettingsPanel(player);
|
|
27
22
|
const ctaBar = createCTABar(player);
|
|
28
|
-
const topBar = createTopBar(player
|
|
29
|
-
const controlBar = createControlBar(player
|
|
23
|
+
const topBar = createTopBar(player);
|
|
24
|
+
const controlBar = createControlBar(player);
|
|
30
25
|
const errorMessageOverlay = new ErrorMessageOverlay();
|
|
31
26
|
return new UIContainer({
|
|
32
27
|
components: [
|
|
@@ -42,6 +37,6 @@ export function nativeMobileUIContainer(player) {
|
|
|
42
37
|
errorMessageOverlay
|
|
43
38
|
],
|
|
44
39
|
cssClasses: ['npo-player', 'native-mobile'],
|
|
45
|
-
hidePlayerStateExceptions: [PlayerUtils.PlayerState.Paused, PlayerUtils.PlayerState.Finished]
|
|
40
|
+
hidePlayerStateExceptions: [PlayerUtils.PlayerState.Paused, PlayerUtils.PlayerState.Finished]
|
|
46
41
|
});
|
|
47
42
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { PlayerEvent } from 'bitmovin-player';
|
|
2
2
|
import { UIManager } from 'bitmovin-player-ui';
|
|
3
|
-
import { customSpecificErrorMessageOverlayConfig } from '../playeractions/handlers/customerrors';
|
|
4
|
-
import { localizationConfig } from '../
|
|
3
|
+
import { customSpecificErrorMessageOverlayConfig } from '../js/playeractions/handlers/customerrors';
|
|
4
|
+
import { localizationConfig } from '../js/settings/localization';
|
|
5
5
|
import { nativeMobileUIContainer, sendCustomMessage } from './nativemobileuicontainer';
|
|
6
|
-
import {
|
|
7
|
-
import { CustomMessages } from '../../types/interfaces';
|
|
6
|
+
import { CustomMessages } from '../types/interfaces';
|
|
8
7
|
import { processNicam } from './handlers/nicamhandler';
|
|
9
|
-
import {
|
|
10
|
-
import { getPlayerElement, removePlayerElementClass } from '../utilities/utilities';
|
|
8
|
+
import { getElementByQuery, removeClassFromElementByQuery } from '../js/utilities/utilities.element';
|
|
11
9
|
import { handleLiveStreamNoDvr } from './handlers/domhandlers';
|
|
12
|
-
import { removeReplayClass } from '../playeractions/handlers/removereplayclass';
|
|
10
|
+
import { removeReplayClass } from '../js/playeractions/handlers/removereplayclass';
|
|
11
|
+
let adBreakActive = false;
|
|
13
12
|
export function nativeMobileUiFactory(player, config = {}) {
|
|
14
13
|
UIManager.setLocalizationConfig(localizationConfig);
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const nicamElement = getElementByQuery({ container: player.getContainer(), query: '.bmpui-nicam' });
|
|
15
|
+
const seekbarTitleElement = getElementByQuery({
|
|
16
|
+
container: player.getContainer(),
|
|
17
|
+
query: '.bmpui-seekbar-label-title'
|
|
18
|
+
});
|
|
19
19
|
const uiConfig = {
|
|
20
20
|
...config,
|
|
21
21
|
errorMessages: customSpecificErrorMessageOverlayConfig,
|
|
22
|
-
disableAutoHideWhenHovered: true
|
|
22
|
+
disableAutoHideWhenHovered: true
|
|
23
23
|
};
|
|
24
24
|
const mobileUIManager = new UIManager(player, nativeMobileUIContainer(player), uiConfig);
|
|
25
25
|
let _webData = {};
|
|
@@ -33,8 +33,11 @@ export function nativeMobileUiFactory(player, config = {}) {
|
|
|
33
33
|
nicamElement.innerHTML = '';
|
|
34
34
|
if (seekbarTitleElement)
|
|
35
35
|
seekbarTitleElement.textContent = '';
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
removeClassFromElementByQuery({
|
|
37
|
+
className: 'livestream-no-dvr',
|
|
38
|
+
container: player.getContainer(),
|
|
39
|
+
query: '.bmpui-npo-player'
|
|
40
|
+
});
|
|
38
41
|
};
|
|
39
42
|
const updateUI = () => {
|
|
40
43
|
if (_webData.assets.preroll) {
|
|
@@ -42,16 +45,10 @@ export function nativeMobileUiFactory(player, config = {}) {
|
|
|
42
45
|
player.on(PlayerEvent.AdBreakFinished, setAdBreakActiveToFalse);
|
|
43
46
|
}
|
|
44
47
|
if (_webData.metadata?.ageRating)
|
|
45
|
-
processNicam(_webData, nicamElement,
|
|
48
|
+
processNicam(_webData, nicamElement, undefined);
|
|
46
49
|
if (seekbarTitleElement)
|
|
47
50
|
seekbarTitleElement.textContent = _webData.title || '';
|
|
48
|
-
handleLiveStreamNoDvr(player, _webData
|
|
49
|
-
const section = _webData.segment ? {
|
|
50
|
-
start: _webData.segment.inpoint,
|
|
51
|
-
end: _webData.segment.outpoint,
|
|
52
|
-
title: _webData?.title || '',
|
|
53
|
-
} : null;
|
|
54
|
-
addFragments(player, mobileUIManager, section);
|
|
51
|
+
handleLiveStreamNoDvr(player, _webData);
|
|
55
52
|
};
|
|
56
53
|
const setAdBreakActiveToFalse = () => {
|
|
57
54
|
adBreakActive = false;
|
|
@@ -85,7 +82,7 @@ export function nativeMobileUiFactory(player, config = {}) {
|
|
|
85
82
|
const input = data.input;
|
|
86
83
|
if (input) {
|
|
87
84
|
const uiComponents = mobileUIManager.activeUi.getUI().getComponents();
|
|
88
|
-
const errorMessageOverlay = uiComponents.find(component => component.getConfig().cssClass === 'ui-errormessage-overlay');
|
|
85
|
+
const errorMessageOverlay = uiComponents.find((component) => component.getConfig().cssClass === 'ui-errormessage-overlay');
|
|
89
86
|
if (!errorMessageOverlay)
|
|
90
87
|
return;
|
|
91
88
|
try {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { nativeMobileUiFactory } from './nativemobileuifactory';
|
|
2
|
-
import { CustomMessages } from '
|
|
2
|
+
import { CustomMessages } from '../types/interfaces';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
3
4
|
const title = 'Test Stream';
|
|
4
5
|
let storedCallbacks = {};
|
|
5
6
|
jest.mock('bitmovin-player-ui', () => {
|
|
6
|
-
return jest.requireActual('
|
|
7
|
+
return jest.requireActual('../../tests/mocks/mockPlayerUi').mockPlayerUi;
|
|
7
8
|
});
|
|
8
9
|
describe('nativeMobileUiFactory', () => {
|
|
9
10
|
let mockPlayer;
|
|
@@ -23,15 +24,16 @@ describe('nativeMobileUiFactory', () => {
|
|
|
23
24
|
on: jest.fn(),
|
|
24
25
|
off: jest.fn(),
|
|
25
26
|
getContainer: () => containerElement,
|
|
26
|
-
getVolume: jest.fn().mockReturnValue(50)
|
|
27
|
+
getVolume: jest.fn().mockReturnValue(50)
|
|
27
28
|
};
|
|
28
29
|
storedCallbacks = {};
|
|
29
30
|
if (storedCallbacks) {
|
|
31
|
+
;
|
|
30
32
|
window.bitmovin = window.bitmovin || {};
|
|
31
33
|
window.bitmovin.customMessageHandler = {
|
|
32
34
|
on: jest.fn((messageType, callbackFn) => {
|
|
33
35
|
storedCallbacks[messageType] = callbackFn;
|
|
34
|
-
})
|
|
36
|
+
})
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
nativeMobileUiFactory(mockPlayer);
|
|
@@ -41,14 +43,14 @@ describe('nativeMobileUiFactory', () => {
|
|
|
41
43
|
title: title,
|
|
42
44
|
metadata: {
|
|
43
45
|
ageRating: '12',
|
|
44
|
-
nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
|
|
46
|
+
nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
|
|
45
47
|
},
|
|
46
48
|
stream: {
|
|
47
49
|
isLiveStream: true,
|
|
48
50
|
hasDvrWindow: false
|
|
49
51
|
},
|
|
50
52
|
assets: {
|
|
51
|
-
preroll:
|
|
53
|
+
preroll: undefined
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
if (storedCallbacks[CustomMessages.SET_STREAM_LINK]) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type NpoPlayer from '
|
|
1
|
+
import type NpoPlayer from '../npoplayer';
|
|
2
2
|
import { UIContainer } from 'bitmovin-player-ui';
|
|
3
3
|
import { PlayerAPI } from 'bitmovin-player';
|
|
4
|
-
import { NpoPlayerUIVariants } from '
|
|
4
|
+
import { NpoPlayerUIVariants } from '../types/interfaces';
|
|
5
5
|
export declare function createUIContainer(npoplayer: NpoPlayer, player: PlayerAPI, variant: NpoPlayerUIVariants, container: HTMLElement): UIContainer;
|
|
6
|
-
export declare function removeUIContainer(container: HTMLElement): void;
|
|
@@ -7,32 +7,37 @@ import { createTopBar } from './components/topbar';
|
|
|
7
7
|
import { createControlBar } from './components/controlbar';
|
|
8
8
|
import { createAudioControlBar } from './components/audio/controlbar';
|
|
9
9
|
import { createTitleBar } from './components/titlebar';
|
|
10
|
-
import {
|
|
11
|
-
import { localizationConfig } from '../
|
|
12
|
-
import { NpoPlayerUIVariants } from '
|
|
10
|
+
import { localizeKey } from '../js/utilities/utilities.locale';
|
|
11
|
+
import { localizationConfig } from '../js/settings/localization';
|
|
12
|
+
import { NpoPlayerUIVariants } from '../types/interfaces';
|
|
13
13
|
export function createUIContainer(npoplayer, player, variant, container) {
|
|
14
|
-
|
|
14
|
+
const cssClassArray = ['npo-player'];
|
|
15
15
|
let uiDelay = 3000;
|
|
16
|
-
container.
|
|
16
|
+
container.dataset.npoPlayerVersion = npoplayer.version;
|
|
17
17
|
container.classList.remove('bitmovinplayer-audio-container');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
switch (variant) {
|
|
19
|
+
case NpoPlayerUIVariants.DEFAULT: {
|
|
20
|
+
uiDelay = 3000;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case NpoPlayerUIVariants.AD: {
|
|
24
|
+
uiDelay = -1;
|
|
25
|
+
cssClassArray.push('ster-ad');
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case NpoPlayerUIVariants.AUDIO: {
|
|
29
|
+
uiDelay = -1;
|
|
30
|
+
container.classList.add('bitmovinplayer-audio-container');
|
|
31
|
+
cssClassArray.push('audio');
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
const middleButtons = createMiddleButtons(player);
|
|
31
36
|
const playNextScreen = createPlayNextScreen(player, npoplayer);
|
|
32
37
|
const settingsPanel = createSettingsPanel(npoplayer);
|
|
33
38
|
const ctaBar = createCTABar(player, npoplayer, variant);
|
|
34
|
-
const topBar = createTopBar(
|
|
35
|
-
const controlBar = createControlBar(npoplayer
|
|
39
|
+
const topBar = createTopBar(npoplayer);
|
|
40
|
+
const controlBar = createControlBar(npoplayer);
|
|
36
41
|
const titleBar = createTitleBar(npoplayer);
|
|
37
42
|
const playbackToggleOverlay = new PlaybackToggleOverlay();
|
|
38
43
|
const audioControlbar = createAudioControlBar(npoplayer);
|
|
@@ -45,44 +50,25 @@ export function createUIContainer(npoplayer, player, variant, container) {
|
|
|
45
50
|
bufferingOverlay,
|
|
46
51
|
playbackToggleOverlay,
|
|
47
52
|
new CastStatusOverlay(),
|
|
48
|
-
middleButtons
|
|
49
|
-
];
|
|
50
|
-
const baseComponentsAfter = [
|
|
51
|
-
errorMessageOverlay
|
|
53
|
+
middleButtons
|
|
52
54
|
];
|
|
53
|
-
|
|
55
|
+
const baseComponentsAfter = [errorMessageOverlay];
|
|
56
|
+
const conditionalComponents = [];
|
|
54
57
|
if (variant === NpoPlayerUIVariants.DEFAULT) {
|
|
55
|
-
conditionalComponents.push(...baseComponentsBefore);
|
|
56
|
-
conditionalComponents.push(playNextScreen);
|
|
57
|
-
conditionalComponents.push(controlBar);
|
|
58
|
-
conditionalComponents.push(ctaBar);
|
|
59
|
-
conditionalComponents.push(titleBar);
|
|
60
|
-
conditionalComponents.push(topBar);
|
|
58
|
+
conditionalComponents.push(...baseComponentsBefore, playNextScreen, controlBar, ctaBar, titleBar, topBar);
|
|
61
59
|
}
|
|
62
60
|
if (variant === NpoPlayerUIVariants.AUDIO) {
|
|
63
|
-
conditionalComponents.push(new PlaybackToggleButton());
|
|
64
|
-
conditionalComponents.push(audioControlbar);
|
|
65
|
-
conditionalComponents.push(titleBar);
|
|
61
|
+
conditionalComponents.push(new PlaybackToggleButton(), audioControlbar, titleBar);
|
|
66
62
|
}
|
|
67
63
|
if (variant === NpoPlayerUIVariants.AD) {
|
|
68
|
-
conditionalComponents.push(...baseComponentsBefore);
|
|
69
|
-
conditionalComponents.push(controlBar);
|
|
70
|
-
conditionalComponents.push(ctaBar);
|
|
64
|
+
conditionalComponents.push(...baseComponentsBefore, controlBar, ctaBar);
|
|
71
65
|
}
|
|
72
66
|
UIManager.setLocalizationConfig(localizationConfig);
|
|
73
67
|
return new UIContainer({
|
|
74
68
|
components: [...conditionalComponents, ...baseComponentsAfter],
|
|
75
69
|
cssClasses: cssClassArray,
|
|
76
|
-
ariaLabel:
|
|
70
|
+
ariaLabel: localizeKey('player'),
|
|
77
71
|
hideDelay: uiDelay,
|
|
78
|
-
hidePlayerStateExceptions: [PlayerUtils.PlayerState.Paused]
|
|
72
|
+
hidePlayerStateExceptions: [PlayerUtils.PlayerState.Paused]
|
|
79
73
|
});
|
|
80
74
|
}
|
|
81
|
-
export function removeUIContainer(container) {
|
|
82
|
-
for (let i = 0; i < container.attributes.length; i += 1) {
|
|
83
|
-
const attributeName = container.attributes[i].name;
|
|
84
|
-
if (attributeName.startsWith('data-')) {
|
|
85
|
-
container.removeAttribute(attributeName);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npo/player",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.1",
|
|
4
4
|
"description": "NPO Player",
|
|
5
5
|
"author": "Publieke Omroep <player@npo.nl>",
|
|
6
6
|
"contributors": [
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"types": "./lib/npoplayer.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "webpack --hot",
|
|
19
|
-
"build:scss": "npm run build:web-styles && npm run build:mobile-styles && mkdir -p dist && cp src/scss/*.css dist && cp src/scss/*.css.map
|
|
20
|
-
"build:web-styles": "sass src/
|
|
21
|
-
"build:mobile-styles": "sass src/
|
|
19
|
+
"build:scss": "npm run build:web-styles && npm run build:mobile-styles && mkdir -p dist && cp src/style/*.css dist && mkdir src/scss && cp src/style/*.css.map dist && cp src/style/*.css src/scss && cp src/style/*.css.map src/scss",
|
|
20
|
+
"build:web-styles": "sass src/style/npoplayer.scss:src/style/npoplayer.css --style=compressed && postcss src/style/npoplayer.css --use autoprefixer postcss-import -o src/style/npoplayer.css",
|
|
21
|
+
"build:mobile-styles": "sass src/style/npoplayer-mobile.scss:src/style/npoplayer-mobile.css --style=compressed && postcss src/style/npoplayer-mobile.css --use autoprefixer postcss-import -o src/style/npoplayer-mobile.css",
|
|
22
22
|
"build:cdn": "npm run build && bash build-cdn.sh",
|
|
23
23
|
"lint": "eslint src --fix",
|
|
24
24
|
"bundle": "npm run lint && bash build-lib.sh && npm run build:scss && npm run build:cdn",
|
|
@@ -33,16 +33,17 @@
|
|
|
33
33
|
"README.md",
|
|
34
34
|
"CHANGELOG.md",
|
|
35
35
|
"lib",
|
|
36
|
-
"src/
|
|
37
|
-
"src/
|
|
38
|
-
"src/
|
|
39
|
-
"src/
|
|
40
|
-
"src/
|
|
36
|
+
"src/style/components",
|
|
37
|
+
"src/style/variants",
|
|
38
|
+
"src/style/vars",
|
|
39
|
+
"src/style/npoplayer.scss",
|
|
40
|
+
"src/style/npoplayer.css"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "^7.20.12",
|
|
44
44
|
"@babel/preset-env": "^7.20.2",
|
|
45
45
|
"@babel/preset-typescript": "^7.18.6",
|
|
46
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
46
47
|
"@types/fs-extra": "^11.0.1",
|
|
47
48
|
"@types/jest": "^29.4.0",
|
|
48
49
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
@@ -52,11 +53,16 @@
|
|
|
52
53
|
"babel-loader": "^8.3.0",
|
|
53
54
|
"css-loader": "^6.7.3",
|
|
54
55
|
"eslint": "^8.38.0",
|
|
56
|
+
"eslint-config-prettier": "^9.1.0",
|
|
55
57
|
"eslint-config-standard-with-typescript": "^34.0.1",
|
|
56
58
|
"eslint-plugin-import": "^2.27.5",
|
|
59
|
+
"eslint-plugin-jest-dom": "^5.4.0",
|
|
57
60
|
"eslint-plugin-n": "^15.7.0",
|
|
61
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
58
62
|
"eslint-plugin-promise": "^6.1.1",
|
|
59
63
|
"eslint-plugin-sonarjs": "^0.23.0",
|
|
64
|
+
"eslint-plugin-testing-library": "^6.2.2",
|
|
65
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
60
66
|
"fs-extra": "^11.1.1",
|
|
61
67
|
"jest": "^28.1.3",
|
|
62
68
|
"jest-environment-jsdom": "^29.4.1",
|
|
@@ -70,6 +76,7 @@
|
|
|
70
76
|
"postcss-import": "^15.1.0",
|
|
71
77
|
"postcss-loader": "^7.3.3",
|
|
72
78
|
"postcss-scss": "^4.0.7",
|
|
79
|
+
"prettier": "^3.2.5",
|
|
73
80
|
"sass": "^1.58.0",
|
|
74
81
|
"sass-loader": "^12.6.0",
|
|
75
82
|
"style-loader": "^3.3.1",
|
|
@@ -82,9 +89,9 @@
|
|
|
82
89
|
"webpack-dev-server": "^4.11.1"
|
|
83
90
|
},
|
|
84
91
|
"dependencies": {
|
|
85
|
-
"@npotag/tag": "
|
|
86
|
-
"bitmovin-player": "8.
|
|
87
|
-
"bitmovin-player-ui": "3.
|
|
92
|
+
"@npotag/tag": "3.1.2",
|
|
93
|
+
"bitmovin-player": "8.166.0",
|
|
94
|
+
"bitmovin-player-ui": "3.64.0"
|
|
88
95
|
},
|
|
89
96
|
"browserslist": [
|
|
90
97
|
"defaults",
|
|
@@ -29,7 +29,7 @@ $settings-panel-line-height: 19px;
|
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.bmpui-ui-settingspanelpageopenbutton:focus {
|
|
32
|
+
.bmpui-ui-settingspanelpageopenbutton:focus-visible {
|
|
33
33
|
box-shadow: none;
|
|
34
34
|
|
|
35
35
|
.bmpui-label {
|
|
@@ -215,4 +215,18 @@ $settings-panel-line-height: 19px;
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.bmpui-settings-panel-shown {
|
|
221
|
+
.bmpui-ui-controlbar.bmpui-ui-controlbar-bottom.bmpui-hidden,
|
|
222
|
+
.bmpui-ui-titlebar.bmpui-metadata.bmpui-hidden {
|
|
223
|
+
opacity: 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&.bmpui-layout-max-width-400,
|
|
227
|
+
&.bmpui-layout-max-width-600 {
|
|
228
|
+
.bmpui-ui-titlebar.bmpui-titlebar-small.bmpui-hidden {
|
|
229
|
+
opacity: 1;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
218
232
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
$breakpoints: (
|
|
2
|
+
600px: 1.593em,
|
|
3
|
+
700px: 1.867em,
|
|
4
|
+
1200px: 3.2em,
|
|
5
|
+
1440px: 3.84em
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
@mixin responsive-font($size, $span-size) {
|
|
9
|
+
font-size: $size !important;
|
|
10
|
+
|
|
11
|
+
span {
|
|
12
|
+
font-size: $span-size !important;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
2
16
|
.bmpui-ui-subtitle-overlay {
|
|
17
|
+
p {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
}
|
|
20
|
+
|
|
3
21
|
.bmpui-container-wrapper {
|
|
4
22
|
display: block;
|
|
5
23
|
width: 100%;
|
|
@@ -26,24 +44,15 @@
|
|
|
26
44
|
left: 0 !important;
|
|
27
45
|
right: 0!important;
|
|
28
46
|
top: auto !important;
|
|
29
|
-
font-size: 1em !important;
|
|
30
47
|
font-weight: 400 !important;
|
|
31
48
|
padding: 0 18px;
|
|
49
|
+
line-height: 1.2;
|
|
50
|
+
@include responsive-font(1em, 1em);
|
|
32
51
|
|
|
33
|
-
@
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@container (min-width: 700px) {
|
|
38
|
-
font-size: 1.867em !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@container (min-width: 1200px) {
|
|
42
|
-
font-size: 3.2em !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@container (min-width: 1440px) {
|
|
46
|
-
font-size: 3.84em !important;
|
|
52
|
+
@each $bp, $size in $breakpoints {
|
|
53
|
+
@container (min-width: $bp) {
|
|
54
|
+
@include responsive-font($size, $size);
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
}
|