From 8933b9873b240886fc9c9b459cf07fcb3b7a8bb8 Mon Sep 17 00:00:00 2001 From: Christian Benincasa Date: Thu, 19 Mar 2026 11:24:20 -0400 Subject: [PATCH] chore: update hls.js to latest version --- pnpm-lock.yaml | 10 +++++----- server/src/services/scheduling/FillerPickerV2.ts | 2 ++ server/src/stream/StreamProgramCalculator.ts | 9 ++++++--- web/package.json | 2 +- web/src/hooks/useHls.ts | 1 + 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f49f9619..6807b830 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -616,8 +616,8 @@ importers: specifier: 'catalog:' version: 1.11.18 hls.js: - specifier: ^1.4.12 - version: 1.4.12 + specifier: ^1.6.15 + version: 1.6.15 immer: specifier: ^10.0.3 version: 10.0.3 @@ -6009,8 +6009,8 @@ packages: highlight.js@10.7.3: resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} - hls.js@1.4.12: - resolution: {integrity: sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA==} + hls.js@1.6.15: + resolution: {integrity: sha512-E3a5VwgXimGHwpRGV+WxRTKeSp2DW5DI5MWv34ulL3t5UNmyJWCQ1KmLEHbYzcfThfXG8amBL+fCYPneGHC4VA==} hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} @@ -15101,7 +15101,7 @@ snapshots: highlight.js@10.7.3: {} - hls.js@1.4.12: {} + hls.js@1.6.15: {} hoist-non-react-statics@3.3.2: dependencies: diff --git a/server/src/services/scheduling/FillerPickerV2.ts b/server/src/services/scheduling/FillerPickerV2.ts index effc838a..4a988da6 100644 --- a/server/src/services/scheduling/FillerPickerV2.ts +++ b/server/src/services/scheduling/FillerPickerV2.ts @@ -107,6 +107,7 @@ export class FillerPickerV2 implements IFillerPicker { fillerRepeatCooldownMs - timeSincePlayed; if (program.duration + timeUntilProgramCanPlay <= maxDuration) { minimumWait = Math.min(minimumWait, timeUntilProgramCanPlay); + this.logger.trace('New minimumWait: %d', minimumWait); } } else if (!pickedFiller) { // Need to see if we can even use this list. @@ -141,6 +142,7 @@ export class FillerPickerV2 implements IFillerPicker { minimumWait, program.duration + timeUntilListIsCandidate, ); + this.logger.trace('New minimumWait: %d', minimumWait); } // Cannot use this list because cooldown is in effect break; diff --git a/server/src/stream/StreamProgramCalculator.ts b/server/src/stream/StreamProgramCalculator.ts index 1aecd22e..5a6d2f66 100644 --- a/server/src/stream/StreamProgramCalculator.ts +++ b/server/src/stream/StreamProgramCalculator.ts @@ -126,7 +126,6 @@ export class StreamProgramCalculator { currentProgram.program.duration - currentProgram.timeElapsed; const endTimeMs = req.startTime + maxDuration; let streamDuration = maxDuration; - console.log(maxDuration); while (currentProgram.program.type === 'redirect') { redirectChannels.push(channelContext.uuid); @@ -236,6 +235,7 @@ export class StreamProgramCalculator { streamDuration, channelContext, ); + this.logger.trace('Got lineup item: %O', lineupItem); } await this.channelCache.recordPlayback( @@ -431,7 +431,7 @@ export class StreamProgramCalculator { timeElapsed = Math.round(timeElapsed); if (program.type === 'error') { - return { + const item = { type: 'error', // title: 'Error', error: program.error, @@ -440,7 +440,9 @@ export class StreamProgramCalculator { startOffset: 0, // beginningOffset, programBeginMs: program.programBeginMs, - }; + } satisfies StreamLineupItem; + this.logger.trace('Playing error stream: %O', item); + return item; } if (program.type === 'offline') { @@ -468,6 +470,7 @@ export class StreamProgramCalculator { fillerPrograms, streamDuration, ); + this.logger.trace('Got filler picker result: %O', randomResult); filler = randomResult.filler; fillerListId = randomResult.fillerListId; diff --git a/web/package.json b/web/package.json index f10ea714..61801e78 100644 --- a/web/package.json +++ b/web/package.json @@ -38,7 +38,7 @@ "color": "^5.0.0", "colorjs.io": "^0.5.2", "dayjs": "catalog:", - "hls.js": "^1.4.12", + "hls.js": "^1.6.15", "immer": "^10.0.3", "lodash-es": "catalog:", "material-react-table": "^3.2.1", diff --git a/web/src/hooks/useHls.ts b/web/src/hooks/useHls.ts index 308c327b..6c5f8c58 100644 --- a/web/src/hooks/useHls.ts +++ b/web/src/hooks/useHls.ts @@ -27,6 +27,7 @@ export const useHls = () => { 'http://localhost:5173', ); }, + debug: true, //import.meta.env.DEV, }); newHls.on(Hls.Events.MANIFEST_PARSED, function (_, data) {