| ... | ... | @@ -38,7 +38,7 @@ The default timing source in dash.js uses the following schemeIdUri/value combin |
|
|
|
By default, dash.js performs a clock synchronization at playback start and after each MPD update.
|
|
|
|
|
|
|
|
#### Synchronization at startup
|
|
|
|
At playback start an initial request to the timing server is issued. The offset between the client and the server clock is calculated as described in Section _Offset calculation_.
|
|
|
|
At playback start an initial request to the timing server is issued. The offset between the client and the server clock is calculated as described in the Section _Offset calculation_.
|
|
|
|
|
|
|
|
In addition, dash.js performs a predefined number of background requests to verify the initially calculated offset. The number of background attempts can be adjusted in the settings:
|
|
|
|
|
| ... | ... | @@ -73,7 +73,7 @@ An MPD update triggers an event to attempt a clock synchronization. The `TimeSyn |
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
`_shouldPerformSynchronization()` compares the current wallclock time against the time of the last sync attempt. If the difference is larger than `timeBetweenSyncAttempts` a synchronization request is issued.
|
|
|
|
`_shouldPerformSynchronization()` compares the current wallclock time against the time of the last sync attempt. If the difference is larger than `timeBetweenSyncAttempts` a synchronization request is issued. Otherwise playback continues without a clock sync.
|
|
|
|
|
|
|
|
The initial time between the sync attempts can be configured the following way:
|
|
|
|
|
| ... | ... | @@ -87,7 +87,7 @@ player.updateSettings({ |
|
|
|
})
|
|
|
|
```
|
|
|
|
#### Post-synchronization parameter adjustment
|
|
|
|
After each regular synchronization attempt dash.js adjusts the `timeBetweenSyncAttempts` parameter based on certain criteria:
|
|
|
|
After each regular synchronization attempt, dash.js adjusts the `timeBetweenSyncAttempts` parameter based on certain criteria:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
function _adjustTimeBetweenSyncAttempts(offset) {
|
| ... | ... | @@ -137,7 +137,7 @@ In the first step the player checks if the offset is within certain boundaries: |
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Depending on whether the offset is included in the calculated boundaries `timeBetweenSyncAttempts` is either multiplied or divided by `timeBetweenSyncAttemptsAdjustmentFactor`. By assigning specific values to `maximumTimeBetweenSyncAttempts` and `minimumTimeBetweenSyncAttempts` upper and lower bounds for `timeBetweenSyncAttempts`.
|
|
|
|
Depending on whether the offset is included in the calculated boundaries, `timeBetweenSyncAttempts` is either multiplied or divided by `timeBetweenSyncAttemptsAdjustmentFactor`. By assigning specific values to `maximumTimeBetweenSyncAttempts` and `minimumTimeBetweenSyncAttempts` upper and lower bounds for `timeBetweenSyncAttempts` can be set.
|
|
|
|
|
|
|
|
The parameters can be adjusted in the settings:
|
|
|
|
```javascript
|
| ... | ... | @@ -156,7 +156,7 @@ player.updateSettings({ |
|
|
|
|
|
|
|
|
|
|
|
### Synchronization after download errors
|
|
|
|
In addition to regular synchronization attempts dash.js triggers a background synchronization in case requests to media segments result in errors (e.g 404 errors). This is to make sure that the client clock is still synchronized and the request error is not caused by an erroneous offset.
|
|
|
|
In addition to regular synchronization attempts, dash.js triggers a background synchronization in case requests to media segments result in errors (e.g 404 errors). This is to make sure that the client clock is still synchronized and the request error is not caused by an erroneous offset.
|
|
|
|
|
|
|
|
This feature can be enabled/disabled by adjusting the settings:
|
|
|
|
```javascript
|
| ... | ... | @@ -181,7 +181,7 @@ The offset between two consecutive synchronization requests is calculated by acc |
|
|
|
|
|
|
|
### Configuration example
|
|
|
|
|
|
|
|
The available configuration paramaters:
|
|
|
|
The available configuration parameters:
|
|
|
|
|
|
|
|
| Parameter | Description |
|
|
|
|
| ------------- |:-------------:|
|
| ... | ... | |
| ... | ... | |