Asynchronous loading allows you to load our module asynchronously so that the initial module's size is as small as possible, in an attempt to minimize video startup time.
The load timing is configurable by three parameters (in decreasing order of priority):
loadAfterPlaybackStarted
fragmentsFetchedBeforeLoad
secondsPrebufferedBeforeLoad
Those are mutually exclusive:
-
if more than one parameter is defined at the same time, only the one with highest priority is taken into account,
-
if none of these configuration parameters are set, the module is loaded directly.
If asynchronous loading is required, the basic configuration loadAfterPlaybackStarted
should be used.fragmentsFetchedBeforeLoad
, secondsPrebufferedBeforeLoad
are more advanced and should be used for fine tuning only when the basic configuration is not enough.
All parameters are optional.
NAME |
TYPE |
DEFAULT |
DESCRIPTION |
---|---|---|---|
loadAfterPlaybackStarted |
Boolean |
False |
If true, the bundle is loaded right after the video visually starts to play. |
fragmentsFetchedBeforeLoad |
Number |
N/A |
Number of segments fetched after which we load the dna-client bundle. |
secondsPrebufferedBeforeLoad |
Number |
N/A |
Minimum number of seconds in buffer after which we load the dna-client bundle. |
Warning misconfiguring one of this parameters can severely impact Mesh performance and QoS.
Note fragmentFetchedBeforeLoad
ignores the init segment(s).
Examples
dnaConfig: {
"loadAfterPlaybackStarted": true
}
dnaConfig: {
"fragmentsFetchedBeforeLoad": 3
}
dnaConfig: {
"secondsPrebuffereddBeforeLoad": 6
}