hls.js 1.5.7-0.canary.10014 → 1.5.7-0.canary.10016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hls.js +279 -162
- package/dist/hls.js.d.ts +13 -6
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +262 -129
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +203 -72
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +220 -105
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/abr-controller.ts +3 -0
- package/src/controller/audio-stream-controller.ts +26 -38
- package/src/controller/base-stream-controller.ts +5 -2
- package/src/controller/buffer-controller.ts +192 -56
- package/src/controller/buffer-operation-queue.ts +16 -19
- package/src/controller/fragment-tracker.ts +15 -11
- package/src/controller/stream-controller.ts +9 -0
- package/src/controller/subtitle-stream-controller.ts +1 -15
- package/src/hls.ts +7 -3
- package/src/utils/codecs.ts +1 -1
- package/src/utils/mp4-tools.ts +3 -1
@@ -418,15 +418,9 @@ export class SubtitleStreamController
|
|
418
418
|
config.maxBufferHole,
|
419
419
|
);
|
420
420
|
const { end: targetBufferTime, len: bufferLen } = bufferedInfo;
|
421
|
-
|
422
|
-
const mainBufferInfo = this.getFwdBufferInfo(
|
423
|
-
this.media,
|
424
|
-
PlaylistLevelType.MAIN,
|
425
|
-
);
|
426
421
|
const trackDetails = track.details as LevelDetails;
|
427
422
|
const maxBufLen =
|
428
|
-
this.
|
429
|
-
trackDetails.levelTargetDuration;
|
423
|
+
this.hls.maxBufferLength + trackDetails.levelTargetDuration;
|
430
424
|
|
431
425
|
if (bufferLen > maxBufLen) {
|
432
426
|
return;
|
@@ -482,14 +476,6 @@ export class SubtitleStreamController
|
|
482
476
|
}
|
483
477
|
}
|
484
478
|
|
485
|
-
protected getMaxBufferLength(mainBufferLength?: number): number {
|
486
|
-
const maxConfigBuffer = super.getMaxBufferLength();
|
487
|
-
if (!mainBufferLength) {
|
488
|
-
return maxConfigBuffer;
|
489
|
-
}
|
490
|
-
return Math.max(maxConfigBuffer, mainBufferLength);
|
491
|
-
}
|
492
|
-
|
493
479
|
protected loadFragment(
|
494
480
|
frag: Fragment,
|
495
481
|
level: Level,
|
package/src/hls.ts
CHANGED
@@ -171,8 +171,10 @@ export default class Hls implements HlsEventEmitter {
|
|
171
171
|
} = config;
|
172
172
|
const errorController = new ConfigErrorController(this);
|
173
173
|
const abrController = (this.abrController = new ConfigAbrController(this));
|
174
|
+
// FragmentTracker must be defined before StreamController because the order of event handling is important
|
175
|
+
const fragmentTracker = new FragmentTracker(this);
|
174
176
|
const bufferController = (this.bufferController =
|
175
|
-
new ConfigBufferController(this));
|
177
|
+
new ConfigBufferController(this, fragmentTracker));
|
176
178
|
const capLevelController = (this.capLevelController =
|
177
179
|
new ConfigCapLevelController(this));
|
178
180
|
|
@@ -189,8 +191,6 @@ export default class Hls implements HlsEventEmitter {
|
|
189
191
|
this,
|
190
192
|
contentSteering,
|
191
193
|
));
|
192
|
-
// FragmentTracker must be defined before StreamController because the order of event handling is important
|
193
|
-
const fragmentTracker = new FragmentTracker(this);
|
194
194
|
const keyLoader = new KeyLoader(this.config);
|
195
195
|
const streamController = (this.streamController = new StreamController(
|
196
196
|
this,
|
@@ -802,6 +802,10 @@ export default class Hls implements HlsEventEmitter {
|
|
802
802
|
return this.streamController.getMainFwdBufferInfo();
|
803
803
|
}
|
804
804
|
|
805
|
+
public get maxBufferLength(): number {
|
806
|
+
return this.streamController.maxBufferLength;
|
807
|
+
}
|
808
|
+
|
805
809
|
/**
|
806
810
|
* Find and select the best matching audio track, making a level switch when a Group change is necessary.
|
807
811
|
* Updates `hls.config.audioPreference`. Returns the selected track, or null when no matching track is found.
|
package/src/utils/codecs.ts
CHANGED
@@ -193,7 +193,7 @@ export function getCodecCompatibleName(
|
|
193
193
|
}
|
194
194
|
|
195
195
|
export function pickMostCompleteCodecName(
|
196
|
-
parsedCodec: string,
|
196
|
+
parsedCodec: string | undefined,
|
197
197
|
levelCodec: string | undefined,
|
198
198
|
): string | undefined {
|
199
199
|
// Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
|
package/src/utils/mp4-tools.ts
CHANGED
@@ -478,7 +478,9 @@ function parseStsd(stsd: Uint8Array): { codec: string; encrypted: boolean } {
|
|
478
478
|
|
479
479
|
function skipBERInteger(bytes: Uint8Array, i: number): number {
|
480
480
|
const limit = i + 5;
|
481
|
-
while (bytes[i++] & 0x80 && i < limit) {
|
481
|
+
while (bytes[i++] & 0x80 && i < limit) {
|
482
|
+
/* do nothing */
|
483
|
+
}
|
482
484
|
return i;
|
483
485
|
}
|
484
486
|
|