You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Warning: (ae-missing-release-tag) "ErrorController" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Copy file name to clipboardExpand all lines: docs/API.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -362,7 +362,7 @@ It should not be used in response to non-fatal hls.js error events.
362
362
```js
363
363
let attemptedErrorRecovery =null;
364
364
365
-
video.addEventListener('error', (event) {
365
+
video.addEventListener('error', (event) =>{
366
366
constmediaError=event.currentTarget.error;
367
367
if (mediaError.code===mediaError.MEDIA_ERR_DECODE) {
368
368
constnow=Date.now();
@@ -380,11 +380,19 @@ hls.on(Hls.Events.ERROR, function (name, data) {
380
380
caseHls.ErrorTypes.MEDIA_ERROR: {
381
381
constnow=Date.now();
382
382
if (!attemptedErrorRecovery || now - attemptedErrorRecovery >5000) {
383
-
console.log('Fatal media error encountered ('+video.error++'), attempting to recover');
383
+
console.log(
384
+
'Fatal media error encountered ('+
385
+
video.error+
386
+
+'), attempting to recover',
387
+
);
384
388
attemptedErrorRecovery = now;
385
389
hls.recoverMediaError();
386
390
} else {
387
-
console.log('Skipping media error recovery (only '+ (now - attemptedErrorRecovery) +'ms since last error)');
391
+
console.log(
392
+
'Skipping media error recovery (only '+
393
+
(now - attemptedErrorRecovery) +
394
+
'ms since last error)',
395
+
);
388
396
}
389
397
break;
390
398
}
@@ -561,7 +569,9 @@ This configuration will be applied by default to all instances.
561
569
562
570
(default: `false`)
563
571
564
-
Setting `config.debug = true;` will turn on debug logs on JS console.
572
+
Setting `config.debug = true` enables JavaScript debug console logs. Debug mode also disables catching exceptions in even handler callbacks.
573
+
In debug mode, when an event listener throws, the exception is not caught. This allows uncaught exeptions to trigger the JavaScript debugger.
574
+
In production mode (`config.debug = false`), exceptions that are caught in event handlers are redispatched as errors with `type: OTHER_ERROR, details: INTERNAL_EXCEPTION, error: <caught exception>`.
565
575
566
576
A logger object could also be provided for custom logging: `config.debug = customLogger;`.
567
577
@@ -756,10 +766,10 @@ Decreasing this value will mean that each stall will have less affect on `hls.ta
756
766
757
767
(default: `Infinity`)
758
768
759
-
maximum delay allowed from edge of live, expressed in multiple of `EXT-X-TARGETDURATION`.
760
-
if set to 10, the player will seek back to `liveSyncDurationCount` whenever the next fragment to be loaded is older than N-10, N being the last fragment of the live playlist.
761
-
If set, this value must be stricly superior to `liveSyncDurationCount`
762
-
a value too close from `liveSyncDurationCount` is likely to cause playback stalls.
769
+
Maximum delay allowed from edge of live, expressed in multiple of `EXT-X-TARGETDURATION`.
770
+
If set to 10, the player will seek back to `liveSyncDurationCount` whenever the next fragment to be loaded is older than N-10, N being the last fragment of the live playlist.
771
+
If set, this value must be strictly superior to `liveSyncDurationCount`.
772
+
A value too close from `liveSyncDurationCount` is likely to cause playback stalls.
763
773
764
774
### `liveSyncDuration`
765
775
@@ -776,7 +786,7 @@ A value too low (inferior to ~3 segment durations) is likely to cause playback s
776
786
777
787
Alternative parameter to `liveMaxLatencyDurationCount`, expressed in seconds vs number of segments.
778
788
If defined in the configuration object, `liveMaxLatencyDuration` will take precedence over the default `liveMaxLatencyDurationCount`.
779
-
If set, this value must be stricly superior to `liveSyncDuration` which must be defined as well.
789
+
If set, this value must be strictly superior to `liveSyncDuration` which must be defined as well.
780
790
You can't define this parameter and either `liveSyncDurationCount` or `liveMaxLatencyDurationCount` in your configuration object at the same time.
781
791
A value too close from `liveSyncDuration` is likely to cause playback stalls.
0 commit comments