@npo/player 1.29.0 → 2.0.0-beta.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 +32 -24
- package/dist/logErrorEvent-DbEp9rzx.js +25 -0
- package/dist/logErrorEvent-DbEp9rzx.js.map +1 -0
- package/dist/main-XvJyWo8j.js +53061 -0
- package/dist/main-XvJyWo8j.js.map +1 -0
- package/dist/main.d.ts +1163 -0
- package/dist/npoplayer-audio.es.js +19 -0
- package/dist/npoplayer-audio.es.js.map +1 -0
- package/dist/npoplayer-audio.umd.js +53088 -0
- package/dist/npoplayer-audio.umd.js.map +1 -0
- package/package.json +72 -86
- package/CHANGELOG.md +0 -3
- package/LICENSE +0 -15
- package/lib/js/markers/updateLiveMarkers.d.ts +0 -9
- package/lib/js/markers/updateLiveMarkers.js +0 -56
- package/lib/js/markers/updateLiveMarkers.test.d.ts +0 -1
- package/lib/js/markers/updateLiveMarkers.test.js +0 -63
- package/lib/js/playeractions/handlers/handleoffsets.d.ts +0 -4
- package/lib/js/playeractions/handlers/handleoffsets.js +0 -58
- package/lib/js/playeractions/handlers/handleoffsets.test.d.ts +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.test.js +0 -93
- package/lib/js/playeractions/handlers/mediasessionactions.d.ts +0 -7
- package/lib/js/playeractions/handlers/mediasessionactions.js +0 -123
- package/lib/js/playeractions/handlers/processplayerconfig.d.ts +0 -3
- package/lib/js/playeractions/handlers/processplayerconfig.js +0 -56
- package/lib/js/playeractions/handlers/processplayerconfig.test.d.ts +0 -1
- package/lib/js/playeractions/handlers/processplayerconfig.test.js +0 -116
- package/lib/js/playeractions/handlers/processsourceconfig.d.ts +0 -15
- package/lib/js/playeractions/handlers/processsourceconfig.js +0 -232
- package/lib/js/playeractions/handlers/processsourceconfig.test.d.ts +0 -1
- package/lib/js/playeractions/handlers/processsourceconfig.test.js +0 -25
- package/lib/js/playeractions/handlers/removereplayclass.d.ts +0 -2
- package/lib/js/playeractions/handlers/removereplayclass.js +0 -12
- package/lib/js/playeractions/handlers/removereplayclass.test.d.ts +0 -1
- package/lib/js/playeractions/handlers/removereplayclass.test.js +0 -33
- package/lib/js/playeractions/playeractions.d.ts +0 -3
- package/lib/js/playeractions/playeractions.js +0 -3
- package/lib/js/settings/localization.d.ts +0 -82
- package/lib/js/settings/localization.js +0 -7
- package/lib/js/settings/settings.user-agent.d.ts +0 -1
- package/lib/js/settings/settings.user-agent.js +0 -1
- package/lib/js/utilities/utilities.element.d.ts +0 -16
- package/lib/js/utilities/utilities.element.js +0 -18
- package/lib/js/utilities/utilities.element.test.d.ts +0 -1
- package/lib/js/utilities/utilities.element.test.js +0 -38
- package/lib/js/utilities/utilities.jwt.d.ts +0 -5
- package/lib/js/utilities/utilities.jwt.js +0 -44
- package/lib/js/utilities/utilities.jwt.test.d.ts +0 -1
- package/lib/js/utilities/utilities.jwt.test.js +0 -32
- package/lib/js/utilities/utilities.locale.d.ts +0 -2
- package/lib/js/utilities/utilities.locale.js +0 -4
- package/lib/js/utilities/utilities.locale.test.d.ts +0 -1
- package/lib/js/utilities/utilities.locale.test.js +0 -10
- package/lib/js/utilities/utilities.module.d.ts +0 -1
- package/lib/js/utilities/utilities.module.js +0 -4
- package/lib/js/utilities/utilities.module.test.d.ts +0 -1
- package/lib/js/utilities/utilities.module.test.js +0 -19
- package/lib/js/utilities/utilities.prid.d.ts +0 -6
- package/lib/js/utilities/utilities.prid.js +0 -8
- package/lib/js/utilities/utilities.prid.test.d.ts +0 -1
- package/lib/js/utilities/utilities.prid.test.js +0 -46
- package/lib/js/utilities/utilities.stream.d.ts +0 -7
- package/lib/js/utilities/utilities.stream.js +0 -19
- package/lib/js/utilities/utilities.stream.test.d.ts +0 -1
- package/lib/js/utilities/utilities.stream.test.js +0 -32
- package/lib/js/utilities/utilities.text.d.ts +0 -1
- package/lib/js/utilities/utilities.text.js +0 -3
- package/lib/js/utilities/utilities.text.test.d.ts +0 -1
- package/lib/js/utilities/utilities.text.test.js +0 -18
- package/lib/js/utilities/utilities.time.d.ts +0 -1
- package/lib/js/utilities/utilities.time.js +0 -3
- package/lib/js/utilities/utilities.time.test.d.ts +0 -1
- package/lib/js/utilities/utilities.time.test.js +0 -8
- package/lib/js/utilities/utilities.url.d.ts +0 -3
- package/lib/js/utilities/utilities.url.js +0 -29
- package/lib/js/utilities/utilities.url.test.d.ts +0 -1
- package/lib/js/utilities/utilities.url.test.js +0 -46
- package/lib/js/utilities/utilities.user-agent.d.ts +0 -3
- package/lib/js/utilities/utilities.user-agent.js +0 -13
- package/lib/js/utilities/utilities.user-agent.test.d.ts +0 -1
- package/lib/js/utilities/utilities.user-agent.test.js +0 -60
- package/lib/js/utilities/utilities.version.d.ts +0 -1
- package/lib/js/utilities/utilities.version.js +0 -26
- package/lib/js/utilities/utilities.version.test.d.ts +0 -1
- package/lib/js/utilities/utilities.version.test.js +0 -26
- package/lib/lang/nl.json +0 -77
- package/lib/lang/subtitleLabels/nl.json +0 -14
- package/lib/npoplayer.d.ts +0 -64
- package/lib/npoplayer.js +0 -428
- package/lib/npoplayer.test.d.ts +0 -1
- package/lib/npoplayer.test.js +0 -22
- package/lib/package.json +0 -105
- package/lib/services/a11y/setup.d.ts +0 -2
- package/lib/services/a11y/setup.js +0 -15
- package/lib/services/a11y/setup.test.d.ts +0 -1
- package/lib/services/a11y/setup.test.js +0 -88
- package/lib/services/advertHandlers/discardAdBreak.d.ts +0 -2
- package/lib/services/advertHandlers/discardAdBreak.js +0 -9
- package/lib/services/advertHandlers/discardAdBreak.test.d.ts +0 -1
- package/lib/services/advertHandlers/discardAdBreak.test.js +0 -40
- package/lib/services/advertHandlers/handlePreRolls.d.ts +0 -2
- package/lib/services/advertHandlers/handlePreRolls.js +0 -136
- package/lib/services/advertHandlers/handlePrerolls.test.d.ts +0 -1
- package/lib/services/advertHandlers/handlePrerolls.test.js +0 -112
- package/lib/services/avTypeHandlers/getAVType.d.ts +0 -2
- package/lib/services/avTypeHandlers/getAVType.js +0 -9
- package/lib/services/avTypeHandlers/getAVType.test.d.ts +0 -1
- package/lib/services/avTypeHandlers/getAVType.test.js +0 -18
- package/lib/services/backButton/backButton.d.ts +0 -2
- package/lib/services/backButton/backButton.js +0 -24
- package/lib/services/cdnProviders/cdnProviders.d.ts +0 -4
- package/lib/services/cdnProviders/cdnProviders.js +0 -24
- package/lib/services/cdnProviders/cndProviders.test.d.ts +0 -1
- package/lib/services/cdnProviders/cndProviders.test.js +0 -22
- package/lib/services/chapterHandlers/chapterHandler.d.ts +0 -35
- package/lib/services/chapterHandlers/chapterHandler.js +0 -230
- package/lib/services/drmHandlers/constants.d.ts +0 -15
- package/lib/services/drmHandlers/constants.js +0 -13
- package/lib/services/drmHandlers/decideprofile.d.ts +0 -2
- package/lib/services/drmHandlers/decideprofile.js +0 -57
- package/lib/services/drmHandlers/decideprofile.test.d.ts +0 -1
- package/lib/services/drmHandlers/decideprofile.test.js +0 -38
- package/lib/services/drmHandlers/drmhandlers.d.ts +0 -2
- package/lib/services/drmHandlers/drmhandlers.js +0 -2
- package/lib/services/drmHandlers/utils.d.ts +0 -5
- package/lib/services/drmHandlers/utils.js +0 -29
- package/lib/services/drmHandlers/utils.test.d.ts +0 -1
- package/lib/services/drmHandlers/utils.test.js +0 -81
- package/lib/services/drmHandlers/verifydrm.d.ts +0 -2
- package/lib/services/drmHandlers/verifydrm.js +0 -39
- package/lib/services/drmHandlers/verifydrm.test.d.ts +0 -1
- package/lib/services/drmHandlers/verifydrm.test.js +0 -112
- package/lib/services/errors/errorBackground.test.d.ts +0 -1
- package/lib/services/errors/errorBackground.test.js +0 -48
- package/lib/services/errors/errorHandler.d.ts +0 -5
- package/lib/services/errors/errorHandler.js +0 -59
- package/lib/services/errors/errorHandler.test.d.ts +0 -1
- package/lib/services/errors/errorHandler.test.js +0 -148
- package/lib/services/errors/errorRetryHandler.d.ts +0 -2
- package/lib/services/errors/errorRetryHandler.js +0 -14
- package/lib/services/errors/errorRetryHandler.test.d.ts +0 -1
- package/lib/services/errors/errorRetryHandler.test.js +0 -62
- package/lib/services/errors/errorText.d.ts +0 -2
- package/lib/services/errors/errorText.js +0 -62
- package/lib/services/errors/errorText.test.d.ts +0 -1
- package/lib/services/errors/errorText.test.js +0 -66
- package/lib/services/eventListenerHandlers/removeEventListeners.d.ts +0 -2
- package/lib/services/eventListenerHandlers/removeEventListeners.js +0 -24
- package/lib/services/eventListenerHandlers/removeEventListeners.test.d.ts +0 -1
- package/lib/services/eventListenerHandlers/removeEventListeners.test.js +0 -36
- package/lib/services/infoPanel/infoPanel.d.ts +0 -3
- package/lib/services/infoPanel/infoPanel.js +0 -35
- package/lib/services/infoPanel/infoPanel.test.d.ts +0 -1
- package/lib/services/infoPanel/infoPanel.test.js +0 -70
- package/lib/services/keyboardHandlers/resolvekeypress.d.ts +0 -2
- package/lib/services/keyboardHandlers/resolvekeypress.js +0 -63
- package/lib/services/keyboardHandlers/resolvekeypress.test.d.ts +0 -1
- package/lib/services/keyboardHandlers/resolvekeypress.test.js +0 -92
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.d.ts +0 -6
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.js +0 -36
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.test.d.ts +0 -2
- package/lib/services/liveStreamHandlers/handleLiveStreamControls.test.js +0 -65
- package/lib/services/localStorageHandlers/localStorageHandlers.d.ts +0 -4
- package/lib/services/localStorageHandlers/localStorageHandlers.js +0 -36
- package/lib/services/localStorageHandlers/localStorageHandlers.test.d.ts +0 -1
- package/lib/services/localStorageHandlers/localStorageHandlers.test.js +0 -104
- package/lib/services/nicamHandlers/nicamhandler.d.ts +0 -6
- package/lib/services/nicamHandlers/nicamhandler.js +0 -69
- package/lib/services/nicamHandlers/nicamhandler.test.d.ts +0 -1
- package/lib/services/nicamHandlers/nicamhandler.test.js +0 -127
- package/lib/services/npoPlayerAPI/contants.d.ts +0 -25
- package/lib/services/npoPlayerAPI/contants.js +0 -11
- package/lib/services/npoPlayerAPI/npoPlayerAPI.d.ts +0 -53
- package/lib/services/npoPlayerAPI/npoPlayerAPI.js +0 -193
- package/lib/services/npoPlayerAPI/npoPlayerAPI.test.d.ts +0 -1
- package/lib/services/npoPlayerAPI/npoPlayerAPI.test.js +0 -127
- package/lib/services/npoPlayerAPI/playerModules.d.ts +0 -1
- package/lib/services/npoPlayerAPI/playerModules.js +0 -48
- package/lib/services/preferences/handlePreferences.d.ts +0 -2
- package/lib/services/preferences/handlePreferences.js +0 -47
- package/lib/services/preferences/handlePreferences.test.d.ts +0 -1
- package/lib/services/preferences/handlePreferences.test.js +0 -138
- package/lib/services/segmentHandlers/addSegmentEventListeners.d.ts +0 -2
- package/lib/services/segmentHandlers/addSegmentEventListeners.js +0 -15
- package/lib/services/segmentHandlers/addSegmentEventListeners.test.d.ts +0 -1
- package/lib/services/segmentHandlers/addSegmentEventListeners.test.js +0 -44
- package/lib/services/segmentHandlers/convertFragmentToSegment.d.ts +0 -2
- package/lib/services/segmentHandlers/convertFragmentToSegment.js +0 -8
- package/lib/services/segmentHandlers/convertFragmentToSegment.test.d.ts +0 -1
- package/lib/services/segmentHandlers/convertFragmentToSegment.test.js +0 -17
- package/lib/services/segmentHandlers/handleSegmentSeek.d.ts +0 -5
- package/lib/services/segmentHandlers/handleSegmentSeek.js +0 -15
- package/lib/services/segmentHandlers/handleSegmentSeek.test.d.ts +0 -1
- package/lib/services/segmentHandlers/handleSegmentSeek.test.js +0 -73
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.d.ts +0 -2
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.js +0 -21
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +0 -1
- package/lib/services/segmentHandlers/handleSegmentTimeChanged.test.js +0 -43
- package/lib/services/segmentHandlers/initSegment.d.ts +0 -7
- package/lib/services/segmentHandlers/initSegment.js +0 -10
- package/lib/services/segmentHandlers/initSegment.test.d.ts +0 -1
- package/lib/services/segmentHandlers/initSegment.test.js +0 -38
- package/lib/services/segmentHandlers/isSegmentInBounds.d.ts +0 -2
- package/lib/services/segmentHandlers/isSegmentInBounds.js +0 -5
- package/lib/services/segmentHandlers/isSegmentInBounds.test.d.ts +0 -1
- package/lib/services/segmentHandlers/isSegmentInBounds.test.js +0 -27
- package/lib/services/segmentHandlers/setSegmentMarkers.d.ts +0 -2
- package/lib/services/segmentHandlers/setSegmentMarkers.js +0 -25
- package/lib/services/segmentHandlers/setSegmentMarkers.test.d.ts +0 -1
- package/lib/services/segmentHandlers/setSegmentMarkers.test.js +0 -32
- package/lib/services/services.d.ts +0 -34
- package/lib/services/services.js +0 -129
- package/lib/services/streamFetchHandler/fetchStream.d.ts +0 -2
- package/lib/services/streamFetchHandler/fetchStream.js +0 -49
- package/lib/services/streamFetchHandler/fetchstream.test.d.ts +0 -1
- package/lib/services/streamFetchHandler/fetchstream.test.js +0 -92
- package/lib/services/streamoptionsHandlers/streamOptionsHandler.d.ts +0 -6
- package/lib/services/streamoptionsHandlers/streamOptionsHandler.js +0 -80
- package/lib/services/streamoptionsHandlers/streamOptionsHandler.test.d.ts +0 -1
- package/lib/services/streamoptionsHandlers/streamOptionsHandler.test.js +0 -199
- package/lib/services/trackingHandlers/eventBinding.d.ts +0 -2
- package/lib/services/trackingHandlers/eventBinding.js +0 -129
- package/lib/services/trackingHandlers/eventBinding.test.d.ts +0 -1
- package/lib/services/trackingHandlers/eventBinding.test.js +0 -145
- package/lib/services/trackingHandlers/eventLogging.d.ts +0 -2
- package/lib/services/trackingHandlers/eventLogging.js +0 -37
- package/lib/services/trackingHandlers/eventLogging.test.d.ts +0 -1
- package/lib/services/trackingHandlers/eventLogging.test.js +0 -63
- package/lib/services/trackingHandlers/index.d.ts +0 -3
- package/lib/services/trackingHandlers/index.js +0 -3
- package/lib/services/trackingHandlers/playerTrackerInit.d.ts +0 -2
- package/lib/services/trackingHandlers/playerTrackerInit.js +0 -20
- package/lib/services/trackingHandlers/playerTrackerInit.test.d.ts +0 -1
- package/lib/services/trackingHandlers/playerTrackerInit.test.js +0 -75
- package/lib/services/trackingHandlers/playerTrackerStart.d.ts +0 -2
- package/lib/services/trackingHandlers/playerTrackerStart.js +0 -28
- package/lib/services/trackingHandlers/playerTrackerStart.test.d.ts +0 -1
- package/lib/services/trackingHandlers/playerTrackerStart.test.js +0 -76
- package/lib/services/trackingHandlers/streamTrackerInit.d.ts +0 -3
- package/lib/services/trackingHandlers/streamTrackerInit.js +0 -27
- package/lib/services/trackingHandlers/streamTrackerInit.test.d.ts +0 -1
- package/lib/services/trackingHandlers/streamTrackerInit.test.js +0 -84
- package/lib/services/uiHandlers/uiVisiblityHandler.d.ts +0 -3
- package/lib/services/uiHandlers/uiVisiblityHandler.js +0 -32
- package/lib/services/uiHandlers/uiVisiblityHandler.test.d.ts +0 -1
- package/lib/services/uiHandlers/uiVisiblityHandler.test.js +0 -62
- package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.d.ts +0 -2
- package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.js +0 -6
- package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.test.d.ts +0 -1
- package/lib/services/verticalVideoHandlers/handleVerticalVideoControls.test.js +0 -23
- package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.d.ts +0 -2
- package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.js +0 -26
- package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.test.d.ts +0 -1
- package/lib/services/verticalVideoHandlers/handleVerticalVideoSettings.test.js +0 -73
- package/lib/src/js/markers/updateLiveMarkers.d.ts +0 -9
- package/lib/src/js/markers/updateLiveMarkers.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/handleoffsets.d.ts +0 -4
- package/lib/src/js/playeractions/handlers/handleoffsets.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/mediasessionactions.d.ts +0 -7
- package/lib/src/js/playeractions/handlers/processplayerconfig.d.ts +0 -3
- package/lib/src/js/playeractions/handlers/processplayerconfig.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/processsourceconfig.d.ts +0 -15
- package/lib/src/js/playeractions/handlers/processsourceconfig.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/removereplayclass.d.ts +0 -2
- package/lib/src/js/playeractions/handlers/removereplayclass.test.d.ts +0 -1
- package/lib/src/js/playeractions/playeractions.d.ts +0 -3
- package/lib/src/js/settings/localization.d.ts +0 -82
- package/lib/src/js/settings/settings.user-agent.d.ts +0 -1
- package/lib/src/js/utilities/utilities.element.d.ts +0 -16
- package/lib/src/js/utilities/utilities.element.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.jwt.d.ts +0 -5
- package/lib/src/js/utilities/utilities.jwt.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.locale.d.ts +0 -2
- package/lib/src/js/utilities/utilities.locale.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.module.d.ts +0 -1
- package/lib/src/js/utilities/utilities.module.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.prid.d.ts +0 -6
- package/lib/src/js/utilities/utilities.prid.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.stream.d.ts +0 -7
- package/lib/src/js/utilities/utilities.stream.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.text.d.ts +0 -1
- package/lib/src/js/utilities/utilities.text.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.time.d.ts +0 -1
- package/lib/src/js/utilities/utilities.time.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.url.d.ts +0 -3
- package/lib/src/js/utilities/utilities.url.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.user-agent.d.ts +0 -3
- package/lib/src/js/utilities/utilities.user-agent.test.d.ts +0 -1
- package/lib/src/js/utilities/utilities.version.d.ts +0 -1
- package/lib/src/js/utilities/utilities.version.test.d.ts +0 -1
- package/lib/src/npoplayer.d.ts +0 -64
- package/lib/src/npoplayer.test.d.ts +0 -1
- package/lib/src/services/a11y/setup.d.ts +0 -2
- package/lib/src/services/a11y/setup.test.d.ts +0 -1
- package/lib/src/services/advertHandlers/discardAdBreak.d.ts +0 -2
- package/lib/src/services/advertHandlers/discardAdBreak.test.d.ts +0 -1
- package/lib/src/services/advertHandlers/handlePreRolls.d.ts +0 -2
- package/lib/src/services/advertHandlers/handlePrerolls.test.d.ts +0 -1
- package/lib/src/services/avTypeHandlers/getAVType.d.ts +0 -2
- package/lib/src/services/avTypeHandlers/getAVType.test.d.ts +0 -1
- package/lib/src/services/backButton/backButton.d.ts +0 -2
- package/lib/src/services/cdnProviders/cdnProviders.d.ts +0 -4
- package/lib/src/services/cdnProviders/cndProviders.test.d.ts +0 -1
- package/lib/src/services/chapterHandlers/chapterHandler.d.ts +0 -35
- package/lib/src/services/drmHandlers/constants.d.ts +0 -15
- package/lib/src/services/drmHandlers/decideprofile.d.ts +0 -2
- package/lib/src/services/drmHandlers/decideprofile.test.d.ts +0 -1
- package/lib/src/services/drmHandlers/drmhandlers.d.ts +0 -2
- package/lib/src/services/drmHandlers/utils.d.ts +0 -5
- package/lib/src/services/drmHandlers/utils.test.d.ts +0 -1
- package/lib/src/services/drmHandlers/verifydrm.d.ts +0 -2
- package/lib/src/services/drmHandlers/verifydrm.test.d.ts +0 -1
- package/lib/src/services/errors/errorBackground.test.d.ts +0 -1
- package/lib/src/services/errors/errorHandler.d.ts +0 -5
- package/lib/src/services/errors/errorHandler.test.d.ts +0 -1
- package/lib/src/services/errors/errorRetryHandler.d.ts +0 -2
- package/lib/src/services/errors/errorRetryHandler.test.d.ts +0 -1
- package/lib/src/services/errors/errorText.d.ts +0 -2
- package/lib/src/services/errors/errorText.test.d.ts +0 -1
- package/lib/src/services/eventListenerHandlers/removeEventListeners.d.ts +0 -2
- package/lib/src/services/eventListenerHandlers/removeEventListeners.test.d.ts +0 -1
- package/lib/src/services/infoPanel/infoPanel.d.ts +0 -3
- package/lib/src/services/infoPanel/infoPanel.test.d.ts +0 -1
- package/lib/src/services/keyboardHandlers/resolvekeypress.d.ts +0 -2
- package/lib/src/services/keyboardHandlers/resolvekeypress.test.d.ts +0 -1
- package/lib/src/services/liveStreamHandlers/handleLiveStreamControls.d.ts +0 -6
- package/lib/src/services/liveStreamHandlers/handleLiveStreamControls.test.d.ts +0 -2
- package/lib/src/services/localStorageHandlers/localStorageHandlers.d.ts +0 -4
- package/lib/src/services/localStorageHandlers/localStorageHandlers.test.d.ts +0 -1
- package/lib/src/services/nicamHandlers/nicamhandler.d.ts +0 -6
- package/lib/src/services/nicamHandlers/nicamhandler.test.d.ts +0 -1
- package/lib/src/services/npoPlayerAPI/contants.d.ts +0 -25
- package/lib/src/services/npoPlayerAPI/npoPlayerAPI.d.ts +0 -53
- package/lib/src/services/npoPlayerAPI/npoPlayerAPI.test.d.ts +0 -1
- package/lib/src/services/npoPlayerAPI/playerModules.d.ts +0 -1
- package/lib/src/services/preferences/handlePreferences.d.ts +0 -2
- package/lib/src/services/preferences/handlePreferences.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/addSegmentEventListeners.d.ts +0 -2
- package/lib/src/services/segmentHandlers/addSegmentEventListeners.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/convertFragmentToSegment.d.ts +0 -2
- package/lib/src/services/segmentHandlers/convertFragmentToSegment.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/handleSegmentSeek.d.ts +0 -5
- package/lib/src/services/segmentHandlers/handleSegmentSeek.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.d.ts +0 -2
- package/lib/src/services/segmentHandlers/handleSegmentTimeChanged.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/initSegment.d.ts +0 -7
- package/lib/src/services/segmentHandlers/initSegment.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/isSegmentInBounds.d.ts +0 -2
- package/lib/src/services/segmentHandlers/isSegmentInBounds.test.d.ts +0 -1
- package/lib/src/services/segmentHandlers/setSegmentMarkers.d.ts +0 -2
- package/lib/src/services/segmentHandlers/setSegmentMarkers.test.d.ts +0 -1
- package/lib/src/services/services.d.ts +0 -34
- package/lib/src/services/streamFetchHandler/fetchStream.d.ts +0 -2
- package/lib/src/services/streamFetchHandler/fetchstream.test.d.ts +0 -1
- package/lib/src/services/streamoptionsHandlers/streamOptionsHandler.d.ts +0 -6
- package/lib/src/services/streamoptionsHandlers/streamOptionsHandler.test.d.ts +0 -1
- package/lib/src/services/trackingHandlers/eventBinding.d.ts +0 -2
- package/lib/src/services/trackingHandlers/eventBinding.test.d.ts +0 -1
- package/lib/src/services/trackingHandlers/eventLogging.d.ts +0 -2
- package/lib/src/services/trackingHandlers/eventLogging.test.d.ts +0 -1
- package/lib/src/services/trackingHandlers/index.d.ts +0 -3
- package/lib/src/services/trackingHandlers/playerTrackerInit.d.ts +0 -2
- package/lib/src/services/trackingHandlers/playerTrackerInit.test.d.ts +0 -1
- package/lib/src/services/trackingHandlers/playerTrackerStart.d.ts +0 -2
- package/lib/src/services/trackingHandlers/playerTrackerStart.test.d.ts +0 -1
- package/lib/src/services/trackingHandlers/streamTrackerInit.d.ts +0 -3
- package/lib/src/services/trackingHandlers/streamTrackerInit.test.d.ts +0 -1
- package/lib/src/services/uiHandlers/uiVisiblityHandler.d.ts +0 -3
- package/lib/src/services/uiHandlers/uiVisiblityHandler.test.d.ts +0 -1
- package/lib/src/services/verticalVideoHandlers/handleVerticalVideoControls.d.ts +0 -2
- package/lib/src/services/verticalVideoHandlers/handleVerticalVideoControls.test.d.ts +0 -1
- package/lib/src/services/verticalVideoHandlers/handleVerticalVideoSettings.d.ts +0 -2
- package/lib/src/services/verticalVideoHandlers/handleVerticalVideoSettings.test.d.ts +0 -1
- package/lib/src/types/classes.d.ts +0 -10
- package/lib/src/types/events.d.ts +0 -98
- package/lib/src/types/interfaces.d.ts +0 -246
- package/lib/src/ui/components/adbutton.d.ts +0 -4
- package/lib/src/ui/components/adlabel.d.ts +0 -4
- package/lib/src/ui/components/audio/controlbar.d.ts +0 -3
- package/lib/src/ui/components/backButton.d.ts +0 -2
- package/lib/src/ui/components/buttons.d.ts +0 -42
- package/lib/src/ui/components/controlbar.d.ts +0 -3
- package/lib/src/ui/components/ctabar.d.ts +0 -4
- package/lib/src/ui/components/infopanel/infopanel.d.ts +0 -3
- package/lib/src/ui/components/infopanel/togglebutton.d.ts +0 -3
- package/lib/src/ui/components/playnext.d.ts +0 -4
- package/lib/src/ui/components/seekbar.d.ts +0 -6
- package/lib/src/ui/components/settingspanel.d.ts +0 -3
- package/lib/src/ui/components/titlebar.d.ts +0 -3
- package/lib/src/ui/components/topbar.d.ts +0 -3
- package/lib/src/ui/components/verticalvideo/controlbar.d.ts +0 -3
- package/lib/src/ui/components/verticalvideo/settingspanel.d.ts +0 -2
- package/lib/src/ui/handlers/accessibilityhandler.d.ts +0 -2
- package/lib/src/ui/handlers/accessibilityhandler.test.d.ts +0 -1
- package/lib/src/ui/handlers/domhandlers.d.ts +0 -3
- package/lib/src/ui/handlers/domhandlers.test.d.ts +0 -1
- package/lib/src/ui/handlers/listboxhandlers.d.ts +0 -19
- package/lib/src/ui/handlers/playnextscreen.d.ts +0 -6
- package/lib/src/ui/handlers/playnextscreen.test.d.ts +0 -1
- package/lib/src/ui/handlers/timecontrolhandlers.d.ts +0 -3
- package/lib/src/ui/uicontainer.d.ts +0 -3
- package/lib/src/ui/uicontainer.test.d.ts +0 -1
- package/lib/tests/jest.setup-files-after-env.d.ts +0 -0
- package/lib/tests/jest.setup-files-after-env.js +0 -6
- package/lib/tests/jest.setup-tests.d.ts +0 -1
- package/lib/tests/jest.setup-tests.js +0 -2
- package/lib/tests/mocks/mockLogEmitter.d.ts +0 -2
- package/lib/tests/mocks/mockLogEmitter.js +0 -20
- package/lib/tests/mocks/mockNpoplayer.d.ts +0 -2
- package/lib/tests/mocks/mockNpoplayer.js +0 -105
- package/lib/tests/mocks/mockPlayerAPI.d.ts +0 -3
- package/lib/tests/mocks/mockPlayerAPI.js +0 -195
- package/lib/tests/mocks/mockPlayerUi.d.ts +0 -64
- package/lib/tests/mocks/mockPlayerUi.js +0 -251
- package/lib/tests/mocks/mockStreamObject.d.ts +0 -2
- package/lib/tests/mocks/mockStreamObject.js +0 -21
- package/lib/tests/mocks/playerContextMock.d.ts +0 -7
- package/lib/tests/mocks/playerContextMock.js +0 -153
- package/lib/types/classes.d.ts +0 -10
- package/lib/types/classes.js +0 -15
- package/lib/types/events.d.ts +0 -98
- package/lib/types/events.js +0 -184
- package/lib/types/interfaces.d.ts +0 -246
- package/lib/types/interfaces.js +0 -20
- package/lib/ui/components/adbutton.d.ts +0 -4
- package/lib/ui/components/adbutton.js +0 -12
- package/lib/ui/components/adlabel.d.ts +0 -4
- package/lib/ui/components/adlabel.js +0 -8
- package/lib/ui/components/audio/controlbar.d.ts +0 -3
- package/lib/ui/components/audio/controlbar.js +0 -23
- package/lib/ui/components/backButton.d.ts +0 -2
- package/lib/ui/components/backButton.js +0 -8
- package/lib/ui/components/buttons.d.ts +0 -42
- package/lib/ui/components/buttons.js +0 -144
- package/lib/ui/components/controlbar.d.ts +0 -3
- package/lib/ui/components/controlbar.js +0 -40
- package/lib/ui/components/ctabar.d.ts +0 -4
- package/lib/ui/components/ctabar.js +0 -28
- package/lib/ui/components/infopanel/infopanel.d.ts +0 -3
- package/lib/ui/components/infopanel/infopanel.js +0 -42
- package/lib/ui/components/infopanel/togglebutton.d.ts +0 -3
- package/lib/ui/components/infopanel/togglebutton.js +0 -18
- package/lib/ui/components/playnext.d.ts +0 -4
- package/lib/ui/components/playnext.js +0 -10
- package/lib/ui/components/seekbar.d.ts +0 -6
- package/lib/ui/components/seekbar.js +0 -26
- package/lib/ui/components/settingspanel.d.ts +0 -3
- package/lib/ui/components/settingspanel.js +0 -159
- package/lib/ui/components/titlebar.d.ts +0 -3
- package/lib/ui/components/titlebar.js +0 -14
- package/lib/ui/components/topbar.d.ts +0 -3
- package/lib/ui/components/topbar.js +0 -36
- package/lib/ui/components/verticalvideo/controlbar.d.ts +0 -3
- package/lib/ui/components/verticalvideo/controlbar.js +0 -40
- package/lib/ui/components/verticalvideo/settingspanel.d.ts +0 -2
- package/lib/ui/components/verticalvideo/settingspanel.js +0 -25
- package/lib/ui/handlers/accessibilityhandler.d.ts +0 -2
- package/lib/ui/handlers/accessibilityhandler.js +0 -22
- package/lib/ui/handlers/accessibilityhandler.test.d.ts +0 -1
- package/lib/ui/handlers/accessibilityhandler.test.js +0 -54
- package/lib/ui/handlers/domhandlers.d.ts +0 -3
- package/lib/ui/handlers/domhandlers.js +0 -7
- package/lib/ui/handlers/domhandlers.test.d.ts +0 -1
- package/lib/ui/handlers/domhandlers.test.js +0 -31
- package/lib/ui/handlers/listboxhandlers.d.ts +0 -19
- package/lib/ui/handlers/listboxhandlers.js +0 -43
- package/lib/ui/handlers/playnextscreen.d.ts +0 -6
- package/lib/ui/handlers/playnextscreen.js +0 -28
- package/lib/ui/handlers/playnextscreen.test.d.ts +0 -1
- package/lib/ui/handlers/playnextscreen.test.js +0 -57
- package/lib/ui/handlers/timecontrolhandlers.d.ts +0 -3
- package/lib/ui/handlers/timecontrolhandlers.js +0 -17
- package/lib/ui/uicontainer.d.ts +0 -3
- package/lib/ui/uicontainer.js +0 -80
- package/lib/ui/uicontainer.test.d.ts +0 -1
- package/lib/ui/uicontainer.test.js +0 -84
- package/src/style/components/_advert.scss +0 -119
- package/src/style/components/_audio.scss +0 -4
- package/src/style/components/_back-button.scss +0 -42
- package/src/style/components/_buffering.scss +0 -69
- package/src/style/components/_controlbars.scss +0 -26
- package/src/style/components/_error.scss +0 -71
- package/src/style/components/_hugeplaybacktogglebutton.scss +0 -97
- package/src/style/components/_icons.scss +0 -177
- package/src/style/components/_infopanel.scss +0 -105
- package/src/style/components/_metadata.scss +0 -52
- package/src/style/components/_nicam.scss +0 -117
- package/src/style/components/_playnext.scss +0 -72
- package/src/style/components/_poster.scss +0 -3
- package/src/style/components/_replay.scss +0 -25
- package/src/style/components/_seekbar.scss +0 -114
- package/src/style/components/_seekbarthumbnail.scss +0 -61
- package/src/style/components/_settingspanel.scss +0 -290
- package/src/style/components/_subtitles.scss +0 -78
- package/src/style/components/_textbuttons.scss +0 -82
- package/src/style/components/_volumeslider.scss +0 -94
- package/src/style/components/audio/_bottombar.scss +0 -54
- package/src/style/components/audio/_buffering.scss +0 -8
- package/src/style/components/audio/_errors.scss +0 -13
- package/src/style/components/audio/_metadata.scss +0 -60
- package/src/style/components/audio/_playbutton.scss +0 -54
- package/src/style/components/audio/_poster.scss +0 -19
- package/src/style/components/audio/_replay.scss +0 -28
- package/src/style/components/audio/_seekbar.scss +0 -28
- package/src/style/components/audio/_topbar.scss +0 -35
- package/src/style/components/audio/_vars.scss +0 -5
- package/src/style/components/audio/_volumeslider.scss +0 -41
- package/src/style/components/vertical-video/_bottombar.scss +0 -60
- package/src/style/components/vertical-video/_buttons.scss +0 -25
- package/src/style/components/vertical-video/_hugeplaybacktogglebutton.scss +0 -34
- package/src/style/components/vertical-video/_seekbar.scss +0 -19
- package/src/style/components/vertical-video/_settingsbutton.scss +0 -7
- package/src/style/components/vertical-video/_settingspanel.scss +0 -31
- package/src/style/components/vertical-video/_shortvideo.scss +0 -14
- package/src/style/components/vertical-video/_subtitles.scss +0 -3
- package/src/style/components/vertical-video/_topbar.scss +0 -58
- package/src/style/components/vertical-video/_volumeslider.scss +0 -9
- package/src/style/npoplayer.css +0 -908
- package/src/style/npoplayer.scss +0 -58
- package/src/style/variants/_player-audio-only.scss +0 -32
- package/src/style/variants/_player-audio.scss +0 -55
- package/src/style/variants/_player-base.scss +0 -101
- package/src/style/variants/_player-debug.scss +0 -14
- package/src/style/variants/_player-large.scss +0 -99
- package/src/style/variants/_player-medium.scss +0 -68
- package/src/style/variants/_player-small.scss +0 -203
- package/src/style/variants/_player-vertical.scss +0 -23
- package/src/style/vars/_audio.scss +0 -5
- package/src/style/vars/_colors.scss +0 -25
- package/src/style/vars/_fonts.scss +0 -26
- package/src/style/vars/_icons.scss +0 -29
- package/src/style/vars/_z-index.scss +0 -1
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { processNicam, SHOW_NICAM_AFTER_UI_HIDE_DURATION, showNicamAfterUiDelay } from './nicamhandler';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import { createMockNpoPlayer, createPlayerContextMock } from '../../../tests/mocks/playerContextMock';
|
|
4
|
-
describe('NICAM Processing', () => {
|
|
5
|
-
let mockElement;
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
mockElement = { innerHTML: '', appendChild: jest.fn() };
|
|
8
|
-
document.querySelector = jest.fn().mockReturnValue(mockElement);
|
|
9
|
-
});
|
|
10
|
-
it('processes NICAM from the streamObject', () => {
|
|
11
|
-
const mockElement = document.createElement('div');
|
|
12
|
-
const npoPlayerMock = createMockNpoPlayer({
|
|
13
|
-
streamObject: {
|
|
14
|
-
metadata: {
|
|
15
|
-
ageRating: '12',
|
|
16
|
-
nicam: ['GEWELD', 'ANGST', 'DRUGS_EN_ALCOHOL', 'GROF_TAALGEBRUIK']
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const playerContextMock = createPlayerContextMock({
|
|
21
|
-
npoPlayer: npoPlayerMock
|
|
22
|
-
});
|
|
23
|
-
processNicam(playerContextMock, mockElement);
|
|
24
|
-
expect(mockElement.children).toHaveLength(5);
|
|
25
|
-
});
|
|
26
|
-
it('processes NICAM and age rating with streamOptions taking priority', () => {
|
|
27
|
-
const mockElement = document.createElement('div');
|
|
28
|
-
const npoPlayerMock = createMockNpoPlayer({
|
|
29
|
-
streamObject: {
|
|
30
|
-
metadata: {
|
|
31
|
-
ageRating: '12',
|
|
32
|
-
nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
streamOptions: {
|
|
36
|
-
ageRating: '16',
|
|
37
|
-
nicam: ['DRUGS_EN_ALCOHOL']
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const playerContextMock = createPlayerContextMock({
|
|
41
|
-
npoPlayer: npoPlayerMock
|
|
42
|
-
});
|
|
43
|
-
processNicam(playerContextMock, mockElement);
|
|
44
|
-
expect(mockElement.children).toHaveLength(2);
|
|
45
|
-
});
|
|
46
|
-
it('does nothing if no NICAM element found', () => {
|
|
47
|
-
document.querySelector = jest.fn().mockReturnValue(undefined);
|
|
48
|
-
const npoPlayerMock = createMockNpoPlayer({
|
|
49
|
-
streamObject: {
|
|
50
|
-
metadata: {
|
|
51
|
-
ageRating: '12',
|
|
52
|
-
nicam: ['GEWELD', 'ANGST', 'GROF_TAALGEBRUIK']
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const playerContextMock = createPlayerContextMock({
|
|
57
|
-
npoPlayer: npoPlayerMock
|
|
58
|
-
});
|
|
59
|
-
processNicam(playerContextMock, mockElement);
|
|
60
|
-
});
|
|
61
|
-
it('does nothing if no metadata and no streamOptions', () => {
|
|
62
|
-
const npoPlayerMock = createMockNpoPlayer({});
|
|
63
|
-
const playerContextMock = createPlayerContextMock({
|
|
64
|
-
npoPlayer: npoPlayerMock
|
|
65
|
-
});
|
|
66
|
-
processNicam(playerContextMock, mockElement);
|
|
67
|
-
expect(mockElement.appendChild).not.toHaveBeenCalled();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
describe('NICAM Visibility Management', () => {
|
|
71
|
-
let mockPlayerContext;
|
|
72
|
-
let mockContainer;
|
|
73
|
-
let mockPlayer;
|
|
74
|
-
let mockUiManager;
|
|
75
|
-
beforeEach(() => {
|
|
76
|
-
mockContainer = document.createElement('div');
|
|
77
|
-
mockPlayer = {
|
|
78
|
-
getNpoPlayerElement: jest.fn().mockReturnValue(mockContainer),
|
|
79
|
-
off: jest.fn()
|
|
80
|
-
};
|
|
81
|
-
mockUiManager = {
|
|
82
|
-
activeUi: {
|
|
83
|
-
onControlsHide: {
|
|
84
|
-
subscribe: jest.fn(),
|
|
85
|
-
unsubscribe: jest.fn()
|
|
86
|
-
},
|
|
87
|
-
onControlsShow: {
|
|
88
|
-
subscribe: jest.fn(),
|
|
89
|
-
unsubscribe: jest.fn()
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
mockPlayerContext = createPlayerContextMock({
|
|
94
|
-
player: mockPlayer,
|
|
95
|
-
npoPlayer: {
|
|
96
|
-
uiManager: mockUiManager,
|
|
97
|
-
container: mockContainer
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
describe('showNicamAfterUiDelay', () => {
|
|
102
|
-
it('should add showNicam class when controls are hidden', () => {
|
|
103
|
-
jest.useFakeTimers();
|
|
104
|
-
const showNicamClass = 'bmpui-show-nicam';
|
|
105
|
-
showNicamAfterUiDelay(mockPlayerContext);
|
|
106
|
-
mockUiManager.activeUi.onControlsHide.subscribe.mock.calls[0][0]();
|
|
107
|
-
expect(mockContainer).toHaveClass(showNicamClass);
|
|
108
|
-
jest.advanceTimersByTime(SHOW_NICAM_AFTER_UI_HIDE_DURATION);
|
|
109
|
-
expect(mockContainer).not.toHaveClass(showNicamClass);
|
|
110
|
-
jest.useRealTimers();
|
|
111
|
-
});
|
|
112
|
-
it('should remove showNicam class when controls are shown', () => {
|
|
113
|
-
showNicamAfterUiDelay(mockPlayerContext);
|
|
114
|
-
const showNicamClass = 'bmpui-show-nicam';
|
|
115
|
-
mockUiManager.activeUi.onControlsHide.subscribe.mock.calls[0][0]();
|
|
116
|
-
expect(mockContainer).toHaveClass(showNicamClass);
|
|
117
|
-
mockUiManager.activeUi.onControlsShow.subscribe.mock.calls[0][0]();
|
|
118
|
-
expect(mockContainer).not.toHaveClass(showNicamClass);
|
|
119
|
-
});
|
|
120
|
-
it('should not execute if player container or uiManager is undefined', () => {
|
|
121
|
-
mockPlayerContext.npoPlayer.uiManager = undefined;
|
|
122
|
-
showNicamAfterUiDelay(mockPlayerContext);
|
|
123
|
-
expect(mockUiManager.activeUi.onControlsHide.subscribe).not.toHaveBeenCalled();
|
|
124
|
-
expect(mockUiManager.activeUi.onControlsShow.subscribe).not.toHaveBeenCalled();
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_UI_DELAY = 3000;
|
|
2
|
-
export declare const PREVENT_UI_DELAY = -1;
|
|
3
|
-
export declare const VOLUME_STEP = 10;
|
|
4
|
-
export declare const VOLUME_MIN = 0;
|
|
5
|
-
export declare const VOLUME_MAX = 100;
|
|
6
|
-
export declare const emptyStreamObject: {
|
|
7
|
-
stream: {
|
|
8
|
-
drmType: string;
|
|
9
|
-
streamProfile: string;
|
|
10
|
-
streamURL: string;
|
|
11
|
-
avType: string;
|
|
12
|
-
sourceProfile: string;
|
|
13
|
-
};
|
|
14
|
-
metadata: {
|
|
15
|
-
title: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
assets: {
|
|
19
|
-
scrubbingThumbnail: string;
|
|
20
|
-
subtitles: never[];
|
|
21
|
-
};
|
|
22
|
-
user: {
|
|
23
|
-
type: "anonymous" | "plus";
|
|
24
|
-
};
|
|
25
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_UI_DELAY = 3000;
|
|
2
|
-
export const PREVENT_UI_DELAY = -1;
|
|
3
|
-
export const VOLUME_STEP = 10;
|
|
4
|
-
export const VOLUME_MIN = 0;
|
|
5
|
-
export const VOLUME_MAX = 100;
|
|
6
|
-
export const emptyStreamObject = {
|
|
7
|
-
stream: { drmType: '', streamProfile: '', streamURL: '', avType: '', sourceProfile: '' },
|
|
8
|
-
metadata: { title: '', description: '' },
|
|
9
|
-
assets: { scrubbingThumbnail: '', subtitles: [] },
|
|
10
|
-
user: { type: 'anonymous' }
|
|
11
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { PlayerAPI, PlayerConfig, SourceConfig, TimeMode, VideoQuality, ViewMode } from 'bitmovin-player/modules/bitmovinplayer-core';
|
|
2
|
-
import { AdBreak, AdConfig } from 'bitmovin-player/modules/bitmovinplayer-advertising-core';
|
|
3
|
-
import { SubtitleTrack } from 'bitmovin-player/modules/bitmovinplayer-subtitles';
|
|
4
|
-
import { UIManager } from 'bitmovin-player-ui';
|
|
5
|
-
import { NpoPlayerUIVariants, PlayerContext, Technology } from 'types/interfaces';
|
|
6
|
-
import { NpoPlayerEventCallback, NpoPlayerEvent } from '../../types/events';
|
|
7
|
-
export declare class NpoPlayerAPI {
|
|
8
|
-
playerAPI: PlayerAPI;
|
|
9
|
-
constructor(playerAPI: PlayerAPI);
|
|
10
|
-
load(sourceConfig: SourceConfig): Promise<void>;
|
|
11
|
-
unload(): Promise<void>;
|
|
12
|
-
play(): Promise<void>;
|
|
13
|
-
pause(): void;
|
|
14
|
-
mute(): void;
|
|
15
|
-
unmute(): void;
|
|
16
|
-
getVolume(): number;
|
|
17
|
-
setVolume(level: number): void;
|
|
18
|
-
increaseVolume(): void;
|
|
19
|
-
decreaseVolume(): void;
|
|
20
|
-
setViewMode(viewMode: ViewMode): void;
|
|
21
|
-
getViewMode(): ViewMode;
|
|
22
|
-
areSubtitlesEnabled(): boolean;
|
|
23
|
-
getCurrentSubtitle(): string | undefined;
|
|
24
|
-
enableSubtitles(selectedLang?: string): void;
|
|
25
|
-
isPaused(): boolean;
|
|
26
|
-
isMuted(): boolean;
|
|
27
|
-
isLive(): boolean;
|
|
28
|
-
getSupportedDRM(): Promise<string[]>;
|
|
29
|
-
getSupportedTech(): Technology[];
|
|
30
|
-
off(eventType: NpoPlayerEvent, callback: NpoPlayerEventCallback): void;
|
|
31
|
-
on(eventType: NpoPlayerEvent, callback: NpoPlayerEventCallback): void;
|
|
32
|
-
isCastAvailable(): boolean;
|
|
33
|
-
isCasting(): boolean;
|
|
34
|
-
seek(time: number): void;
|
|
35
|
-
timeShift(time: number): void;
|
|
36
|
-
getContainer(): HTMLElement;
|
|
37
|
-
getNpoPlayerElement(): Element | null;
|
|
38
|
-
addClassToNpoPlayerElement(className: string): void | undefined;
|
|
39
|
-
removeClassFromNpoPlayerElement(className: string): void | undefined;
|
|
40
|
-
toggleClassOnNpoPlayerElement(className: string, toggle: boolean): void | undefined;
|
|
41
|
-
getCurrentTime(mode?: TimeMode | undefined): number;
|
|
42
|
-
getDuration(): number;
|
|
43
|
-
getTimeShift(): number;
|
|
44
|
-
scheduleAds(adConfig: AdConfig): Promise<AdBreak[]>;
|
|
45
|
-
handleErrorRetry(playerContext: PlayerContext): Promise<void>;
|
|
46
|
-
getActiveAdBreak(): AdBreak | null;
|
|
47
|
-
getConfig(mergedConfig?: boolean): PlayerConfig;
|
|
48
|
-
createUIManager(playerContext: PlayerContext, variant: NpoPlayerUIVariants): void | UIManager;
|
|
49
|
-
getAvailableVideoQualities(): VideoQuality[];
|
|
50
|
-
listSubtitles(): SubtitleTrack[];
|
|
51
|
-
setPlaybackSpeed(speed: number): void;
|
|
52
|
-
setVideoQuality(VideoQualityId: string): void;
|
|
53
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { UIManager } from 'bitmovin-player-ui';
|
|
2
|
-
import { customSpecificErrorMessageOverlayConfig } from '../errors/errorText';
|
|
3
|
-
import { createUIContainer } from '../../ui/uicontainer';
|
|
4
|
-
import { playerEventMap } from '../../types/events';
|
|
5
|
-
import { VOLUME_MAX, VOLUME_MIN, VOLUME_STEP } from './contants';
|
|
6
|
-
import { localizationConfig } from '../../js/settings/localization';
|
|
7
|
-
import { handleErrorRetry } from '../../services/errors/errorRetryHandler';
|
|
8
|
-
const externalCallbacksMap = new WeakMap();
|
|
9
|
-
export class NpoPlayerAPI {
|
|
10
|
-
constructor(playerAPI) {
|
|
11
|
-
this.playerAPI = playerAPI;
|
|
12
|
-
}
|
|
13
|
-
async load(sourceConfig) {
|
|
14
|
-
await this.playerAPI.load(sourceConfig);
|
|
15
|
-
}
|
|
16
|
-
async unload() {
|
|
17
|
-
await this.playerAPI.unload();
|
|
18
|
-
}
|
|
19
|
-
async play() {
|
|
20
|
-
await this.playerAPI.play().catch((error) => {
|
|
21
|
-
console.error('Playback error:', error);
|
|
22
|
-
if (error.code === 1201) {
|
|
23
|
-
console.error('No source was loaded. Please load a source before playing.');
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
console.error('An unexpected playback error occurred.');
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
pause() {
|
|
31
|
-
this.playerAPI.pause();
|
|
32
|
-
}
|
|
33
|
-
mute() {
|
|
34
|
-
this.playerAPI.mute();
|
|
35
|
-
}
|
|
36
|
-
unmute() {
|
|
37
|
-
this.playerAPI.unmute();
|
|
38
|
-
}
|
|
39
|
-
getVolume() {
|
|
40
|
-
return this.playerAPI.getVolume();
|
|
41
|
-
}
|
|
42
|
-
setVolume(level) {
|
|
43
|
-
const volume = Math.max(VOLUME_MIN, Math.min(VOLUME_MAX, level));
|
|
44
|
-
this.playerAPI.setVolume(volume);
|
|
45
|
-
}
|
|
46
|
-
increaseVolume() {
|
|
47
|
-
const currentVolume = this.getVolume();
|
|
48
|
-
this.setVolume(currentVolume + VOLUME_STEP);
|
|
49
|
-
}
|
|
50
|
-
decreaseVolume() {
|
|
51
|
-
const currentVolume = this.getVolume();
|
|
52
|
-
this.setVolume(currentVolume - VOLUME_STEP);
|
|
53
|
-
}
|
|
54
|
-
setViewMode(viewMode) {
|
|
55
|
-
this.playerAPI.setViewMode(viewMode);
|
|
56
|
-
}
|
|
57
|
-
getViewMode() {
|
|
58
|
-
return this.playerAPI.getViewMode();
|
|
59
|
-
}
|
|
60
|
-
areSubtitlesEnabled() {
|
|
61
|
-
const subtitles = this.listSubtitles();
|
|
62
|
-
return subtitles ? subtitles.some((subtitle) => subtitle.enabled) : false;
|
|
63
|
-
}
|
|
64
|
-
getCurrentSubtitle() {
|
|
65
|
-
const subtitles = this.listSubtitles();
|
|
66
|
-
const currentSubtitle = subtitles.find((subtitle) => subtitle.enabled);
|
|
67
|
-
return currentSubtitle ? currentSubtitle.lang : undefined;
|
|
68
|
-
}
|
|
69
|
-
enableSubtitles(selectedLang = 'nl') {
|
|
70
|
-
const subtitleTracks = this.listSubtitles();
|
|
71
|
-
const subtitleToEnable = subtitleTracks.find((subtitle) => subtitle.lang === selectedLang);
|
|
72
|
-
if (subtitleToEnable && !subtitleToEnable.enabled) {
|
|
73
|
-
this.playerAPI.subtitles?.enable(subtitleToEnable.id);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
isPaused() {
|
|
77
|
-
return this.playerAPI.isPaused();
|
|
78
|
-
}
|
|
79
|
-
isMuted() {
|
|
80
|
-
return this.playerAPI.isMuted();
|
|
81
|
-
}
|
|
82
|
-
isLive() {
|
|
83
|
-
return this.playerAPI.isLive();
|
|
84
|
-
}
|
|
85
|
-
async getSupportedDRM() {
|
|
86
|
-
return await this.playerAPI.getSupportedDRM();
|
|
87
|
-
}
|
|
88
|
-
getSupportedTech() {
|
|
89
|
-
return this.playerAPI.getSupportedTech();
|
|
90
|
-
}
|
|
91
|
-
off(eventType, callback) {
|
|
92
|
-
const externalEventType = playerEventMap[eventType];
|
|
93
|
-
const externalCallback = externalCallbacksMap.get(callback);
|
|
94
|
-
if (externalCallback) {
|
|
95
|
-
this.playerAPI.off(externalEventType, externalCallback);
|
|
96
|
-
externalCallbacksMap.delete(callback);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
on(eventType, callback) {
|
|
100
|
-
const externalEventType = playerEventMap[eventType];
|
|
101
|
-
let externalCallback = externalCallbacksMap.get(callback);
|
|
102
|
-
if (!externalCallback) {
|
|
103
|
-
externalCallback = (args) => {
|
|
104
|
-
callback(args);
|
|
105
|
-
};
|
|
106
|
-
externalCallbacksMap.set(callback, externalCallback);
|
|
107
|
-
}
|
|
108
|
-
this.playerAPI.on(externalEventType, externalCallback);
|
|
109
|
-
}
|
|
110
|
-
isCastAvailable() {
|
|
111
|
-
return this.playerAPI.isCastAvailable();
|
|
112
|
-
}
|
|
113
|
-
isCasting() {
|
|
114
|
-
return this.playerAPI.isCasting();
|
|
115
|
-
}
|
|
116
|
-
seek(time) {
|
|
117
|
-
this.playerAPI.seek(time);
|
|
118
|
-
}
|
|
119
|
-
timeShift(time) {
|
|
120
|
-
this.playerAPI.timeShift(time);
|
|
121
|
-
}
|
|
122
|
-
getContainer() {
|
|
123
|
-
return this.playerAPI.getContainer();
|
|
124
|
-
}
|
|
125
|
-
getNpoPlayerElement() {
|
|
126
|
-
return this.getContainer().querySelector('.bmpui-npo-player');
|
|
127
|
-
}
|
|
128
|
-
addClassToNpoPlayerElement(className) {
|
|
129
|
-
this.getNpoPlayerElement()?.classList.add(className);
|
|
130
|
-
}
|
|
131
|
-
removeClassFromNpoPlayerElement(className) {
|
|
132
|
-
this.getNpoPlayerElement()?.classList.remove(className);
|
|
133
|
-
}
|
|
134
|
-
toggleClassOnNpoPlayerElement(className, toggle) {
|
|
135
|
-
this.getNpoPlayerElement()?.classList.toggle(className, toggle);
|
|
136
|
-
}
|
|
137
|
-
getCurrentTime(mode) {
|
|
138
|
-
return this.playerAPI.getCurrentTime(mode);
|
|
139
|
-
}
|
|
140
|
-
getDuration() {
|
|
141
|
-
return this.playerAPI.getDuration();
|
|
142
|
-
}
|
|
143
|
-
getTimeShift() {
|
|
144
|
-
return this.playerAPI.getTimeShift();
|
|
145
|
-
}
|
|
146
|
-
async scheduleAds(adConfig) {
|
|
147
|
-
return this.playerAPI.ads.schedule(adConfig);
|
|
148
|
-
}
|
|
149
|
-
async handleErrorRetry(playerContext) {
|
|
150
|
-
return handleErrorRetry(playerContext);
|
|
151
|
-
}
|
|
152
|
-
getActiveAdBreak() {
|
|
153
|
-
return this.playerAPI.ads.getActiveAdBreak();
|
|
154
|
-
}
|
|
155
|
-
getConfig(mergedConfig) {
|
|
156
|
-
return this.playerAPI.getConfig(mergedConfig);
|
|
157
|
-
}
|
|
158
|
-
createUIManager(playerContext, variant) {
|
|
159
|
-
const { npoPlayerServices } = playerContext.npoPlayer;
|
|
160
|
-
if (playerContext.npoPlayer.uiManager === undefined || variant !== playerContext.npoPlayer.variant) {
|
|
161
|
-
npoPlayerServices.removeUivisiblityHandlers(playerContext);
|
|
162
|
-
const uiConfig = {
|
|
163
|
-
errorMessages: customSpecificErrorMessageOverlayConfig,
|
|
164
|
-
disableAutoHideWhenHovered: true,
|
|
165
|
-
seekbarSnappingEnabled: false
|
|
166
|
-
};
|
|
167
|
-
npoPlayerServices.removeUivisiblityHandlers(playerContext);
|
|
168
|
-
playerContext.npoPlayer.uiManager?.release();
|
|
169
|
-
UIManager.setLocalizationConfig(localizationConfig);
|
|
170
|
-
const uiContainer = createUIContainer(playerContext, variant);
|
|
171
|
-
const uiManager = new UIManager(this.playerAPI, uiContainer, uiConfig);
|
|
172
|
-
playerContext.npoPlayer.uiManager = uiManager;
|
|
173
|
-
playerContext.npoPlayer.variant = variant;
|
|
174
|
-
npoPlayerServices.addUivisiblityHandlers(playerContext);
|
|
175
|
-
npoPlayerServices.setupNicamKijkwijzerIcons(playerContext);
|
|
176
|
-
npoPlayerServices.showNicamAfterUiDelay(playerContext);
|
|
177
|
-
npoPlayerServices.addDataInInfoPanel(playerContext);
|
|
178
|
-
npoPlayerServices.handleBackButtons(playerContext);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
getAvailableVideoQualities() {
|
|
182
|
-
return this.playerAPI.getAvailableVideoQualities();
|
|
183
|
-
}
|
|
184
|
-
listSubtitles() {
|
|
185
|
-
return this.playerAPI.subtitles?.list() || [];
|
|
186
|
-
}
|
|
187
|
-
setPlaybackSpeed(speed) {
|
|
188
|
-
this.playerAPI.setPlaybackSpeed(speed);
|
|
189
|
-
}
|
|
190
|
-
setVideoQuality(VideoQualityId) {
|
|
191
|
-
this.playerAPI.setVideoQuality(VideoQualityId);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { NpoPlayerAPI } from './npoPlayerAPI';
|
|
2
|
-
import createPlayerContextMock from '../../../tests/mocks/playerContextMock';
|
|
3
|
-
import { NpoPlayerEvent } from '../../types/events';
|
|
4
|
-
describe('NpoPlayerAPI', () => {
|
|
5
|
-
let mockPlayerAPI;
|
|
6
|
-
let npoPlayerAPI;
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
mockPlayerAPI = {
|
|
9
|
-
play: jest.fn(),
|
|
10
|
-
pause: jest.fn(),
|
|
11
|
-
mute: jest.fn(),
|
|
12
|
-
unmute: jest.fn(),
|
|
13
|
-
setViewMode: jest.fn(),
|
|
14
|
-
getViewMode: jest.fn(),
|
|
15
|
-
isPaused: jest.fn(),
|
|
16
|
-
isMuted: jest.fn(),
|
|
17
|
-
on: jest.fn(),
|
|
18
|
-
off: jest.fn()
|
|
19
|
-
};
|
|
20
|
-
npoPlayerAPI = new NpoPlayerAPI(mockPlayerAPI);
|
|
21
|
-
});
|
|
22
|
-
it('should call play on the PlayerAPI', async () => {
|
|
23
|
-
mockPlayerAPI.play.mockResolvedValueOnce(undefined);
|
|
24
|
-
await npoPlayerAPI.play();
|
|
25
|
-
expect(mockPlayerAPI.play).toHaveBeenCalled();
|
|
26
|
-
});
|
|
27
|
-
it('should handle error when play throws an error', async () => {
|
|
28
|
-
const error = { code: 1201, message: 'No source loaded' };
|
|
29
|
-
mockPlayerAPI.play.mockRejectedValueOnce(error);
|
|
30
|
-
const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {
|
|
31
|
-
});
|
|
32
|
-
await npoPlayerAPI.play();
|
|
33
|
-
expect(consoleErrorSpy).toHaveBeenCalledWith('Playback error:', error);
|
|
34
|
-
expect(consoleErrorSpy).toHaveBeenCalledWith('No source was loaded. Please load a source before playing.');
|
|
35
|
-
consoleErrorSpy.mockRestore();
|
|
36
|
-
});
|
|
37
|
-
it('should call pause on the PlayerAPI', () => {
|
|
38
|
-
npoPlayerAPI.pause();
|
|
39
|
-
expect(mockPlayerAPI.pause).toHaveBeenCalled();
|
|
40
|
-
});
|
|
41
|
-
it('should call mute on the PlayerAPI', () => {
|
|
42
|
-
npoPlayerAPI.mute();
|
|
43
|
-
expect(mockPlayerAPI.mute).toHaveBeenCalled();
|
|
44
|
-
});
|
|
45
|
-
it('should call unmute on the PlayerAPI', () => {
|
|
46
|
-
npoPlayerAPI.unmute();
|
|
47
|
-
expect(mockPlayerAPI.unmute).toHaveBeenCalled();
|
|
48
|
-
});
|
|
49
|
-
it('should call setViewMode on the PlayerAPI', () => {
|
|
50
|
-
const viewMode = 'fullscreen';
|
|
51
|
-
npoPlayerAPI.setViewMode(viewMode);
|
|
52
|
-
expect(mockPlayerAPI.setViewMode).toHaveBeenCalledWith(viewMode);
|
|
53
|
-
});
|
|
54
|
-
it('should call getViewMode on the PlayerAPI', () => {
|
|
55
|
-
npoPlayerAPI.getViewMode();
|
|
56
|
-
expect(mockPlayerAPI.getViewMode).toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
it('should call isPaused on the PlayerAPI', () => {
|
|
59
|
-
npoPlayerAPI.isPaused();
|
|
60
|
-
expect(mockPlayerAPI.isPaused).toHaveBeenCalled();
|
|
61
|
-
});
|
|
62
|
-
it('should call isMuted on the PlayerAPI', () => {
|
|
63
|
-
npoPlayerAPI.isMuted();
|
|
64
|
-
expect(mockPlayerAPI.isMuted).toHaveBeenCalled();
|
|
65
|
-
});
|
|
66
|
-
describe('NpoPlayerAPI Volume Control Tests', () => {
|
|
67
|
-
let playerContextMock;
|
|
68
|
-
beforeEach(() => {
|
|
69
|
-
playerContextMock = createPlayerContextMock();
|
|
70
|
-
playerContextMock.player.setVolume(50);
|
|
71
|
-
});
|
|
72
|
-
test('should set volume to a specific value', () => {
|
|
73
|
-
playerContextMock.player.setVolume(30);
|
|
74
|
-
expect(playerContextMock.player.getVolume()).toBe(30);
|
|
75
|
-
});
|
|
76
|
-
test('should not set volume above the maximum', () => {
|
|
77
|
-
playerContextMock.player.setVolume(110);
|
|
78
|
-
expect(playerContextMock.player.getVolume()).toBe(100);
|
|
79
|
-
});
|
|
80
|
-
test('should not set volume below the minimum', () => {
|
|
81
|
-
playerContextMock.player.setVolume(-10);
|
|
82
|
-
expect(playerContextMock.player.getVolume()).toBe(0);
|
|
83
|
-
});
|
|
84
|
-
test('should increase volume by 10', () => {
|
|
85
|
-
playerContextMock.player.increaseVolume();
|
|
86
|
-
expect(playerContextMock.player.getVolume()).toBe(60);
|
|
87
|
-
});
|
|
88
|
-
test('should not increase volume above the maximum', () => {
|
|
89
|
-
playerContextMock.player.setVolume(95);
|
|
90
|
-
playerContextMock.player.increaseVolume();
|
|
91
|
-
expect(playerContextMock.player.getVolume()).toBe(100);
|
|
92
|
-
});
|
|
93
|
-
test('should decrease volume by 10', () => {
|
|
94
|
-
playerContextMock.player.decreaseVolume();
|
|
95
|
-
expect(playerContextMock.player.getVolume()).toBe(40);
|
|
96
|
-
});
|
|
97
|
-
test('should not decrease volume below the minimum', () => {
|
|
98
|
-
playerContextMock.player.setVolume(5);
|
|
99
|
-
playerContextMock.player.decreaseVolume();
|
|
100
|
-
expect(playerContextMock.player.getVolume()).toBe(0);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe('Event handling', () => {
|
|
104
|
-
it('should add an event listener', () => {
|
|
105
|
-
const eventType = NpoPlayerEvent.TimeChanged;
|
|
106
|
-
const callback = jest.fn();
|
|
107
|
-
npoPlayerAPI.on(eventType, callback);
|
|
108
|
-
expect(mockPlayerAPI.on).toHaveBeenCalledWith(expect.any(String), expect.any(Function));
|
|
109
|
-
});
|
|
110
|
-
it('should remove an event listener', () => {
|
|
111
|
-
const eventType = NpoPlayerEvent.TimeChanged;
|
|
112
|
-
const callback = jest.fn();
|
|
113
|
-
npoPlayerAPI.on(eventType, callback);
|
|
114
|
-
npoPlayerAPI.off(eventType, callback);
|
|
115
|
-
expect(mockPlayerAPI.off).toHaveBeenCalledWith(expect.any(String), expect.any(Function));
|
|
116
|
-
});
|
|
117
|
-
it('should trigger the correct callback when event is emitted', () => {
|
|
118
|
-
const eventType = NpoPlayerEvent.TimeChanged;
|
|
119
|
-
const callback = jest.fn();
|
|
120
|
-
const mockArgs = { time: 123 };
|
|
121
|
-
npoPlayerAPI.on(eventType, callback);
|
|
122
|
-
const externalCallback = mockPlayerAPI.on.mock.calls[0][1];
|
|
123
|
-
externalCallback(mockArgs);
|
|
124
|
-
expect(callback).toHaveBeenCalledWith(mockArgs);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const playerModules: any[];
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import EngineBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-engine-bitmovin';
|
|
2
|
-
import EngineNativeModule from 'bitmovin-player/modules/bitmovinplayer-engine-native';
|
|
3
|
-
import MseRendererModule from 'bitmovin-player/modules/bitmovinplayer-mserenderer';
|
|
4
|
-
import DashModule from 'bitmovin-player/modules/bitmovinplayer-dash';
|
|
5
|
-
import ContainerMP4 from 'bitmovin-player/modules/bitmovinplayer-container-mp4';
|
|
6
|
-
import ContainerTS from 'bitmovin-player/modules/bitmovinplayer-container-ts';
|
|
7
|
-
import AbrModule from 'bitmovin-player/modules/bitmovinplayer-abr';
|
|
8
|
-
import DrmModule from 'bitmovin-player/modules/bitmovinplayer-drm';
|
|
9
|
-
import XmlModule from 'bitmovin-player/modules/bitmovinplayer-xml';
|
|
10
|
-
import Subtitles from 'bitmovin-player/modules/bitmovinplayer-subtitles';
|
|
11
|
-
import SubtitlesWebVTT from 'bitmovin-player/modules/bitmovinplayer-subtitles-vtt';
|
|
12
|
-
import SubtitlesCEA608 from 'bitmovin-player/modules/bitmovinplayer-subtitles-cea608';
|
|
13
|
-
import SubtitlesTTML from 'bitmovin-player/modules/bitmovinplayer-subtitles-ttml';
|
|
14
|
-
import SubtitlesNative from 'bitmovin-player/modules/bitmovinplayer-subtitles-native';
|
|
15
|
-
import AdvertisingCoreModule from 'bitmovin-player/modules/bitmovinplayer-advertising-core';
|
|
16
|
-
import AdvertisingBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-advertising-bitmovin';
|
|
17
|
-
import AnalyticsModule from 'bitmovin-player/modules/bitmovinplayer-analytics';
|
|
18
|
-
import HlsModule from 'bitmovin-player/modules/bitmovinplayer-hls';
|
|
19
|
-
import StyleModule from 'bitmovin-player/modules/bitmovinplayer-style';
|
|
20
|
-
import CryptoModule from 'bitmovin-player/modules/bitmovinplayer-crypto';
|
|
21
|
-
import PatchModule from 'bitmovin-player/modules/bitmovinplayer-patch';
|
|
22
|
-
import ThumbnailModule from 'bitmovin-player/modules/bitmovinplayer-thumbnail';
|
|
23
|
-
import RemoteControlModule from 'bitmovin-player/modules/bitmovinplayer-remotecontrol';
|
|
24
|
-
export const playerModules = [
|
|
25
|
-
EngineBitmovinModule,
|
|
26
|
-
EngineNativeModule,
|
|
27
|
-
XmlModule,
|
|
28
|
-
MseRendererModule,
|
|
29
|
-
AbrModule,
|
|
30
|
-
HlsModule,
|
|
31
|
-
DrmModule,
|
|
32
|
-
DashModule,
|
|
33
|
-
ContainerMP4,
|
|
34
|
-
ContainerTS,
|
|
35
|
-
CryptoModule,
|
|
36
|
-
PatchModule,
|
|
37
|
-
Subtitles,
|
|
38
|
-
SubtitlesCEA608,
|
|
39
|
-
SubtitlesWebVTT,
|
|
40
|
-
SubtitlesTTML,
|
|
41
|
-
SubtitlesNative,
|
|
42
|
-
StyleModule,
|
|
43
|
-
AdvertisingCoreModule,
|
|
44
|
-
AdvertisingBitmovinModule,
|
|
45
|
-
AnalyticsModule,
|
|
46
|
-
ThumbnailModule,
|
|
47
|
-
RemoteControlModule
|
|
48
|
-
];
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { NpoPlayerEvent } from '../../types/events';
|
|
2
|
-
import { LocalStorageValues } from '../../types/interfaces';
|
|
3
|
-
export function handlePreferences(playerContext) {
|
|
4
|
-
const { player, npoPlayer } = playerContext;
|
|
5
|
-
const { npoPlayerServices } = npoPlayer;
|
|
6
|
-
const handleReady = () => {
|
|
7
|
-
const storedUserPrefs = npoPlayerServices.getStoredUserPrefs();
|
|
8
|
-
const subtitlesEnabledInPrefs = storedUserPrefs?.subtitles_enabled === 'true';
|
|
9
|
-
const preferredSubtitleLang = storedUserPrefs?.subtitles_language?.toString();
|
|
10
|
-
const shouldEnableSubtitles = npoPlayer.streamOptions.enableSubtitles || subtitlesEnabledInPrefs;
|
|
11
|
-
if (shouldEnableSubtitles) {
|
|
12
|
-
player.enableSubtitles(preferredSubtitleLang);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const handleSubtitleEnabled = () => {
|
|
16
|
-
const subtitlesList = player.listSubtitles();
|
|
17
|
-
const enabledSubtitle = subtitlesList.find((subtitle) => subtitle.enabled);
|
|
18
|
-
if (enabledSubtitle) {
|
|
19
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_LANGUAGE, enabledSubtitle.lang);
|
|
20
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_ENABLED, 'true');
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const handleSubtitleDisabled = () => {
|
|
24
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.SUBTITLES_ENABLED, 'false');
|
|
25
|
-
};
|
|
26
|
-
const handleVolumeChanged = () => {
|
|
27
|
-
const volume = player.getVolume();
|
|
28
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.VOLUME, volume);
|
|
29
|
-
};
|
|
30
|
-
const handleMuted = () => {
|
|
31
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.IS_MUTED, 'true');
|
|
32
|
-
const volume = player.getVolume();
|
|
33
|
-
if (volume === 0) {
|
|
34
|
-
player.setVolume(100);
|
|
35
|
-
player.mute();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const handleUnmuted = () => {
|
|
39
|
-
npoPlayerServices.setStoredUserPrefs(LocalStorageValues.IS_MUTED, 'false');
|
|
40
|
-
};
|
|
41
|
-
player.on(NpoPlayerEvent.Ready, handleReady);
|
|
42
|
-
player.on(NpoPlayerEvent.SubtitleEnabled, handleSubtitleEnabled);
|
|
43
|
-
player.on(NpoPlayerEvent.SubtitleDisabled, handleSubtitleDisabled);
|
|
44
|
-
player.on(NpoPlayerEvent.VolumeChanged, handleVolumeChanged);
|
|
45
|
-
player.on(NpoPlayerEvent.Muted, handleMuted);
|
|
46
|
-
player.on(NpoPlayerEvent.Unmuted, handleUnmuted);
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|