    let audioDecoderWorker = null;
    let videoDecoderWorker = null;

    // TS info
    const timingInfo = {
        muxer: {
            currentAudioTs: -1,
            currentVideoTs: -1,
        },
        decoder: {
            currentAudioTs: -1,
            currentVideoTs: -1,
        },
        renderer: {
            // Estimated audio PTS (assumed PTS is microseconds, and audio and video uses same timescale)
            currentAudioTS: -1,
            currentVideoTS: -1,
        }
    };

    con