Skip to content

Commit

Permalink
Improve bandwidth estimation and adaptive switching with smaller segm…
Browse files Browse the repository at this point in the history
…ents and higher TTFB

Fixes #3578 (special thanks to @Oleksandr0xB for submitting #4283)
Fixes #3563 and Closes #3595 (special thanks to @kanongil)
  • Loading branch information
robwalch committed Aug 4, 2022
1 parent 8f1384e commit bb5b3e7
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 153 deletions.
13 changes: 13 additions & 0 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ export interface BufferFlushingData {
type: SourceBufferName | null;
}

// Warning: (ae-missing-release-tag) "BufferInfo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type BufferInfo = {
len: number;
start: number;
end: number;
nextStart?: number;
};

// Warning: (ae-missing-release-tag) "CapLevelControllerConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down Expand Up @@ -922,6 +932,8 @@ class Hls implements HlsEventEmitter {
get lowLatencyMode(): boolean;
// Warning: (ae-setter-with-docs) The doc comment for the property "lowLatencyMode" must appear on the getter, not the setter.
set lowLatencyMode(mode: boolean);
// (undocumented)
get mainForwardBufferInfo(): BufferInfo | null;
get manualLevel(): number;
get maxAutoLevel(): number;
get maxLatency(): number;
Expand Down Expand Up @@ -965,6 +977,7 @@ class Hls implements HlsEventEmitter {
get targetLatency(): number | null;
// (undocumented)
trigger<E extends keyof HlsListeners>(event: E, eventObject: Parameters<HlsListeners[E]>[1]): boolean;
get ttfbEstimate(): number;
// (undocumented)
readonly userConfig: Partial<HlsConfig>;
// (undocumented)
Expand Down
1 change: 1 addition & 0 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ function checkBuffer() {
log += `Dropped frames: ${video.webkitDroppedFrameCount}\n`;
}
}
log += `TTFB Estimate: ${hls.ttfbEstimate.toFixed(3)}\n`;
log += `Bandwidth Estimate: ${hls.bandwidthEstimate.toFixed(3)}\n`;
if (events.isLive) {
log +=
Expand Down
Loading

0 comments on commit bb5b3e7

Please sign in to comment.