-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional documentation (#4647)
- Loading branch information
Showing
6 changed files
with
213 additions
and
10 deletions.
There are no files selected for viewing
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,25 @@ | ||
--- | ||
layout: default | ||
title: Feature Overview | ||
--- | ||
|
||
# Feature Overview | ||
|
||
The work in dash.js is closely aligned with the work on | ||
the [DASH Interoperability Points](https://dashif.org/guidelines/iop-v5/) and | ||
the [DASH Live Simulator 2](https://github.com/Dash-Industry-Forum/livesim2) | ||
in [DASH-IF](https://www.svta.org/working-group/dash-if/). | ||
|
||
| IOP Documentation | dash.js | LiveSim 2 | | ||
|---------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------| | ||
| [Live2VoD](http://dashif.org/DASH-IF-IOP/live2vod) | Basic support | Supported | | ||
| [L3D](http://dashif.org/DASH-IF-IOP/l3d) | Not supported | Not supported | | ||
| [Content Steering](http://dashif.org/DASH-IF-IOP/content-steering) | Supported but needs some updates to be compliant with version 1.0.0. See also [here](../usage/content-steering.html) | Not supported | | ||
| [MPD Patch](http://dashif.org/DASH-IF-IOP/mpd-patch) | Supported, see also [here](../usage/mpd-patching.html) | Supported | | ||
| [CMCD](http://dashif.org/DASH-IF-IOP/cmcd) | Version 1 is implemented, Version 2 is in progress. See also [here](../usage/cmcd.html) | Not supported | | ||
| [CMSD](https://docs.google.com/document/d/1CB1QJd_gz9km1lCr1HOdo1s_JZuACVtoy6yi6bE9Dfw/edit?usp=drive_link) | Implementation completed for two attributes `etp` and `mb` | Not supported | | ||
| [Variable Substitution / DASH Annex I](https://docs.google.com/document/d/1rFvEMFsqz6FZk4ldSFRpnnIfxRkgWE7q1pqvJMJcjD0/edit?usp=drive_link) | Basic support, no support for templating mechanism | Not supported | | ||
| [Server Guided Ad Insertion](https://docs.google.com/document/d/1JY6BXFj2YR9yNqqI6hyDq9_hc2BQ0E8LsDHhHhurWdw/edit?usp=sharing) | Not supported | Not supported | | ||
| DRM / CPIX | Supported | Supports on the fly encryption for different DRMs | | ||
| LC-EVC | Basic support | Not supported | | ||
|
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 was deleted.
Oops, something went wrong.
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,65 @@ | ||
--- | ||
layout: default | ||
title: Live Streaming | ||
parent: Usage | ||
--- | ||
|
||
# Live Streaming | ||
|
||
## Setting the live delay | ||
|
||
In addition to the [buffer settings](buffer-management.html) the live delay plays a significant role in live | ||
streaming. The live delay is the time difference between the live edge and the playback position. The live delay can be | ||
set by the application in two ways: by setting the `liveDelay` or by setting the `liveDelayFragmentCount`. | ||
|
||
The `liveDelay` is the time in seconds that the player should be behind the live edge. The `liveDelayFragmentCount` is | ||
the number of fragments that the | ||
player should be behind the live edge. The `liveDelay` has precedence over the `liveDelayFragmentCount`. | ||
|
||
The`useSuggestedPresentationDelay` is a boolean that indicates whether the player should use the suggested presentation | ||
delay from the MPD if defined. The suggested presentation delay is the time in seconds that the player should be behind | ||
the live | ||
edge. Explicit live delay settings by the appilication using the `liveDelay` and the `liveDelayFragmentCount` take | ||
precedence over the `useSuggestedPresentationDelay`. | ||
|
||
### Configuration Options | ||
|
||
````js | ||
player.updateSettings({ | ||
streaming: { | ||
delay: { | ||
liveDelayFragmentCount: NaN, | ||
liveDelay: NaN, | ||
useSuggestedPresentationDelay: true | ||
} | ||
}, | ||
}) | ||
```` | ||
|
||
### Examples | ||
|
||
Multiple examples demonstrating the live delay settings can be found in | ||
the [live section](https://reference.dashif.org/dash.js/nightly/samples/index.html#Live) of the dash.js sample page. | ||
|
||
## Synchronizing multiple players | ||
|
||
In some scenarios it makes sense to synchronize multiple players. This can be achieved by defining the same live delay | ||
for all instances and enabling catchup mode. In the example configuration below the live delay is set to 10 seconds and | ||
the live catchup mode is enabled. As a result both player instances will play roughly at the same position. | ||
|
||
````js | ||
player.updateSettings({ | ||
streaming: { | ||
delay: { | ||
liveDelay: 10 | ||
}, | ||
liveCatchup: { | ||
enabled: true | ||
} | ||
}, | ||
}) | ||
```` | ||
|
||
An example illustrating how to synchronize multiple players is available in | ||
the [live section](https://reference.dashif.org/dash.js/nightly/samples/live-streaming/synchronized-live-playback.html) | ||
of the dash.js sample page. |
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,64 @@ | ||
--- | ||
layout: default | ||
title: Network Interceptor | ||
parent: Usage | ||
--- | ||
|
||
# Network Interceptor | ||
|
||
In some cases it might be necessary to modify the outgoing network requests or the incoming network response data. For | ||
that | ||
reason, dash.js provides a network interceptor API that allows applications to intercept and modify network requests and | ||
responses. | ||
|
||
## Intercepting network requests | ||
|
||
To intercept network requests, the application must register a callback function that will be called before or after the | ||
request is sent. The callback function must return a promise that resolves to the modified request object. The following | ||
example demonstrates how to intercept network requests: | ||
|
||
````js | ||
public init(): void { | ||
this.player = dashjs.MediaPlayer().create() | ||
this.player.initialize(document.querySelector('video') as HTMLMediaElement, this.mpd, true) | ||
|
||
/* Add request plugin to override request url for video segment requests only */ | ||
this.addRequestInterceptor() | ||
|
||
/* Add response plugin to add response header */ | ||
this.addResponseInterceptor() | ||
|
||
window.player = this.player | ||
} | ||
|
||
private addRequestInterceptor() { | ||
if (!this.player) { | ||
return | ||
} | ||
const interceptor: RequestInterceptor = (request: CommonMediaRequest) => { | ||
if (request.cmcd?.ot === CmcdObjectType.VIDEO) { | ||
request.url += (request.url.includes('?') ? '&' : '?') + 'request-interceptor=true' | ||
console.log(request.url) | ||
} | ||
return Promise.resolve(request) | ||
} | ||
this.player.addRequestInterceptor(interceptor) | ||
} | ||
|
||
private addResponseInterceptor() { | ||
if (!this.player) { | ||
return | ||
} | ||
const interceptor: ResponseInterceptor = (response: CommonMediaResponse) => { | ||
if (!response.headers) { | ||
response.headers = {} | ||
} | ||
response.headers['response-interceptor'] = 'true' | ||
return Promise.resolve(response) | ||
} | ||
this.player.addResponseInterceptor(interceptor) | ||
} | ||
} | ||
```` | ||
|
||
A fully working example can be found in our [sample section](https://reference.dashif.org/dash.js/nightly/samples/advanced/network-interceptor.html). |
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