-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add default config for worker
- Loading branch information
Dzianis Dashkevich
committed
Oct 23, 2024
1 parent
17553a8
commit 144895f
Showing
4 changed files
with
64 additions
and
66 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/playback/src/lib/configuration/configuration-defaults.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { | ||
NetworkConfiguration, | ||
PlayerConfiguration, | ||
PlayerNetworkConfiguration, | ||
} from '../types/configuration.declarations'; | ||
import { RequestType } from '../consts/request-type'; | ||
|
||
export const getNetworkConfigurationDefaults = (): NetworkConfiguration => ({ | ||
maxAttempts: 2, | ||
initialDelay: 2_000, | ||
delayFactor: 0.2, | ||
fuzzFactor: 0.2, | ||
timeout: 20_000, | ||
}); | ||
|
||
export const getPlayerNetworkConfigurationDefaults = (): PlayerNetworkConfiguration => ({ | ||
[RequestType.DashManifest]: getNetworkConfigurationDefaults(), | ||
[RequestType.HlsPlaylist]: getNetworkConfigurationDefaults(), | ||
[RequestType.License]: getNetworkConfigurationDefaults(), | ||
[RequestType.Key]: getNetworkConfigurationDefaults(), | ||
[RequestType.InitSegment]: getNetworkConfigurationDefaults(), | ||
[RequestType.MediaSegment]: getNetworkConfigurationDefaults(), | ||
}); | ||
|
||
export const getPlayerConfigurationDefaults = (): PlayerConfiguration => ({ | ||
network: getPlayerNetworkConfigurationDefaults(), | ||
}); |
9 changes: 2 additions & 7 deletions
9
...es/playback/src/lib/configuration/configurationNodes/player-network-configuration-node.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters