@npo/player 1.22.4 → 1.22.5

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.
@@ -11,8 +11,8 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
11
11
  let totalAds = 0;
12
12
  let currentClickListener = null;
13
13
  let adUiSet = false;
14
- async function handleSourceLoaded() {
15
- playerapi.off(PlayerEvent.SourceLoaded, handleSourceLoaded);
14
+ async function handleReady() {
15
+ playerapi.off(PlayerEvent.Ready, handleReady);
16
16
  const advertConfig = {
17
17
  tag: {
18
18
  url: String(prerollUrl),
@@ -23,7 +23,7 @@ export async function handlePreRolls(playerapi, streamObject, npoplayer) {
23
23
  };
24
24
  await playerapi.ads.schedule(advertConfig);
25
25
  }
26
- playerapi.on(PlayerEvent.SourceLoaded, handleSourceLoaded);
26
+ playerapi.on(PlayerEvent.Ready, handleReady);
27
27
  async function handlePlay() {
28
28
  playerapi.off(PlayerEvent.Play, handlePlay);
29
29
  attemptSetAdUi();
package/lib/npoplayer.js CHANGED
@@ -148,7 +148,7 @@ export default class NpoPlayer {
148
148
  const initAndStartTracker = () => {
149
149
  if (this.player === null)
150
150
  return;
151
- this.player.off(PlayerEvent.SourceLoaded, initAndStartTracker);
151
+ this.player.off(PlayerEvent.Ready, initAndStartTracker);
152
152
  this.player.off(PlayerEvent.AdBreakFinished, initAndStartTracker);
153
153
  this.player.off(PlayerEvent.AdError, initAndStartTracker);
154
154
  streamDuration = streamDuration == null
@@ -161,7 +161,7 @@ export default class NpoPlayer {
161
161
  await handlePreRolls(this.player, this.streamObject, this);
162
162
  }
163
163
  else {
164
- this.player.on(PlayerEvent.SourceLoaded, initAndStartTracker);
164
+ this.player.on(PlayerEvent.Ready, initAndStartTracker);
165
165
  }
166
166
  }
167
167
  else {
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npo/player",
3
- "version": "1.22.4",
3
+ "version": "1.22.5",
4
4
  "description": "NPO Player",
5
5
  "author": "Publieke Omroep <player@npo.nl>",
6
6
  "contributors": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npo/player",
3
- "version": "1.22.4",
3
+ "version": "1.22.5",
4
4
  "description": "NPO Player",
5
5
  "author": "Publieke Omroep <player@npo.nl>",
6
6
  "contributors": [