-
Notifications
You must be signed in to change notification settings - Fork 290
Closed
Labels
Description
Description
Currently with version 2.4.0 calling player.imaDai.addEventListener() will give you an error:
Uncaught TypeError: this.sdkImpl.addEventListener is not a function
Tracing the call stack:
Line 82 in 2949f22
this.controller.addEventListener(event, callback); videojs-ima/src/dai/dai-controller.js
Line 255 in 2949f22
this.sdkImpl.addEventListener(event, callback);
eventually you will see that the addEventListener method is not defined on class SdkImpl.
Note
This method is not documented in the DAI readme, so maybe it's still an incomplete feature. But I believe it will be easier (and more intuitive semantically) to add ad event listeners with this method than doing it manually as shown in the example:
player.on("stream-manager", (response) => {
const streamManager = response.streamManager;
streamManager.addEventListener(
google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,
() => {
console.log("AD_BREAK_STARTED");
}
);
});