@npo/player 1.22.3 → 1.22.4
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/npoplayer.js +9 -10
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/npoplayer.js
CHANGED
|
@@ -85,7 +85,6 @@ export default class NpoPlayer {
|
|
|
85
85
|
if (this.player === null)
|
|
86
86
|
return;
|
|
87
87
|
let prid = (utility.isJWTToken(source) ? this.streamObject?.metadata.prid : source) || 'unknown';
|
|
88
|
-
this.player.off(PlayerEvent.SourceLoaded, getDurationAndStartPlayerTracker);
|
|
89
88
|
let duration = this.player ? this.player.getDuration() : undefined;
|
|
90
89
|
startPlayerTracker(this, utility.validateStreamLength(duration, true), this.version, prid);
|
|
91
90
|
}.bind(this);
|
|
@@ -138,6 +137,14 @@ export default class NpoPlayer {
|
|
|
138
137
|
return;
|
|
139
138
|
const drmType = this.streamObject.stream.drmType ?? null;
|
|
140
139
|
this.sourceConfig = await playerAction.processSourceConfig(options.sourceConfig ?? {}, this.streamObject, drmType && drmType.length > 0 ? profile.drm : null, this.streamOptions, this.version, this.npoTag?.npoTagInstance?.getParty());
|
|
140
|
+
await drm.verifyDRM(this, this.player, payload);
|
|
141
|
+
setupMediaSessionActionHandlers(this.player, this.sourceConfig, _streamObject);
|
|
142
|
+
logEvent(this, 'load');
|
|
143
|
+
let streamDuration = _streamObject.metadata.duration;
|
|
144
|
+
let streamPrid = this.streamObject.metadata.prid || _streamObject.metadata.prid;
|
|
145
|
+
if (this.isShowingPlayNextScreen) {
|
|
146
|
+
this.hidePlayNextScreen();
|
|
147
|
+
}
|
|
141
148
|
const initAndStartTracker = () => {
|
|
142
149
|
if (this.player === null)
|
|
143
150
|
return;
|
|
@@ -148,7 +155,7 @@ export default class NpoPlayer {
|
|
|
148
155
|
? getDurationAndStartPlayerTracker()
|
|
149
156
|
: startPlayerTracker(this, utility.validateStreamLength(streamDuration, false), this.version, streamPrid);
|
|
150
157
|
};
|
|
151
|
-
if (this.variant !== NpoPlayerUIVariants.AUDIO &&
|
|
158
|
+
if (this.variant !== NpoPlayerUIVariants.AUDIO && this.streamObject.metadata.hasPreroll === 'true' && this.streamObject.assets.preroll) {
|
|
152
159
|
this.player.on(PlayerEvent.AdBreakFinished, initAndStartTracker);
|
|
153
160
|
this.player.on(PlayerEvent.AdError, initAndStartTracker);
|
|
154
161
|
await handlePreRolls(this.player, this.streamObject, this);
|
|
@@ -156,14 +163,6 @@ export default class NpoPlayer {
|
|
|
156
163
|
else {
|
|
157
164
|
this.player.on(PlayerEvent.SourceLoaded, initAndStartTracker);
|
|
158
165
|
}
|
|
159
|
-
await drm.verifyDRM(this, this.player, payload);
|
|
160
|
-
setupMediaSessionActionHandlers(this.player, this.sourceConfig, _streamObject);
|
|
161
|
-
logEvent(this, 'load');
|
|
162
|
-
let streamDuration = _streamObject.metadata.duration;
|
|
163
|
-
let streamPrid = this.streamObject.metadata.prid || _streamObject.metadata.prid;
|
|
164
|
-
if (this.isShowingPlayNextScreen) {
|
|
165
|
-
this.hidePlayNextScreen();
|
|
166
|
-
}
|
|
167
166
|
}
|
|
168
167
|
else {
|
|
169
168
|
this.doError(`Het is niet gelukt de stream op te halen: \n Input is geen valide token of media object.`, 500);
|
package/lib/package.json
CHANGED