Skip to content

Commit

Permalink
feat(FEC-10657): add max stale level reloads config (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored Jan 24, 2021
1 parent bb888b1 commit b26065f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
14 changes: 11 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,9 +1270,17 @@ var config = {
> > }
> > };
> > ```
##
> >
> > ##
> >
> > ### config.network.maxStaleLevelReloads
> >
> > ##### Type: `number`
> >
> > ##### Default: `20`
> >
> > ##### Description: The maximal amount of times player should request a manifest refresh, when no new segments appear in the refreshed manifest.
>
> ### config.customLabels
>
> ##### Type: `PKCustomLabelsConfigObject`
Expand Down
3 changes: 2 additions & 1 deletion flow-typed/types/network-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
declare type PKNetworkConfigObject = {
requestFilter?: Function,
responseFilter?: Function
responseFilter?: Function,
maxStaleLevelReloads: number
};
5 changes: 5 additions & 0 deletions src/error/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ const Code: CodeType = {
*/
RESPONSE_FILTER_ERROR: 1007,

/**
* Live manifest is refreshed more than a preconfigured amount of times without any new segment.
*/
LIVE_MANIFEST_REFRESH_ERROR: 1008,

/** The text parser failed to parse a text stream due to an invalid header. */
INVALID_TEXT_HEADER: 2000,

Expand Down
4 changes: 3 additions & 1 deletion src/player-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const DefaultConfig = {
drm: {
keySystem: ''
},
network: {}
network: {
maxStaleLevelReloads: 20
}
};

export {DefaultConfig};

0 comments on commit b26065f

Please sign in to comment.