Home > hls.js > BaseStreamController > calculateOptimalSwitchPoint

BaseStreamController.calculateOptimalSwitchPoint() method

Calculate optimal switch point by considering fetch delays and buffer info to avoid causing playback interruption

Signature:

protected calculateOptimalSwitchPoint(nextLevel: Level, bufferInfo: BufferInfo): {
        fetchdelay: number;
        okToFlushForwardBuffer: boolean;
    };

Parameters

Parameter

Type

Description

nextLevel

Level

bufferInfo

BufferInfo

Returns:

{ fetchdelay: number; okToFlushForwardBuffer: boolean; }