@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.
- package/lib/js/ads/ster.js +3 -3
- package/lib/npoplayer.js +2 -2
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/js/ads/ster.js
CHANGED
|
@@ -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
|
|
15
|
-
playerapi.off(PlayerEvent.
|
|
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.
|
|
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.
|
|
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.
|
|
164
|
+
this.player.on(PlayerEvent.Ready, initAndStartTracker);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
else {
|
package/lib/package.json
CHANGED