hls.js 1.6.0-beta.1.0.canary.10748 → 1.6.0-beta.1.0.canary.10750

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/package.json CHANGED
@@ -130,5 +130,5 @@
130
130
  "url-toolkit": "2.2.5",
131
131
  "wrangler": "3.85.0"
132
132
  },
133
- "version": "1.6.0-beta.1.0.canary.10748"
133
+ "version": "1.6.0-beta.1.0.canary.10750"
134
134
  }
package/src/config.ts CHANGED
@@ -272,6 +272,7 @@ export type HlsConfig = {
272
272
  enableSoftwareAES: boolean;
273
273
  minAutoBitrate: number;
274
274
  ignoreDevicePixelRatio: boolean;
275
+ maxDevicePixelRatio: number;
275
276
  preferManagedMediaSource: boolean;
276
277
  timelineOffset?: number;
277
278
  loader: { new (confg: HlsConfig): Loader<LoaderContext> };
@@ -356,6 +357,7 @@ export const hlsDefaultConfig: HlsConfig = {
356
357
  capLevelOnFPSDrop: false, // used by fps-controller
357
358
  capLevelToPlayerSize: false, // used by cap-level-controller
358
359
  ignoreDevicePixelRatio: false, // used by cap-level-controller
360
+ maxDevicePixelRatio: Number.POSITIVE_INFINITY, // used by cap-level-controller
359
361
  preferManagedMediaSource: true,
360
362
  initialLiveManifestSize: 1, // used by stream-controller
361
363
  maxBufferLength: 30, // used by stream-controller
@@ -258,7 +258,7 @@ class CapLevelController implements ComponentAPI {
258
258
  }
259
259
  }
260
260
 
261
- return pixelRatio;
261
+ return Math.min(pixelRatio, this.hls.config.maxDevicePixelRatio);
262
262
  }
263
263
 
264
264
  private isLevelAllowed(level: Level): boolean {
@@ -1266,6 +1266,12 @@ class EMEController extends Logger implements ComponentAPI {
1266
1266
  .concat(
1267
1267
  media?.setMediaKeys(null)?.catch((error) => {
1268
1268
  this.log(`Could not clear media keys: ${error}`);
1269
+ this.hls?.trigger(Events.ERROR, {
1270
+ type: ErrorTypes.OTHER_ERROR,
1271
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,
1272
+ fatal: false,
1273
+ error: new Error(`Could not clear media keys: ${error}`),
1274
+ });
1269
1275
  }),
1270
1276
  ),
1271
1277
  )
@@ -1277,6 +1283,14 @@ class EMEController extends Logger implements ComponentAPI {
1277
1283
  })
1278
1284
  .catch((error) => {
1279
1285
  this.log(`Could not close sessions and clear media keys: ${error}`);
1286
+ this.hls?.trigger(Events.ERROR, {
1287
+ type: ErrorTypes.OTHER_ERROR,
1288
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
1289
+ fatal: false,
1290
+ error: new Error(
1291
+ `Could not close sessions and clear media keys: ${error}`,
1292
+ ),
1293
+ });
1280
1294
  });
1281
1295
  }
1282
1296
 
@@ -1348,12 +1362,24 @@ class EMEController extends Logger implements ComponentAPI {
1348
1362
  .remove()
1349
1363
  .catch((error) => {
1350
1364
  this.log(`Could not remove session: ${error}`);
1365
+ this.hls?.trigger(Events.ERROR, {
1366
+ type: ErrorTypes.OTHER_ERROR,
1367
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,
1368
+ fatal: false,
1369
+ error: new Error(`Could not remove session: ${error}`),
1370
+ });
1351
1371
  })
1352
1372
  .then(() => {
1353
1373
  return mediaKeysSession.close();
1354
1374
  })
1355
1375
  .catch((error) => {
1356
1376
  this.log(`Could not close session: ${error}`);
1377
+ this.hls?.trigger(Events.ERROR, {
1378
+ type: ErrorTypes.OTHER_ERROR,
1379
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
1380
+ fatal: false,
1381
+ error: new Error(`Could not close session: ${error}`),
1382
+ });
1357
1383
  });
1358
1384
  }
1359
1385
  }
package/src/errors.ts CHANGED
@@ -22,6 +22,9 @@ export enum ErrorDetails {
22
22
  KEY_SYSTEM_SESSION_UPDATE_FAILED = 'keySystemSessionUpdateFailed',
23
23
  KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED = 'keySystemStatusOutputRestricted',
24
24
  KEY_SYSTEM_STATUS_INTERNAL_ERROR = 'keySystemStatusInternalError',
25
+ KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR = 'keySystemDestroyMediaKeysError',
26
+ KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR = 'keySystemDestroyCloseSessionError',
27
+ KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR = 'keySystemDestroyRemoveSessionError',
25
28
  // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}
26
29
  MANIFEST_LOAD_ERROR = 'manifestLoadError',
27
30
  // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}