@scarlett-player/embed 0.4.1 → 0.5.1

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.
@@ -33,7 +33,7 @@ function formatBitrate(bitrate) {
33
33
  }
34
34
  return `${bitrate} bps`;
35
35
  }
36
- function mapLevels(levels, currentLevel) {
36
+ function mapLevels(levels, _currentLevel) {
37
37
  return levels.map((level, index) => ({
38
38
  index,
39
39
  width: level.width || 0,
@@ -397,7 +397,9 @@ function createHLSPlugin(config) {
397
397
  const getRetryDelay = (retryCount) => {
398
398
  const baseDelay = mergedConfig.retryDelayMs ?? 1e3;
399
399
  const backoffFactor = mergedConfig.retryBackoffFactor ?? 2;
400
- return baseDelay * Math.pow(backoffFactor, retryCount);
400
+ const delay = baseDelay * Math.pow(backoffFactor, retryCount);
401
+ const jitter = delay * (0.7 + Math.random() * 0.3);
402
+ return jitter;
401
403
  };
402
404
  const emitFatalError = (error, retriesExhausted) => {
403
405
  const message = retriesExhausted ? `HLS error: ${error.details} (max retries exceeded)` : `HLS error: ${error.details}`;
@@ -2242,6 +2244,8 @@ const DEFAULT_STATE = {
2242
2244
  airplayActive: false,
2243
2245
  chromecastAvailable: false,
2244
2246
  chromecastActive: false,
2247
+ // Thumbnail Preview
2248
+ thumbnails: null,
2245
2249
  // UI State
2246
2250
  interacting: false,
2247
2251
  hovering: false,