Skip to content

Commit

Permalink
Add examples for the ABR rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Jan 25, 2024
1 parent b2f58d7 commit eea1e4a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pages/advanced/abr/abandon-request-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,23 @@ if (remainingBytesToDownload > totalBytesForOptimalRepresentation) {
| `minThroughputSamplesThreshold` | Minimum throughput samples (equivalent to number of `progress` events) required before the `AbandonRequestRule` kicks in. |


## Example

```js
player.updateSettings({
streaming: {
abr: {
activeRules: {
abandonRequestsRule: {
active: true,
parameters: {
abandonDurationMultiplier: 1.8,
minSegmentDownloadTimeThresholdInMs: 500,
minThroughputSamplesThreshold: 6
}
}
}
}
}
});
```
4 changes: 4 additions & 0 deletions pages/advanced/abr/throughput-calculation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ grand_parent: Advanced Features

# Throughput Calculation

## Description
dash.js provides multiple options to configure the calculation of the current average throughput. This calculation is an
important input for most of the ABR rules e.g. the [ThroughputRule](throughput-rule.html).

## Configuration Options
The following options are available:

| Throughput Calculation Mode | Description |
Expand All @@ -25,6 +28,7 @@ The following options are available:
The default mode is `EWMA`. Most of the throughput calculation modes work on a fixed number of throughput samples.
The `settings.abr.throughput.sampleSettings` objects allows the configuration of sample related settings.

## Example
In the example below we change the default mode to byte size weighted harmonic mean. In addition, we change the number
of samples to be used to five and disable the automatic adjustment of the sample
size.
Expand Down
16 changes: 16 additions & 0 deletions pages/advanced/abr/throughput-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,19 @@ switchRequest.representation = abrController.getOptimalRepresentationForBitrate(
There are no values that are specifically targeting the rule. However, there are some throughput related parameters that
implicitly influence this rule as it is using `throughputController.getSafeAverageThroughput()`. The throughput related
parameters are documented [here](throughput-calculation.html).

## Example

```js
player.updateSettings({
streaming: {
abr: {
activeRules: {
throughputRule: {
active: true
}
}
}
}
});
```

0 comments on commit eea1e4a

Please sign in to comment.