function TSDemuxer(observer, config, typeSupported) {
    this.observer = void 0;
    this.config = void 0;
    this.typeSupported = void 0;
    this.sampleAes = null;
    this.pmtParsed = false;
    this.audioCodec = void 0;
    this.videoCodec = void 0;
    this._duration = 0;
    this.aacLastPTS = null;
    this._initPTS = null;
    this._initDTS = null;
    this._pmtId = -1;
    this._avcTrack = void 0;
    this._audioTrack = void 0;
    this._id3Track = void 0;
    this._txtTrack = void 0;
    this.aacOverFlow = null;
    this.avcSample = null;
    this.remainderData = null;
    this.observer = observer;
    this.config = config;
    this.typeSupported = typeSupported;
  }
highly optimized TS demuxer:
parse PAT, PMT
extract PES packet from audio and video PIDs
extract AVC/H264 NAL units and AAC/ADTS samples from PES packet
trigger the remuxer upon parsing completion
it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.
it also controls the remuxing process :
upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.