dispose method

void dispose()
override

Implementation

void dispose() {
  super.dispose();
  _theoPlayerVideoTracks.removeEventListener(VideoTracksEventTypes.ADDTRACK.toLowerCase(), addTrackEventListener);
  _theoPlayerVideoTracks.removeEventListener(VideoTracksEventTypes.REMOVETRACK.toLowerCase(), removeTrackEventListener);
  _theoPlayerVideoTracks.removeEventListener(VideoTracksEventTypes.CHANGE.toLowerCase(), changeTrackEventListener);

  forEach((element) {
    dispatchEvent(RemoveVideoTrackEvent(track: element));
    (element as TextTrackImplWeb).dispose();
  });

  clear();
}