@npo/player 1.28.1 → 1.28.2

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 CHANGED
@@ -179,12 +179,14 @@ export default class NpoPlayer {
179
179
  const initAndStartTracker = () => {
180
180
  if (!this.playerContext || !this.player)
181
181
  return;
182
+ this.playerContext.npoPlayer.adBreakActive = false;
182
183
  this.player?.off(PlayerEvent.AdBreakFinished, initAndStartTracker);
183
184
  this.player?.off(PlayerEvent.AdError, initAndStartTracker);
184
185
  this.npoPlayerServices.startPlayerTracker({
185
186
  playerContext: this.playerContext,
186
187
  source: source,
187
- duration: streamDuration ? Number(streamDuration) : undefined
188
+ duration: streamDuration ? Number(streamDuration) : undefined,
189
+ afterAd: true
188
190
  });
189
191
  };
190
192
  this.npoPlayerServices.setupNicamKijkwijzerIcons(this.playerContext);
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npo/player",
3
- "version": "1.28.1",
3
+ "version": "1.28.2",
4
4
  "description": "NPO Player",
5
5
  "author": "Publieke Omroep <player@npo.nl>",
6
6
  "contributors": [
@@ -23,7 +23,7 @@ export declare class NpoPlayerServices {
23
23
  handleStreamOptions(playerContext: PlayerContext): void;
24
24
  handleError({ playerContext, status: input, context: context }: LogErrorParams): Promise<void>;
25
25
  fetchStream(playerContext: PlayerContext, payload: ApiPayload): Promise<StreamObject>;
26
- startPlayerTracker({ playerContext, source, duration }: PlayerTrackerParams): void;
26
+ startPlayerTracker({ playerContext, source, duration, afterAd }: PlayerTrackerParams): void;
27
27
  initPlayerTracker(playerContext: PlayerContext): void;
28
28
  logEvent({ playerContext, event, data }: LogEventParams): void;
29
29
  removeEventListeners(playerContext: PlayerContext): void;
@@ -94,11 +94,12 @@ export class NpoPlayerServices {
94
94
  async fetchStream(playerContext, payload) {
95
95
  return await fetchStream(playerContext, payload);
96
96
  }
97
- startPlayerTracker({ playerContext, source, duration }) {
97
+ startPlayerTracker({ playerContext, source, duration, afterAd = false }) {
98
98
  startPlayerTracker({
99
99
  playerContext,
100
100
  source,
101
- duration
101
+ duration,
102
+ afterAd
102
103
  });
103
104
  }
104
105
  initPlayerTracker(playerContext) {
@@ -1,2 +1,2 @@
1
1
  import { PlayerTrackerParams } from 'types/interfaces';
2
- export declare const startPlayerTracker: ({ playerContext, source, duration }: PlayerTrackerParams) => void;
2
+ export declare const startPlayerTracker: ({ playerContext, source, duration, afterAd }: PlayerTrackerParams) => void;
@@ -3,7 +3,7 @@ import { getStreamDurationInSeconds } from '../../js/utilities/utilities.stream'
3
3
  import { initStreamTracker } from './streamTrackerInit';
4
4
  import { bindPlayerEvents } from './eventBinding';
5
5
  import { logEvent } from './eventLogging';
6
- export const startPlayerTracker = function ({ playerContext, source, duration }) {
6
+ export const startPlayerTracker = function ({ playerContext, source, duration, afterAd = false }) {
7
7
  const { npoPlayer } = playerContext;
8
8
  const { player, sourceConfig, streamObject } = npoPlayer;
9
9
  const playerDuration = duration ?? player?.getDuration() ?? undefined;
@@ -22,4 +22,7 @@ export const startPlayerTracker = function ({ playerContext, source, duration })
22
22
  });
23
23
  bindPlayerEvents(playerContext);
24
24
  logEvent({ playerContext, event: 'load' });
25
+ if (afterAd) {
26
+ logEvent({ playerContext, event: 'load_complete' });
27
+ }
25
28
  };
@@ -23,7 +23,7 @@ export declare class NpoPlayerServices {
23
23
  handleStreamOptions(playerContext: PlayerContext): void;
24
24
  handleError({ playerContext, status: input, context: context }: LogErrorParams): Promise<void>;
25
25
  fetchStream(playerContext: PlayerContext, payload: ApiPayload): Promise<StreamObject>;
26
- startPlayerTracker({ playerContext, source, duration }: PlayerTrackerParams): void;
26
+ startPlayerTracker({ playerContext, source, duration, afterAd }: PlayerTrackerParams): void;
27
27
  initPlayerTracker(playerContext: PlayerContext): void;
28
28
  logEvent({ playerContext, event, data }: LogEventParams): void;
29
29
  removeEventListeners(playerContext: PlayerContext): void;
@@ -1,2 +1,2 @@
1
1
  import { PlayerTrackerParams } from 'types/interfaces';
2
- export declare const startPlayerTracker: ({ playerContext, source, duration }: PlayerTrackerParams) => void;
2
+ export declare const startPlayerTracker: ({ playerContext, source, duration, afterAd }: PlayerTrackerParams) => void;
@@ -207,6 +207,7 @@ export interface PlayerTrackerParams {
207
207
  playerContext: PlayerContext;
208
208
  duration?: number;
209
209
  source?: string;
210
+ afterAd?: boolean;
210
211
  }
211
212
  export interface LogEventParams {
212
213
  playerContext: PlayerContext;
@@ -207,6 +207,7 @@ export interface PlayerTrackerParams {
207
207
  playerContext: PlayerContext;
208
208
  duration?: number;
209
209
  source?: string;
210
+ afterAd?: boolean;
210
211
  }
211
212
  export interface LogEventParams {
212
213
  playerContext: PlayerContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npo/player",
3
- "version": "1.28.1",
3
+ "version": "1.28.2",
4
4
  "description": "NPO Player",
5
5
  "author": "Publieke Omroep <player@npo.nl>",
6
6
  "contributors": [