hls.js 1.5.5-0.canary.9983 → 1.5.5-0.canary.9985
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 +90 -79
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +88 -77
- 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 +90 -79
- 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 +92 -81
- 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/base-playlist-controller.ts +13 -1
- package/src/controller/cmcd-controller.ts +2 -3
- package/src/controller/level-controller.ts +7 -1
- package/src/loader/playlist-loader.ts +4 -5
- package/src/utils/logger.ts +3 -2
package/package.json
CHANGED
@@ -192,7 +192,19 @@ export default class BasePlaylistController
|
|
192
192
|
details.targetduration * 1.5,
|
193
193
|
);
|
194
194
|
if (currentGoal > 0) {
|
195
|
-
if (
|
195
|
+
if (cdnAge > details.targetduration * 3) {
|
196
|
+
// Omit segment and part directives when the last response was more than 3 target durations ago,
|
197
|
+
this.log(
|
198
|
+
`Playlist last advanced ${lastAdvanced.toFixed(
|
199
|
+
2,
|
200
|
+
)}s ago. Omitting segment and part directives.`,
|
201
|
+
);
|
202
|
+
msn = undefined;
|
203
|
+
part = undefined;
|
204
|
+
} else if (
|
205
|
+
previousDetails?.tuneInGoal &&
|
206
|
+
cdnAge - details.partTarget > previousDetails.tuneInGoal
|
207
|
+
) {
|
196
208
|
// If we attempted to get the next or latest playlist update, but currentGoal increased,
|
197
209
|
// then we either can't catchup, or the "age" header cannot be trusted.
|
198
210
|
this.warn(
|
@@ -8,7 +8,6 @@ import { appendCmcdQuery } from '@svta/common-media-library/cmcd/appendCmcdQuery
|
|
8
8
|
import type { CmcdEncodeOptions } from '@svta/common-media-library/cmcd/CmcdEncodeOptions';
|
9
9
|
import { uuid } from '@svta/common-media-library/utils/uuid';
|
10
10
|
import { BufferHelper } from '../utils/buffer-helper';
|
11
|
-
import { logger } from '../utils/logger';
|
12
11
|
import type { ComponentAPI } from '../types/component-api';
|
13
12
|
import type { Fragment } from '../loader/fragment';
|
14
13
|
import type { BufferCreatedData, MediaAttachedData } from '../types/events';
|
@@ -201,7 +200,7 @@ export default class CMCDController implements ComponentAPI {
|
|
201
200
|
su: !this.initialized,
|
202
201
|
});
|
203
202
|
} catch (error) {
|
204
|
-
logger.warn('Could not generate manifest CMCD data.', error);
|
203
|
+
this.hls.logger.warn('Could not generate manifest CMCD data.', error);
|
205
204
|
}
|
206
205
|
};
|
207
206
|
|
@@ -237,7 +236,7 @@ export default class CMCDController implements ComponentAPI {
|
|
237
236
|
|
238
237
|
this.apply(context, data);
|
239
238
|
} catch (error) {
|
240
|
-
logger.warn('Could not generate segment CMCD data.', error);
|
239
|
+
this.hls.logger.warn('Could not generate segment CMCD data.', error);
|
241
240
|
}
|
242
241
|
};
|
243
242
|
|
@@ -556,7 +556,13 @@ export default class LevelController extends BasePlaylistController {
|
|
556
556
|
if (curLevel.fragmentError === 0) {
|
557
557
|
curLevel.loadError = 0;
|
558
558
|
}
|
559
|
-
|
559
|
+
// Ignore matching details populated by loading a Media Playlist directly
|
560
|
+
let previousDetails = curLevel.details;
|
561
|
+
if (previousDetails === data.details && previousDetails.advanced) {
|
562
|
+
previousDetails = undefined;
|
563
|
+
}
|
564
|
+
|
565
|
+
this.playlistLoaded(level, data, previousDetails);
|
560
566
|
} else if (data.deliveryDirectives?.skip) {
|
561
567
|
// received a delta playlist update that cannot be merged
|
562
568
|
details.deltaUpdateFailed = true;
|
@@ -8,7 +8,6 @@
|
|
8
8
|
|
9
9
|
import { Events } from '../events';
|
10
10
|
import { ErrorDetails, ErrorTypes } from '../errors';
|
11
|
-
import { logger } from '../utils/logger';
|
12
11
|
import M3U8Parser from './m3u8-parser';
|
13
12
|
import type { LevelParsed, VariableMap } from '../types/level';
|
14
13
|
import type {
|
@@ -221,10 +220,10 @@ class PlaylistLoader implements NetworkComponentAPI {
|
|
221
220
|
loaderContext.level === context.level
|
222
221
|
) {
|
223
222
|
// same URL can't overlap
|
224
|
-
logger.trace('[playlist-loader]: playlist request ongoing');
|
223
|
+
this.hls.logger.trace('[playlist-loader]: playlist request ongoing');
|
225
224
|
return;
|
226
225
|
}
|
227
|
-
logger.log(
|
226
|
+
this.hls.logger.log(
|
228
227
|
`[playlist-loader]: aborting previous loader for type: ${context.type}`,
|
229
228
|
);
|
230
229
|
loader.abort();
|
@@ -408,7 +407,7 @@ class PlaylistLoader implements NetworkComponentAPI {
|
|
408
407
|
levels[0].audioCodec &&
|
409
408
|
!levels[0].attrs.AUDIO
|
410
409
|
) {
|
411
|
-
logger.log(
|
410
|
+
this.hls.logger.log(
|
412
411
|
'[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one',
|
413
412
|
);
|
414
413
|
audioTracks.unshift({
|
@@ -555,7 +554,7 @@ class PlaylistLoader implements NetworkComponentAPI {
|
|
555
554
|
message += ` id: ${context.id} group-id: "${context.groupId}"`;
|
556
555
|
}
|
557
556
|
const error = new Error(message);
|
558
|
-
logger.warn(`[playlist-loader]: ${message}`);
|
557
|
+
this.hls.logger.warn(`[playlist-loader]: ${message}`);
|
559
558
|
let details = ErrorDetails.UNKNOWN;
|
560
559
|
let fatal = false;
|
561
560
|
|
package/src/utils/logger.ts
CHANGED
@@ -71,7 +71,7 @@ function getLoggerFn(
|
|
71
71
|
: consolePrintFn(key, id);
|
72
72
|
}
|
73
73
|
|
74
|
-
|
74
|
+
const exportedLogger: ILogger = createLogger();
|
75
75
|
|
76
76
|
export function enableLogs(
|
77
77
|
debugConfig: boolean | ILogger,
|
@@ -107,7 +107,8 @@ export function enableLogs(
|
|
107
107
|
return createLogger();
|
108
108
|
}
|
109
109
|
}
|
110
|
-
|
110
|
+
// global exported logger uses the log methods from last call to `enableLogs`
|
111
|
+
Object.assign(exportedLogger, newLogger);
|
111
112
|
return newLogger;
|
112
113
|
}
|
113
114
|
|