mpegts.js icon indicating copy to clipboard operation
mpegts.js copied to clipboard

unload

Open thegobot opened this issue 7 months ago • 3 comments

After player.unload()

Uncaught TypeError: Cannot read properties of null (reading 'notifyBufferedPositionChanged')

    private _onMSEUpdateEnd(): void {
        if (this._config.isLive && this._config.liveBufferLatencyChasing && this._live_latency_chaser) {
            this._live_latency_chaser.notifyBufferedRangeUpdate();
        }

       this._loading_controller.notifyBufferedPositionChanged();
    }

thegobot avatar May 06 '25 08:05 thegobot

May I ask if you wrote the code using MSE ?

Stefanxx avatar May 06 '25 09:05 Stefanxx

No, I didn't write any additional code. I just want to stop the stream loading, but not clear the video element (I need the last frame to be visible)

thegobot avatar May 07 '25 03:05 thegobot

`public unload(): void { this._media_element?.pause();

    this._live_latency_synchronizer?.destroy();
    this._live_latency_synchronizer = null;

    this._live_latency_chaser?.destroy();
    this._live_latency_chaser = null;

    this._startup_stall_jumper?.destroy();
    this._startup_stall_jumper = null;

    this._loading_controller?.destroy();
    this._loading_controller = null;

    this._seeking_handler?.destroy();
    this._seeking_handler = null;

    this._mse_controller?.flush();

    this._transmuxer?.close();
    this._transmuxer?.destroy();
    this._transmuxer = null;
}`

this._loading_controller has been set null here. so _onMSEUpdateEnd call error.

stark-jarvis avatar Sep 29 '25 09:09 stark-jarvis