@npo/player 1.10.0 → 1.10.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/lib/js/playeractions/handlers/processplayerconfig.d.ts +0 -8
- package/lib/js/tracking/handlers/eventbinding.d.ts +0 -7
- package/lib/js/tracking/handlers/eventlogging.d.ts +0 -9
- package/lib/js/tracking/handlers/playertrackerinit.d.ts +0 -9
- package/lib/js/tracking/handlers/playertrackerstart.d.ts +0 -7
- package/lib/js/ui/components/ctabar.d.ts +1 -1
- package/lib/js/utilities/utilities.d.ts +0 -50
- package/lib/npoplayer.js +2 -501
- package/lib/npoplayer.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/scss/npoplayer.css +2 -2
- package/src/scss/variants/_player-base.scss +17 -0
- package/src/scss/variants/_player-small.scss +20 -1
- package/lib/js/ads/ster.js +0 -157
- package/lib/js/ads/ster.js.map +0 -1
- package/lib/js/ads/ster.test.js +0 -91
- package/lib/js/ads/ster.test.js.map +0 -1
- package/lib/js/api/getstreamobject.js +0 -18
- package/lib/js/api/getstreamobject.js.map +0 -1
- package/lib/js/cdnproviders.js +0 -13
- package/lib/js/cdnproviders.js.map +0 -1
- package/lib/js/checks/safari.js +0 -10
- package/lib/js/checks/safari.js.map +0 -1
- package/lib/js/checks/safari.test.js +0 -21
- package/lib/js/checks/safari.test.js.map +0 -1
- package/lib/js/drm/verifydrm.js +0 -38
- package/lib/js/drm/verifydrm.js.map +0 -1
- package/lib/js/drm/verifydrm.test.js +0 -18
- package/lib/js/drm/verifydrm.test.js.map +0 -1
- package/lib/js/fragments/setfragments.js +0 -67
- package/lib/js/fragments/setfragments.js.map +0 -1
- package/lib/js/playeractions/customerrors.test.js +0 -52
- package/lib/js/playeractions/customerrors.test.js.map +0 -1
- package/lib/js/playeractions/handlers/customerrors.js +0 -154
- package/lib/js/playeractions/handlers/customerrors.js.map +0 -1
- package/lib/js/playeractions/handlers/error.js +0 -23
- package/lib/js/playeractions/handlers/error.js.map +0 -1
- package/lib/js/playeractions/handlers/error.test.js +0 -45
- package/lib/js/playeractions/handlers/error.test.js.map +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.js +0 -71
- package/lib/js/playeractions/handlers/handleoffsets.js.map +0 -1
- package/lib/js/playeractions/handlers/handleoffsets.test.js +0 -50
- package/lib/js/playeractions/handlers/handleoffsets.test.js.map +0 -1
- package/lib/js/playeractions/handlers/processplayerconfig.js +0 -40
- package/lib/js/playeractions/handlers/processplayerconfig.js.map +0 -1
- package/lib/js/playeractions/handlers/resolvekeypress.js +0 -55
- package/lib/js/playeractions/handlers/resolvekeypress.js.map +0 -1
- package/lib/js/playeractions/playeractions.js +0 -5
- package/lib/js/playeractions/playeractions.js.map +0 -1
- package/lib/js/tracking/handlers/eventbinding.js +0 -86
- package/lib/js/tracking/handlers/eventbinding.js.map +0 -1
- package/lib/js/tracking/handlers/eventlogging.js +0 -42
- package/lib/js/tracking/handlers/eventlogging.js.map +0 -1
- package/lib/js/tracking/handlers/playertrackerinit.js +0 -29
- package/lib/js/tracking/handlers/playertrackerinit.js.map +0 -1
- package/lib/js/tracking/handlers/playertrackerstart.js +0 -29
- package/lib/js/tracking/handlers/playertrackerstart.js.map +0 -1
- package/lib/js/tracking/playertracker.js +0 -10
- package/lib/js/tracking/playertracker.js.map +0 -1
- package/lib/js/ui/components/adbutton.js +0 -21
- package/lib/js/ui/components/adbutton.js.map +0 -1
- package/lib/js/ui/components/adlabel.js +0 -17
- package/lib/js/ui/components/adlabel.js.map +0 -1
- package/lib/js/ui/components/buttons.js +0 -89
- package/lib/js/ui/components/buttons.js.map +0 -1
- package/lib/js/ui/components/controlbar.js +0 -58
- package/lib/js/ui/components/controlbar.js.map +0 -1
- package/lib/js/ui/components/ctabar.js +0 -41
- package/lib/js/ui/components/ctabar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/addFragments.js +0 -8
- package/lib/js/ui/components/nativemobile/addFragments.js.map +0 -1
- package/lib/js/ui/components/nativemobile/buttons.js +0 -43
- package/lib/js/ui/components/nativemobile/buttons.js.map +0 -1
- package/lib/js/ui/components/nativemobile/controlbar.js +0 -52
- package/lib/js/ui/components/nativemobile/controlbar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/ctabar.js +0 -12
- package/lib/js/ui/components/nativemobile/ctabar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/playnext.js +0 -16
- package/lib/js/ui/components/nativemobile/playnext.js.map +0 -1
- package/lib/js/ui/components/nativemobile/titlebar.js +0 -8
- package/lib/js/ui/components/nativemobile/titlebar.js.map +0 -1
- package/lib/js/ui/components/nativemobile/topbar.js +0 -21
- package/lib/js/ui/components/nativemobile/topbar.js.map +0 -1
- package/lib/js/ui/components/playnext.js +0 -11
- package/lib/js/ui/components/playnext.js.map +0 -1
- package/lib/js/ui/components/settingspanel.js +0 -130
- package/lib/js/ui/components/settingspanel.js.map +0 -1
- package/lib/js/ui/components/shared/playnextscreen.js +0 -18
- package/lib/js/ui/components/shared/playnextscreen.js.map +0 -1
- package/lib/js/ui/components/titlebar.js +0 -9
- package/lib/js/ui/components/titlebar.js.map +0 -1
- package/lib/js/ui/components/topbar.js +0 -22
- package/lib/js/ui/components/topbar.js.map +0 -1
- package/lib/js/ui/handlers/listboxhandlers.js +0 -41
- package/lib/js/ui/handlers/listboxhandlers.js.map +0 -1
- package/lib/js/ui/handlers/nicamhandler.js +0 -32
- package/lib/js/ui/handlers/nicamhandler.js.map +0 -1
- package/lib/js/ui/handlers/nicamhandler.test.js +0 -34
- package/lib/js/ui/handlers/nicamhandler.test.js.map +0 -1
- package/lib/js/ui/handlers/playnexthandlers.js +0 -2
- package/lib/js/ui/handlers/playnexthandlers.js.map +0 -1
- package/lib/js/ui/handlers/timecontrolhandlers.js +0 -23
- package/lib/js/ui/handlers/timecontrolhandlers.js.map +0 -1
- package/lib/js/ui/nativemobileuicontainer.js +0 -48
- package/lib/js/ui/nativemobileuicontainer.js.map +0 -1
- package/lib/js/ui/nativemobileuifactory.js +0 -43
- package/lib/js/ui/nativemobileuifactory.js.map +0 -1
- package/lib/js/ui/uicontainer.js +0 -58
- package/lib/js/ui/uicontainer.js.map +0 -1
- package/lib/js/utilities/localizationconfig.js +0 -8
- package/lib/js/utilities/localizationconfig.js.map +0 -1
- package/lib/js/utilities/printversion.js +0 -28
- package/lib/js/utilities/printversion.js.map +0 -1
- package/lib/js/utilities/utilities.js +0 -105
- package/lib/js/utilities/utilities.js.map +0 -1
- package/lib/lang/nl.json +0 -72
- package/lib/npoplayer.test.js +0 -12
- package/lib/npoplayer.test.js.map +0 -1
- package/lib/src/js/ads/ster.d.ts +0 -4
- package/lib/src/js/ads/ster.test.d.ts +0 -1
- package/lib/src/js/api/getstreamobject.d.ts +0 -3
- package/lib/src/js/cdnproviders.d.ts +0 -1
- package/lib/src/js/checks/safari.d.ts +0 -1
- package/lib/src/js/checks/safari.test.d.ts +0 -1
- package/lib/src/js/drm/verifydrm.d.ts +0 -4
- package/lib/src/js/drm/verifydrm.test.d.ts +0 -1
- package/lib/src/js/fragments/setfragments.d.ts +0 -4
- package/lib/src/js/playeractions/customerrors.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/customerrors.d.ts +0 -50
- package/lib/src/js/playeractions/handlers/error.d.ts +0 -3
- package/lib/src/js/playeractions/handlers/error.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/handleoffsets.d.ts +0 -6
- package/lib/src/js/playeractions/handlers/handleoffsets.test.d.ts +0 -1
- package/lib/src/js/playeractions/handlers/processplayerconfig.d.ts +0 -11
- package/lib/src/js/playeractions/handlers/resolvekeypress.d.ts +0 -3
- package/lib/src/js/playeractions/playeractions.d.ts +0 -4
- package/lib/src/js/tracking/handlers/eventbinding.d.ts +0 -10
- package/lib/src/js/tracking/handlers/eventlogging.d.ts +0 -11
- package/lib/src/js/tracking/handlers/playertrackerinit.d.ts +0 -13
- package/lib/src/js/tracking/handlers/playertrackerstart.d.ts +0 -8
- package/lib/src/js/tracking/playertracker.d.ts +0 -4
- package/lib/src/js/ui/components/adbutton.d.ts +0 -7
- package/lib/src/js/ui/components/adlabel.d.ts +0 -7
- package/lib/src/js/ui/components/buttons.d.ts +0 -30
- package/lib/src/js/ui/components/controlbar.d.ts +0 -3
- package/lib/src/js/ui/components/ctabar.d.ts +0 -9
- package/lib/src/js/ui/components/nativemobile/addFragments.d.ts +0 -1
- package/lib/src/js/ui/components/nativemobile/buttons.d.ts +0 -13
- package/lib/src/js/ui/components/nativemobile/controlbar.d.ts +0 -3
- package/lib/src/js/ui/components/nativemobile/ctabar.d.ts +0 -10
- package/lib/src/js/ui/components/nativemobile/playnext.d.ts +0 -10
- package/lib/src/js/ui/components/nativemobile/titlebar.d.ts +0 -2
- package/lib/src/js/ui/components/nativemobile/topbar.d.ts +0 -3
- package/lib/src/js/ui/components/playnext.d.ts +0 -11
- package/lib/src/js/ui/components/settingspanel.d.ts +0 -4
- package/lib/src/js/ui/components/shared/playnextscreen.d.ts +0 -2
- package/lib/src/js/ui/components/titlebar.d.ts +0 -3
- package/lib/src/js/ui/components/topbar.d.ts +0 -2
- package/lib/src/js/ui/handlers/listboxhandlers.d.ts +0 -5
- package/lib/src/js/ui/handlers/nicamhandler.d.ts +0 -2
- package/lib/src/js/ui/handlers/nicamhandler.test.d.ts +0 -1
- package/lib/src/js/ui/handlers/playnexthandlers.d.ts +0 -0
- package/lib/src/js/ui/handlers/timecontrolhandlers.d.ts +0 -3
- package/lib/src/js/ui/nativemobileuicontainer.d.ts +0 -6
- package/lib/src/js/ui/nativemobileuifactory.d.ts +0 -3
- package/lib/src/js/ui/uicontainer.d.ts +0 -3
- package/lib/src/js/utilities/localizationconfig.d.ts +0 -6
- package/lib/src/js/utilities/printversion.d.ts +0 -1
- package/lib/src/js/utilities/utilities.d.ts +0 -60
- package/lib/src/npoplayer.d.ts +0 -45
- package/lib/src/npoplayer.test.d.ts +0 -1
- package/lib/src/types/classes.d.ts +0 -4
- package/lib/src/types/interfaces.d.ts +0 -106
- package/lib/types/classes.js +0 -4
- package/lib/types/classes.js.map +0 -1
- package/lib/types/interfaces.js +0 -6
- package/lib/types/interfaces.js.map +0 -1
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { ErrorUtils } from "bitmovin-player-ui";
|
|
2
|
-
// Reference: https://bitmovin.com/docs/player/api-reference/web/web-sdk-api-reference-v8#/player/web/8/docs/enums/core_deficiency.errorcode.html#network_error
|
|
3
|
-
export const customSpecificErrorMessageOverlayConfig = {
|
|
4
|
-
// Overwrite error 1000 'Error is unknown'
|
|
5
|
-
1000: "Oeps, er gaat iets mis",
|
|
6
|
-
// API_NOT_AVAILABLE
|
|
7
|
-
// The player API was accessed after the player instance has been destroyed by either calling PlayerAPI.destroy or after an PlayerEvent.Error event has been thrown.
|
|
8
|
-
1001: "Oeps, er gaat iets mis",
|
|
9
|
-
// SETUP_NO_HTML_ELEMENT
|
|
10
|
-
// An attempt was made to create a player instance with a container element that is not an instance of HTMLElement.
|
|
11
|
-
1101: "De player is niet aangemaakt",
|
|
12
|
-
// SETUP_MISSING_CONFIGURATION
|
|
13
|
-
// No PlayerConfig was provided when attempting to create a player instance.
|
|
14
|
-
1102: "Er ging iets mis met de configuratie",
|
|
15
|
-
// SETUP_LICENSE_ERROR
|
|
16
|
-
// The player license server did not grant playback for the given player key as specified in the PlayerConfig.
|
|
17
|
-
1103: "Er is iets mis met de licentie (access key)",
|
|
18
|
-
// SETUP_MISSING_DOMAIN_LICENSE_ALLOWLIST
|
|
19
|
-
// The player build is domain-locked and not authorized to play content on the current domain.
|
|
20
|
-
1104: "De video kan niet worden afgespeeld op dit domein",
|
|
21
|
-
// SETUP_MISSING_LICENSE_ALLOWLIST
|
|
22
|
-
// The player is not allowed to play back content on the current domain.
|
|
23
|
-
1105: "De video kan niet op dit web-adres worden afgespeeld",
|
|
24
|
-
// SETUP_INVALID_LICENSE_SERVER
|
|
25
|
-
// The license server URL provided in TweaksConfig.licenseServer does not match any of the available license server URLs.
|
|
26
|
-
1106: "",
|
|
27
|
-
// SETUP_INVALID_IMPRESSION_SERVER
|
|
28
|
-
// The impression server URL provided in TweaksConfig.impressionServer does not match any of the available impression server URLs.
|
|
29
|
-
1107: "",
|
|
30
|
-
// SETUP_NO_RENDERING_ENGINE
|
|
31
|
-
// Could not initialize the rendering engine. This error occurs when the platform does not support the PlayerType and StreamType for the provided SourceConfig on the current platform, and is therefore unable to instantiate a suitable rendering engine.
|
|
32
|
-
1108: "",
|
|
33
|
-
// SETUP_UNSUPPORTED_PROTOCOL`
|
|
34
|
-
// This site has been loaded using "file" protocol which is not supported. Please host the page using a web server (using http or https).
|
|
35
|
-
1113: "De video kan niet worden afgespeeld zonder web server",
|
|
36
|
-
// SOURCE_INVALID
|
|
37
|
-
// The SourceConfig provided to the PlayerAPI.load method is invalid. Ensure that the SourceConfig contains at least one valid source URL for any of the supported stream types on the current platform.
|
|
38
|
-
1201: "Er is iets mis met de source configuratie",
|
|
39
|
-
// Transform error 1202 'Unsupported manifest format' to uppercase
|
|
40
|
-
1202: (error) => {
|
|
41
|
-
return ErrorUtils.defaultErrorMessages[error.code];
|
|
42
|
-
},
|
|
43
|
-
// Overwrite error 1203 = SOURCE_NO_SUPPORTED_TECHNOLOGY
|
|
44
|
-
// The platform does not support any of the technologies needed to play back the provided source.
|
|
45
|
-
1203: "Helaas, deze video is niet beschikbaar.",
|
|
46
|
-
// SOURCE_STREAM_TYPE_NOT_SUPPORTED
|
|
47
|
-
// The stream type is not supported.
|
|
48
|
-
// This error happens when the SourceConfig does not contain a valid stream type, i.e. dash, hls, progressive or smooth.
|
|
49
|
-
1204: "",
|
|
50
|
-
// SOURCE_FORCED_TECHNOLOGY_NOT_SUPPORTED
|
|
51
|
-
// The Technology selected through the forceTechnology parameter, that was passed to the PlayerAPI.load method, is not supported on the current platform.
|
|
52
|
-
1205: "",
|
|
53
|
-
// SOURCE_NO_STREAM_FOUND_FOR_SUPPORTED_TECHNOLOGY
|
|
54
|
-
// The current platform doesn't support any of the technologies needed to play back any of the sources provided in the SourceConfig.
|
|
55
|
-
1206: "",
|
|
56
|
-
// SOURCE_EMPTY_SEGMENT
|
|
57
|
-
// The downloaded segment is empty.
|
|
58
|
-
1207: "",
|
|
59
|
-
// SOURCE_COULD_NOT_LOAD_MANIFEST
|
|
60
|
-
// The manifest could not be loaded.
|
|
61
|
-
// The manifest network request failed, please check the network request's response for the failure reason.
|
|
62
|
-
1208: (error) => {
|
|
63
|
-
const statusCode = error.data.statusCode;
|
|
64
|
-
return "Manifest laden mislukt met HTTP fout " + statusCode;
|
|
65
|
-
},
|
|
66
|
-
// SOURCE_PROGRESSIVE_STREAM_ERROR
|
|
67
|
-
// The specified progressive stream type is not supported, or the SourceElement used to load the source has reported an error.
|
|
68
|
-
1209: "",
|
|
69
|
-
// SOURCE_HLS_STREAM_ERROR
|
|
70
|
-
// An error was encountered while playing, or trying to play back an HLS stream.
|
|
71
|
-
1210: "",
|
|
72
|
-
// SOURCE_ENCRYPTION_METHOD_NOT_SUPPORTED
|
|
73
|
-
// The encryption method used by the source is not supported.
|
|
74
|
-
1211: "",
|
|
75
|
-
// PLAYBACK_VIDEO_DECODING_ERROR
|
|
76
|
-
// An error occurred while trying to demux or decode the content.
|
|
77
|
-
// This error can occur when the browser or device is unable to either demux or decode the content.
|
|
78
|
-
1301: "",
|
|
79
|
-
// PLAYBACK_HLS_COULD_NOT_LOAD_TRANSMUXER
|
|
80
|
-
// The transmuxer could not be initialized.
|
|
81
|
-
// This error can occur when an error is encountered during transmuxer initialization.
|
|
82
|
-
1304: "",
|
|
83
|
-
// NETWORK_ERROR
|
|
84
|
-
// A general network error has occurred while downloading resource E.g.: the manifest or a segment of the stream.
|
|
85
|
-
1400: "Er is iets mis met uw internet-verbinding",
|
|
86
|
-
// NETWORK_MANIFEST_DOWNLOAD_TIMEOUT
|
|
87
|
-
// The manifest download request timed out.
|
|
88
|
-
1401: "",
|
|
89
|
-
// NETWORK_SEGMENT_DOWNLOAD_TIMEOUT
|
|
90
|
-
// The segment download timed out.
|
|
91
|
-
1402: "",
|
|
92
|
-
// NETWORK_PROGRESSIVE_STREAM_DOWNLOAD_TIMEOUT
|
|
93
|
-
// The progressive stream download timed out.
|
|
94
|
-
1403: "",
|
|
95
|
-
// NETWORK_FAILED_CERTIFICATE_REQUEST
|
|
96
|
-
// The Fairplay DRM certificate request failed.
|
|
97
|
-
1404: "",
|
|
98
|
-
// DRM_MISSING_CONFIGURATION
|
|
99
|
-
// An attempt was made to play back a Fairplay protected stream, but no DRM configuration was provided in the SourceConfig.drm.
|
|
100
|
-
2001: "",
|
|
101
|
-
// DRM_NO_LICENSE_SERVER_URL_PROVIDED
|
|
102
|
-
// The Fairplay licensing server URL is missing in the provided AppleFairplayDRMConfig.
|
|
103
|
-
2002: "",
|
|
104
|
-
// DRM_FAILED_LICENSE_REQUEST
|
|
105
|
-
// The DRM license request failed.
|
|
106
|
-
2003: "Oeps, er is iets mis met het opvragen van de DRM",
|
|
107
|
-
2005: "",
|
|
108
|
-
// DRM_NO_KEY_SYSTEM
|
|
109
|
-
// The current platform doesn't support any of the key systems specified in the SourceConfig that are required to play back the content.
|
|
110
|
-
2006: "Oeps, er is iets mis met de DRM",
|
|
111
|
-
// DRM_KEY_SESSION_INITIALIZATION_FAILED
|
|
112
|
-
// Unable to create or initialize a DRM key session.
|
|
113
|
-
2007: "",
|
|
114
|
-
// DRM_MEDIA_KEY_INITIALIZATION_FAILED
|
|
115
|
-
// The DRM Media Keys object could not be created or initialized.
|
|
116
|
-
2008: "",
|
|
117
|
-
// DRM_KEY_ERROR
|
|
118
|
-
// The video element or an associated DRM Key Session has thrown a DRM key error.
|
|
119
|
-
2009: "",
|
|
120
|
-
// DRM_KEY_SYSTEM_NOT_SUPPORTED
|
|
121
|
-
// No supported Fairplay Key System is available.
|
|
122
|
-
2010: "",
|
|
123
|
-
// DRM_CERTIFICATE_ERROR
|
|
124
|
-
// The DRM certificate specified in the DRMConfig is not valid, the player was unable to parse the provided certificate or the network request for the certificate failed.
|
|
125
|
-
2011: "",
|
|
126
|
-
// DRM_PLAYREADY_INVALID_HEADER_KEY_VALUE_PAIR
|
|
127
|
-
// Invalid header key/value pair encountered while parsing a PlayReady license request.
|
|
128
|
-
2012: "",
|
|
129
|
-
// DRM_RESTRICTED_OUTPUT
|
|
130
|
-
// The DRM protected content cannot be played back due to the device not being able to securely present the content.
|
|
131
|
-
2013: "",
|
|
132
|
-
// DRM_INIT_DATA_MISSING
|
|
133
|
-
// No init data was found for the used key system in the manifest or the segments.
|
|
134
|
-
2015: "",
|
|
135
|
-
// VR_INCOMPATIBLE_PLAYER_TECHNOLOGY
|
|
136
|
-
// The video element or an associated DRM Key Session has thrown a DRM key error.
|
|
137
|
-
2101: "",
|
|
138
|
-
// MODULE_INVALID_DEFINITION
|
|
139
|
-
// The definition of the module is invalid
|
|
140
|
-
3001: "",
|
|
141
|
-
// MODULE_INVALID_DEFINITION_DEPENDENCY
|
|
142
|
-
// The module definition specifies dependencies but the module is not provided via a function for deferred loading.
|
|
143
|
-
3002: "",
|
|
144
|
-
// MODULE_MISSING
|
|
145
|
-
// A module cannot be loaded because it has not been added to the player core.
|
|
146
|
-
3003: "",
|
|
147
|
-
// MODULE_DEPENDENCY_MISSING
|
|
148
|
-
// A module cannot be loaded because one or more dependencies are missing.
|
|
149
|
-
3004: "",
|
|
150
|
-
// SEGMENT_PSSH_DATA_MISSING
|
|
151
|
-
// No relevant PSSH block data was found for the used key system. This issue is known to happen on Tizen 2016.
|
|
152
|
-
4000: "",
|
|
153
|
-
};
|
|
154
|
-
//# sourceMappingURL=customerrors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customerrors.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/customerrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,+JAA+J;AAC/J,MAAM,CAAC,MAAM,uCAAuC,GAAG;IACnD,0CAA0C;IAC1C,IA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EAAE;IAER,oCAAoC;IACpC,iFAAiF;IACjF,IAAI,EAAE,EAAE;IAER,4BAA4B;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,EAAE;IAER,uCAAuC;IACvC,mHAAmH;IACnH,IAAI,EAAE,EAAE;IAER,iBAAiB;IACjB,8EAA8E;IAC9E,IAAI,EAAE,EAAE;IAER,4BAA4B;IAC5B,0EAA0E;IAC1E,IAAI,EAAE,EAAE;IAER,4BAA4B;IAC5B,8GAA8G;IAC9G,IAAI,EAAE,EAAE;CACX,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This function handles the error flow.
|
|
3
|
-
* @function handlePlayerError
|
|
4
|
-
* @param {PlayerAPI} player - The Bitmovin player instance
|
|
5
|
-
* @param {UIComponents} uiComponents - The UIComponents object
|
|
6
|
-
* @param {any} input - The input to parse to the error message
|
|
7
|
-
* @returns {void}
|
|
8
|
-
*/
|
|
9
|
-
export function handlePlayerError(player, uiComponents, input) {
|
|
10
|
-
let message = '';
|
|
11
|
-
if (typeof input === 'string') {
|
|
12
|
-
message = input;
|
|
13
|
-
}
|
|
14
|
-
console.error('Er is iets mis met het ophalen van de stream.', input);
|
|
15
|
-
player?.unload();
|
|
16
|
-
if (uiComponents.controlbar)
|
|
17
|
-
uiComponents.controlbar.hide();
|
|
18
|
-
if (uiComponents.errorMessageOverlay == null)
|
|
19
|
-
return;
|
|
20
|
-
uiComponents.errorMessageOverlay.show();
|
|
21
|
-
uiComponents.errorMessageOverlay.errorLabel.setText(message ?? 'De video kan niet worden geladen');
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/error.ts"],"names":[],"mappings":"AAGA;;;;;;;EAOE;AAEF,MAAM,UAAU,iBAAiB,CAC7B,MAAiB,EACjB,YAA0B,EAC1B,KAAU;IAEV,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,KAAK,CAAC;KACnB;IAED,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAC;IAEtE,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,IAAI,YAAY,CAAC,UAAU;QAAE,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAE5D,IAAI,YAAY,CAAC,mBAAmB,IAAI,IAAI;QAAE,OAAO;IACrD,YAAY,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;IACvC,YAAY,CAAC,mBAA2B,CAAC,UAAU,CAAC,OAAO,CACxD,OAAO,IAAI,kCAAkC,CAChD,CAAC;AACN,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { handlePlayerError } from "./error";
|
|
2
|
-
const hide = jest.fn();
|
|
3
|
-
const unload = jest.fn();
|
|
4
|
-
const setText = jest.fn();
|
|
5
|
-
const show = jest.fn();
|
|
6
|
-
const input = "string";
|
|
7
|
-
const player = { unload };
|
|
8
|
-
const uiComponents = {
|
|
9
|
-
controlbar: { hide },
|
|
10
|
-
errorMessageOverlay: {
|
|
11
|
-
errorLabel: { setText },
|
|
12
|
-
show,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
describe("Test DRM verification", () => {
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
jest.resetAllMocks();
|
|
18
|
-
});
|
|
19
|
-
it("should call player.unload", () => {
|
|
20
|
-
handlePlayerError(player, uiComponents, input);
|
|
21
|
-
expect(unload).toBeCalled();
|
|
22
|
-
});
|
|
23
|
-
it("should hide the controlbar", () => {
|
|
24
|
-
handlePlayerError(player, uiComponents, input);
|
|
25
|
-
expect(hide).toBeCalled();
|
|
26
|
-
});
|
|
27
|
-
it("should not hide the controlbar", () => {
|
|
28
|
-
const components = {
|
|
29
|
-
...uiComponents,
|
|
30
|
-
controlbar: undefined,
|
|
31
|
-
};
|
|
32
|
-
handlePlayerError(player, components, input);
|
|
33
|
-
expect(hide).not.toBeCalled();
|
|
34
|
-
});
|
|
35
|
-
it("should show the message overlay", () => {
|
|
36
|
-
handlePlayerError(player, uiComponents, input);
|
|
37
|
-
expect(show).toBeCalled();
|
|
38
|
-
expect(setText).toBeCalled();
|
|
39
|
-
});
|
|
40
|
-
it("should not show the message overlay", () => {
|
|
41
|
-
handlePlayerError(player, { ...uiComponents, errorMessageOverlay: undefined }, input);
|
|
42
|
-
expect(show).not.toBeCalled();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=error.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.test.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/error.test.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACvB,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACzB,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEvB,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,MAAM,GAAG,EAAE,MAAM,EAA0B,CAAC;AAElD,MAAM,YAAY,GAAiB;IAC/B,UAAU,EAAE,EAAE,IAAI,EAA2B;IAC7C,mBAAmB,EAAE;QACjB,UAAU,EAAE,EAAE,OAAO,EAAE;QACvB,IAAI;KAC2B;CACtC,CAAC;AAEF,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACnC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACjC,iBAA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the player is playing live content it will do nothing and parse a warn to the console.
|
|
5
|
-
* @function handleStartOffset
|
|
6
|
-
* @param {PlayerAPI} player - The Bitmovin player instance
|
|
7
|
-
* @param {number} offset - The offset to seek to in seconds
|
|
8
|
-
* @returns {void}
|
|
9
|
-
*/
|
|
10
|
-
export function handleStartOffset(player, offset) {
|
|
11
|
-
if (offset == null || player.isLive()) {
|
|
12
|
-
if (player.isLive()) {
|
|
13
|
-
console.warn('handleStartOffset was called but the player is playing live content.');
|
|
14
|
-
}
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
player.on(PlayerEvent.SourceLoaded, () => {
|
|
18
|
-
player.seek(offset);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/*
|
|
22
|
-
* This function rewinds a livestream to the specified unix timestamp,
|
|
23
|
-
* if the player is playing VOD content it will do nothing and parse a warn to the console.
|
|
24
|
-
* @function shiftToProgramStart
|
|
25
|
-
* @param {PlayerAPI} player - The Bitmovin player instance
|
|
26
|
-
* @param {number} timestamp - The unix timestamp to rewind to
|
|
27
|
-
* @returns {void}
|
|
28
|
-
*/
|
|
29
|
-
export function shiftToProgramStart(player, timestamp) {
|
|
30
|
-
if (player == null)
|
|
31
|
-
return;
|
|
32
|
-
if (timestamp == null || !player.isLive()) {
|
|
33
|
-
if (!player.isLive()) {
|
|
34
|
-
console.warn('shiftToProgramStart was called but the player is playing VOD content.');
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
player.timeShift(timestamp);
|
|
39
|
-
}
|
|
40
|
-
/*
|
|
41
|
-
* This functions handles the logic flow for showing the Watch from start button.
|
|
42
|
-
* If liveOffset is set to true, it will hide the button and rewind the player to the start of the program on load.
|
|
43
|
-
* @function handleLiveOffsetLogic
|
|
44
|
-
* @param {NpoPlayer} npoplayer - The NpoPlayer instance
|
|
45
|
-
* @param {PlayerAPI} player - The Bitmovin player instance
|
|
46
|
-
* @param {StreamOptions} options - The stream options object
|
|
47
|
-
* @returns {void}
|
|
48
|
-
*/
|
|
49
|
-
export function handleLiveOffsetLogic(npoplayer, player, options) {
|
|
50
|
-
if (player == null)
|
|
51
|
-
return;
|
|
52
|
-
if (npoplayer.uiComponents.watchFromStartButton == null)
|
|
53
|
-
return;
|
|
54
|
-
if (options?.liveProgramTime == null) {
|
|
55
|
-
npoplayer.uiComponents.watchFromStartButton.hide();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
// set the value present in streamoptions on the npoplayer instance to supplement the button click handler
|
|
59
|
-
npoplayer.streamOptions.liveProgramTime = options.liveProgramTime;
|
|
60
|
-
if (player.isLive() && options.liveProgramTime > 0) {
|
|
61
|
-
npoplayer.uiComponents.watchFromStartButton.show();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
npoplayer.uiComponents.watchFromStartButton.hide();
|
|
65
|
-
}
|
|
66
|
-
if (options.liveOffset !== null && options.liveOffset !== false && options.liveProgramTime > 0) {
|
|
67
|
-
npoplayer.uiComponents.watchFromStartButton.hide();
|
|
68
|
-
shiftToProgramStart(player, options.liveProgramTime);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=handleoffsets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleoffsets.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/handleoffsets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAA;AAI7D;;;;;;;EAOE;AACF,MAAM,UAAU,iBAAiB,CAAE,MAAiB,EAAE,MAAe;IACjE,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE;QACnC,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAA;SACvF;QACD,OAAM;KACT;IACD,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,EAA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BAAoB,CAAC,IAAI,EAAE,CAAA;QAClD,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;KACvD;AACL,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { handleStartOffset, shiftToProgramStart } from "./handleoffsets";
|
|
2
|
-
const isLive = () => true;
|
|
3
|
-
const onReady = jest.fn();
|
|
4
|
-
const timeShift = jest.fn();
|
|
5
|
-
const offset = 10;
|
|
6
|
-
const timestamp = 10;
|
|
7
|
-
const player = {
|
|
8
|
-
isLive,
|
|
9
|
-
on: onReady,
|
|
10
|
-
timeShift,
|
|
11
|
-
};
|
|
12
|
-
describe("Test offset handling", () => {
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
jest.resetAllMocks();
|
|
15
|
-
});
|
|
16
|
-
it("should not seek when player is live", () => {
|
|
17
|
-
handleStartOffset(player, offset);
|
|
18
|
-
expect(onReady).not.toBeCalled();
|
|
19
|
-
});
|
|
20
|
-
it("should not seek when offset is undefined", () => {
|
|
21
|
-
handleStartOffset({ ...player, isLive: () => false });
|
|
22
|
-
expect(onReady).not.toBeCalled();
|
|
23
|
-
});
|
|
24
|
-
it("should seek when player is not live and offset is defined", () => {
|
|
25
|
-
handleStartOffset({ ...player, isLive: () => false }, offset);
|
|
26
|
-
expect(onReady).toBeCalled();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe("Test programStart shift", () => {
|
|
30
|
-
afterEach(() => {
|
|
31
|
-
jest.resetAllMocks();
|
|
32
|
-
});
|
|
33
|
-
it("should not call timeshift when player is null", () => {
|
|
34
|
-
shiftToProgramStart(null, timestamp);
|
|
35
|
-
expect(timeShift).not.toBeCalled();
|
|
36
|
-
});
|
|
37
|
-
it("should not call timeshift when timestamp is undefined", () => {
|
|
38
|
-
shiftToProgramStart(player);
|
|
39
|
-
expect(timeShift).not.toBeCalled();
|
|
40
|
-
});
|
|
41
|
-
it("should not call timeshift when player is not live", () => {
|
|
42
|
-
shiftToProgramStart({ ...player, isLive: () => false }, timestamp);
|
|
43
|
-
expect(timeShift).not.toBeCalled();
|
|
44
|
-
});
|
|
45
|
-
it("should not call timeshift when player is live and timestamp is set", () => {
|
|
46
|
-
shiftToProgramStart(player, timestamp);
|
|
47
|
-
expect(timeShift).toBeCalled();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=handleoffsets.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleoffsets.test.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/handleoffsets.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE5B,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,MAAM,GAAG;IACX,MAAM;IACN,EAAE,EAAE,OAAO;IACX,SAAS;CACY,CAAC;AAE1B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC3C,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAElC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,iBAAiB,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAA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,UAAU,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @function processPlayerConfig
|
|
3
|
-
* @description This function is called by the NpoPlayer constructor to enrich the player configuration object
|
|
4
|
-
* with default values where none were set by the user.
|
|
5
|
-
* @param {NpoPlayer} npoplayer - The NpoPlayer instance
|
|
6
|
-
* @param {PlayerConfig} playerConfig - The player configuration object that was created by the user
|
|
7
|
-
* @returns The processed player configuration object
|
|
8
|
-
*/
|
|
9
|
-
import { LogLevel } from "bitmovin-player";
|
|
10
|
-
import { isSafari } from '../../checks/safari';
|
|
11
|
-
export function processPlayerConfig(npoplayer, playerConfig) {
|
|
12
|
-
let processedConfig = playerConfig;
|
|
13
|
-
if (isSafari(npoplayer.isFairPlayDrmSupported())) {
|
|
14
|
-
// Disable autoplay on safari
|
|
15
|
-
processedConfig.playback = {
|
|
16
|
-
autoplay: false
|
|
17
|
-
};
|
|
18
|
-
// Potential fix for DRM issues on safari
|
|
19
|
-
processedConfig.tweaks = {
|
|
20
|
-
fairplay_ignore_duplicate_init_data_key_errors: true
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
processedConfig.ui = false;
|
|
24
|
-
// Chromecast configuration
|
|
25
|
-
if (!processedConfig.remotecontrol)
|
|
26
|
-
processedConfig.remotecontrol = {
|
|
27
|
-
type: 'googlecast',
|
|
28
|
-
receiverApplicationId: 'CC38EB17',
|
|
29
|
-
receiverVersion: 'v3',
|
|
30
|
-
messageNamespace: 'urn:x-cast:com.bitmovin.player.caf'
|
|
31
|
-
};
|
|
32
|
-
if (!processedConfig.logs)
|
|
33
|
-
processedConfig.logs = {
|
|
34
|
-
level: LogLevel.ERROR
|
|
35
|
-
};
|
|
36
|
-
//creating this node enables the PlayerAdvertisingAPI
|
|
37
|
-
processedConfig.advertising = {};
|
|
38
|
-
return processedConfig;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=processplayerconfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processplayerconfig.js","sourceRoot":"","sources":["../../../../../src/js/playeractions/handlers/processplayerconfig.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,MAAM,UAAU,mBAAmB,CAAC,SAAmB,EAAE,YAAyB;IAE9E,IAAI,eAAe,GAAG,YAAY,CAAA;IAElC,IAAI,QAAQ,CAAC,SAAS,CAAC,sBAAsB,EAAE,CAAC,EAAE;QAC9C,6BAA6B;QAC7B,eAAe,CAAC,QAAQ,GAAG;YACvB,QAAQ,EAAE,KAAK;SAClB,CAAA;QAED,yCAAyC;QACzC,eAAe,CAAC,MAAM,GAAG;YACrB,8CAA8C,EAAE,IAAI;SACvD,CAAA;KACJ;IAED,eAAe,CAAC,EAAE,GAAG,KAAK,CAAA;IAE1B,2BAA2B;IAC3B,IAAG,CAAC,eAAe,CAAC,aAAa;QAAE,eAAe,CAAC,aAAa,GAAG;YAC/D,IAAI,EAAE,YAAY;YAClB,qBAAqB,EAAE,UAAU;YACjC,eAAe,EAAE,IAAI;YACrB,gBAAgB,EAAE,oCAAoC;SACzD,CAAA;IAED,IAAG,CAAC,eAAe,CAAC,IAAI;QAAE,eAAe,CAAC,IAAI,GAAG;YAC7C,KAAK,EAAE,QAAQ,CAAC,KAAK;SACxB,CAAA;IAED,qDAAqD;IACrD,eAAe,CAAC,WAAW,GAAG,EAAE,CAAA;IAEhC,OAAO,eAAe,CAAA;AAC1B,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ViewMode } from "bitmovin-player";
|
|
2
|
-
/*
|
|
3
|
-
* This function is called when a key is pressed and handles the logic for the keypress.
|
|
4
|
-
* @function resolveKeyPress
|
|
5
|
-
* @param {PlayerAPI} player - The Bitmovin player instance
|
|
6
|
-
* @param {NpoPlayer} npoplayer - The NpoPlayer instance
|
|
7
|
-
* @param {KeyboardEvent} e - The keyboard event
|
|
8
|
-
* @returns {void}
|
|
9
|
-
*/
|
|
10
|
-
export function resolveKeyPress(player, npoplayer, e) {
|
|
11
|
-
switch (e.code) {
|
|
12
|
-
case 'KeyM': {
|
|
13
|
-
const isMuted = player.isMuted() ?? false;
|
|
14
|
-
isMuted ? player.unmute() : player.mute();
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
case 'KeyF': {
|
|
18
|
-
if (player.getViewMode() !== ViewMode.Fullscreen) {
|
|
19
|
-
player.setViewMode(ViewMode.Fullscreen);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
player.setViewMode(ViewMode.Inline);
|
|
23
|
-
}
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
case 'Space': {
|
|
27
|
-
const isPaused = player.isPaused() ?? false;
|
|
28
|
-
isPaused ? player.play() : player.pause();
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
case 'ArrowUp': {
|
|
32
|
-
const isMuted = player.isMuted() ?? false;
|
|
33
|
-
if (isMuted)
|
|
34
|
-
player.unmute();
|
|
35
|
-
npoplayer.increaseVolume();
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case 'ArrowDown': {
|
|
39
|
-
const isMuted = player.isMuted() ?? false;
|
|
40
|
-
if (isMuted)
|
|
41
|
-
player.unmute();
|
|
42
|
-
npoplayer.decreaseVolume();
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
case 'ArrowLeft': {
|
|
46
|
-
npoplayer.goBackwards(10);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
case 'ArrowRight': {
|
|
50
|
-
npoplayer.goForward(10);
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=resolvekeypress.js.map
|
|
@@ -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GAAG,MAAM,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC;YAC1C,IAAI,OAAO;gBAAE,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7B,SAAS,CAAC,cAAc,EAAE,CAAC;YAC3B,MAAM;SACT;QACD,KAAK,WAAW,CAAC,CAAC;YACd,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC1B,MAAM;SACT;QACD,KAAK,YAAY,CAAC,CAAC;YACf,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACxB,MAAM;SACT;KACJ;AACL,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { resolveKeyPress } from "./handlers/resolvekeypress";
|
|
2
|
-
export { handleStartOffset, handleLiveOffsetLogic, shiftToProgramStart } from "./handlers/handleoffsets";
|
|
3
|
-
export { handlePlayerError } from "./handlers/error";
|
|
4
|
-
export { processPlayerConfig } from "./handlers/processplayerconfig";
|
|
5
|
-
//# sourceMappingURL=playeractions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playeractions.js","sourceRoot":"","sources":["../../../../src/js/playeractions/playeractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { PlayerEvent, ViewMode } from 'bitmovin-player';
|
|
2
|
-
import { logEvent } from './eventlogging';
|
|
3
|
-
/**
|
|
4
|
-
* @function bindPlayerEvents
|
|
5
|
-
* @description Binds the player events to the event logging function.
|
|
6
|
-
* @param {NpoPlayer} npoplayer - The NpoPlayer instance.
|
|
7
|
-
* @param {PlayerAPI} player - The Bitmovin player instance.
|
|
8
|
-
* @returns {void}
|
|
9
|
-
*/
|
|
10
|
-
export function bindPlayerEvents(npoplayer, player) {
|
|
11
|
-
if (player == null)
|
|
12
|
-
return;
|
|
13
|
-
let isNewSource = false;
|
|
14
|
-
const playerEvents = [
|
|
15
|
-
{ event: PlayerEvent.Paused, name: 'pause' },
|
|
16
|
-
{ event: PlayerEvent.SourceLoaded, name: 'load_complete' },
|
|
17
|
-
{ event: PlayerEvent.Ready, name: 'load_complete' },
|
|
18
|
-
{ event: PlayerEvent.StallStarted, name: 'buffering' },
|
|
19
|
-
{ event: PlayerEvent.StallEnded, name: 'buffering_complete' },
|
|
20
|
-
{ event: PlayerEvent.PlaybackFinished, name: 'complete' },
|
|
21
|
-
{ event: PlayerEvent.TimeChanged, name: 'time' },
|
|
22
|
-
{
|
|
23
|
-
event: PlayerEvent.ViewModeChanged,
|
|
24
|
-
name: player?.getViewMode() === ViewMode.Fullscreen
|
|
25
|
-
? 'fullscreen'
|
|
26
|
-
: 'windowed'
|
|
27
|
-
},
|
|
28
|
-
{ event: PlayerEvent.SourceUnloaded, name: 'stop' },
|
|
29
|
-
{ event: PlayerEvent.Destroy, name: 'stop' },
|
|
30
|
-
];
|
|
31
|
-
const logEventHandler = (npoplayer, eventName) => {
|
|
32
|
-
return () => {
|
|
33
|
-
logEvent(npoplayer, eventName);
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
//Handle seek events, this requires a custom handler because we need to send the seek_from and seek_position parameters
|
|
37
|
-
const seekHandler = (e) => {
|
|
38
|
-
const data = {
|
|
39
|
-
seek_from: e.position,
|
|
40
|
-
stream_position: e.seekTarget
|
|
41
|
-
};
|
|
42
|
-
logEvent(npoplayer, 'seek', data);
|
|
43
|
-
};
|
|
44
|
-
// Because we only want to load 'start' when a new source is starting playback, we need to keep track of that
|
|
45
|
-
const handleSourceLoaded = () => {
|
|
46
|
-
isNewSource = true;
|
|
47
|
-
};
|
|
48
|
-
//fire resume event when the player resumes playback and the source is not new (unpause)
|
|
49
|
-
const handlePlay = () => {
|
|
50
|
-
if (!isNewSource) {
|
|
51
|
-
logEvent(npoplayer, 'resume');
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
//fire start event when the player starts playing new content, set isNewSource to false
|
|
55
|
-
const handlePlaying = () => {
|
|
56
|
-
if (isNewSource) {
|
|
57
|
-
logEvent(npoplayer, 'start');
|
|
58
|
-
isNewSource = false;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
//sends a stop event when the user leaves the page
|
|
62
|
-
function stopBeforeUnload() {
|
|
63
|
-
logEvent(npoplayer, 'stop');
|
|
64
|
-
}
|
|
65
|
-
//remove old listeners (if they exist) before setting new ones
|
|
66
|
-
player.off(PlayerEvent.SourceLoaded, handleSourceLoaded);
|
|
67
|
-
player.off(PlayerEvent.Seek, seekHandler);
|
|
68
|
-
player.off(PlayerEvent.Play, handlePlay);
|
|
69
|
-
player.off(PlayerEvent.Playing, handlePlaying);
|
|
70
|
-
playerEvents.forEach(({ event, name }) => {
|
|
71
|
-
const handler = logEventHandler(npoplayer, name);
|
|
72
|
-
player.off(event, handler);
|
|
73
|
-
});
|
|
74
|
-
window.removeEventListener('beforeunload', stopBeforeUnload);
|
|
75
|
-
//bind new listeners
|
|
76
|
-
player.on(PlayerEvent.SourceLoaded, handleSourceLoaded);
|
|
77
|
-
player.on(PlayerEvent.Seek, seekHandler);
|
|
78
|
-
player.on(PlayerEvent.Play, handlePlay);
|
|
79
|
-
player.on(PlayerEvent.Playing, handlePlaying);
|
|
80
|
-
playerEvents.forEach(({ event, name }) => {
|
|
81
|
-
const handler = logEventHandler(npoplayer, name);
|
|
82
|
-
player.on(event, handler);
|
|
83
|
-
});
|
|
84
|
-
window.addEventListener('beforeunload', stopBeforeUnload);
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=eventbinding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventbinding.js","sourceRoot":"","s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EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IAE7D,oBAAoB;IACpB,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;IACxC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC9C,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @function logEvent
|
|
3
|
-
* @description Logs an event to the NPO Tag StreamTracker
|
|
4
|
-
* @param {Object} npoplayer - The NpoPlayer instance
|
|
5
|
-
* @param {string} event - The event name
|
|
6
|
-
* @param {Object} data - The event data, this is optional and currently only used for seek events,
|
|
7
|
-
* because the tag SDK does not export SeekEventProps as a type the type for data is set to any.
|
|
8
|
-
* @returns {void}
|
|
9
|
-
*/
|
|
10
|
-
export function logEvent(npoplayer, event, data) {
|
|
11
|
-
if (!npoplayer.player || !npoplayer.streamTracker)
|
|
12
|
-
return;
|
|
13
|
-
try {
|
|
14
|
-
npoplayer.player.getCurrentTime();
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
console.log('Er gaat iets mis met de player API', e);
|
|
18
|
-
}
|
|
19
|
-
const streamOptions = { stream_position: npoplayer.player.getCurrentTime() };
|
|
20
|
-
const eventHandlers = {
|
|
21
|
-
start: npoplayer.streamTracker.start,
|
|
22
|
-
buffering: npoplayer.streamTracker.buffering,
|
|
23
|
-
buffering_complete: npoplayer.streamTracker.buffering_complete,
|
|
24
|
-
complete: npoplayer.streamTracker.complete,
|
|
25
|
-
fullscreen: npoplayer.streamTracker.fullscreen,
|
|
26
|
-
load: npoplayer.streamTracker.load,
|
|
27
|
-
load_complete: npoplayer.streamTracker.load_complete,
|
|
28
|
-
pause: npoplayer.streamTracker.pause,
|
|
29
|
-
resume: npoplayer.streamTracker.resume,
|
|
30
|
-
stop: npoplayer.streamTracker.stop,
|
|
31
|
-
windowed: npoplayer.streamTracker.windowed,
|
|
32
|
-
time: npoplayer.streamTracker.time,
|
|
33
|
-
// seek event including so properties
|
|
34
|
-
seek: () => {
|
|
35
|
-
npoplayer.streamTracker?.seek(data);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const streamTrackerHandler = eventHandlers[event];
|
|
39
|
-
npoplayer.logEmitter.emit('logEvent', event);
|
|
40
|
-
streamTrackerHandler(streamOptions);
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=eventlogging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventlogging.js","sourceRoot":"","sources":["../../../../../src/js/tracking/handlers/eventlogging.ts"],"names":[],"mappings":"AAAA;;;;;;;;EAQE;AAIF,MAAM,UAAU,QAAQ,CAAE,SAAoB,EAAE,KAAa,EAAE,IAAU;IACrE,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa;QAAE,OAAO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