Skip to content

[DAI] Plugin's addEventListener method does not work #1180

@alexypdu

Description

@alexypdu

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:

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");
    }
  );
});

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions