CueImplWeb constructor

CueImplWeb(
  1. String id,
  2. int uid,
  3. double startTime,
  4. double endTime,
  5. String content,
  6. THEOplayerTextTrackCue _nativeTextTrackCue,
)

Implementation

CueImplWeb(super.id, super.uid, super.startTime, super.endTime, super.content, this._nativeTextTrackCue) {
  enterEventListener = allowInterop((CueEnterEventJS event) {
    dispatchEvent(CueEnterEvent(cue: this));
  });

  exitEventListener = allowInterop((CueExitEventJS event) {
    dispatchEvent(CueExitEvent(cue: this));
  });

  updateEventlistener = allowInterop((CueUpdateEventJS event) {
    var cue = event.cue;
    update(cue.endTime, jsObjectToJsonString(cue.content) ?? "");
    dispatchEvent(CueUpdateEvent(cue: this));
  });

  this._nativeTextTrackCue.addEventListener(TextTrackCueEventTypes.ENTER.toLowerCase(), enterEventListener);
  this._nativeTextTrackCue.addEventListener(TextTrackCueEventTypes.ENTER.toLowerCase(), exitEventListener);
  this._nativeTextTrackCue.addEventListener(TextTrackCueEventTypes.ENTER.toLowerCase(), updateEventlistener);
}