Skip to content

Commit

Permalink
Add fragmentRequestTimeout JSDoc and type definition, and default to …
Browse files Browse the repository at this point in the history
…0 when NaN.
  • Loading branch information
robertbryer committed Oct 15, 2020
1 parent d206339 commit ebd003c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ declare namespace dashjs {
video?: number;
audio?: number;
};
fragmentRequestTimeout?: number;
retryIntervals?: {
'MPD'?: number;
'XLinkExpansion'?: number;
Expand Down
2 changes: 2 additions & 0 deletions src/core/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest';
* lastBitrateCachingInfo: { enabled: true, ttl: 360000 },
* lastMediaSettingsCachingInfo: { enabled: true, ttl: 360000 },
* cacheLoadThresholds: { video: 50, audio: 5 },
* fragmentRequestTimeout: 0,
* retryIntervals: {
* MPD: 500,
* XLinkExpansion: 500,
Expand Down Expand Up @@ -331,6 +332,7 @@ import {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest';
* @property {module:Settings~AudioVideoSettings} [cacheLoadThresholds={video: 50, audio: 5}]
* For a given media type, the threshold which defines if the response to a fragment
* request is coming from browser cache or not.
* @property {module:Settings~RequestTypeSettings} [fragmentRequestTimeout] Time in milliseconds before timing out on loading a media fragment. Fragments that timeout are retried as if they failed.
* @property {module:Settings~RequestTypeSettings} [retryIntervals] Time in milliseconds of which to reload a failed file load attempt. For low latency mode these values are divided by lowLatencyReductionFactor.
* @property {module:Settings~RequestTypeSettings} [retryAttempts] Total number of retry attempts that will occur on a file load before it fails. For low latency mode these values are multiplied by lowLatencyMultiplyFactor.
* @property {module:Settings~AbrSettings} abr Adaptive Bitrate algorithm related settings.
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/net/URLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function URLLoader(cfg) {
constants: cfg.constants ? cfg.constants : null,
dashConstants: cfg.dashConstants ? cfg.dashConstants : null,
urlUtils: cfg.urlUtils ? cfg.urlUtils : null,
requestTimeout: cfg.requestTimeout,
requestTimeout: !isNaN(cfg.requestTimeout) ? cfg.requestTimeout : 0,
errors: cfg.errors
});

Expand Down

0 comments on commit ebd003c

Please sign in to comment.