Shaka Player configuration
What you learn​
You're instantiating DIVA Player and relying on DIVA Back Office as the video streaming source.
The goal of this article is to build the simplest front-end to stream a video from the DIVA Back Office, having the possibility to control and modify ShakaPlayer parameters dynamically and remotely.
Before starting​
- Ensure the DIVA Back Office instance you rely on is up and running.
- Ask your video engineers team
<videoId>
,<settingsURL>
,<languageCountryCode>
,<userToken>
and<sharedKey>
. - Ensure the settings file contains the
shakaConfigOverrides
andconfigId
fields.
Instantiation​
The Basic instantiation code is sufficient.
In the settings
file, the shakaConfigOverrides
section must contain the configuration, like in the example below.
Add the configId
field to the BO adapter settings to send the property to the Media Analytics.
Note: The
configId
field will be fired asdivaConfigId
:
- to Conviva as custom tag
- to Youbora NPAW as metadata
{
configId: '123',
"settings": {
"shaka" :{
// Applied before load
0: {
streaming:{
rebufferingGoal: 0.2
},
// Applied 1 second after playback started
1000: {
streaming:{
rebufferingGoal: 2
},
...
}
}
}
For a detailed list of configurable parameters, please refer to the official documentation page.
Currently, the Diva player accepts an array of number/object values, which is used to time the configurations. This object is flexible and allows the integrator to replicate Shaka's configurations without being strictly typed in the Diva player.
If parameters are configured that do not match those allowed by Shaka, Shaka itself will issue a warning to indicate the issue.
Default configuration​
If the shakaConfigOverrides
section is not present in the settings file, the default configuration will be used.
RW (Responsive Web) default config
{
// Applied before load
0: {
abr: {
useNetworkInformation: true,
switchInterval: 10,
defaultBandwidthEstimate: 600 * 8 * 1000,
},
cmcd: {
enabled: false,
},
cmsd: {
enabled: false,
},
drm: {
delayLicenseRequestUntilPlayed: true,
parseInbandPsshEnabled: false,
},
streaming: {
parsePrftBox: false,
stallEnabled: true,
bufferBehind: 4,
bufferingGoal: 4,
rebufferingGoal: 3,
allowMediaSourceRecoveries: true,
dispatchAllEmsgBoxes: false,
segmentPrefetchLimit: 6,
updateIntervalSeconds: 1,
liveSync: true,
observeQualityChanges: true,
retryParameters: {
maxAttempts: 3,
},
},
manifest: {
disableAudio: false,
disableThumbnails: true,
disableText: false,
dash: {
updatePeriod: 12,
ignoreSuggestedPresentationDelay: true,
disableXlinkProcessing: true,
ignoreMinBufferTime: true,
autoCorrectDrift: false,
},
retryParameters: {
maxAttempts: 1,
},
},
},
// Applied 1 second after playback started
1000: {
abr: {
switchInterval: 2,
},
manifest: {
dash: {
updatePeriod: 4,
},
},
streaming: {
bufferBehind: 6,
bufferingGoal: 8,
rebufferingGoal: 4,
segmentPrefetchLimit: 8,
updateIntervalSeconds: 0.5,
},
},
// Applied 6 second after playback started
6000: {
manifest: {
dash: {
autoCorrectDrift: true,
},
},
},
// Applied 7 second after playback started
7000: {
streaming: {
segmentPrefetchLimit: 10,
rebufferingGoal: 2,
},
},
// Applied 9 second after playback started
9000: {
streaming: {
bufferingGoal: 12,
segmentPrefetchLimit: 10,
},
},
}
WebTV default config
{
// Applied before load
0: {
abr: {
useNetworkInformation: true,
switchInterval: 10,
defaultBandwidthEstimate: 600 * 8 * 1000,
},
cmcd: {
enabled: false,
},
cmsd: {
enabled: false,
},
drm: {
delayLicenseRequestUntilPlayed: true,
parseInbandPsshEnabled: false,
},
streaming: {
parsePrftBox: false,
stallEnabled: true,
bufferBehind: 0,
bufferingGoal: 4,
rebufferingGoal: 0.2,
allowMediaSourceRecoveries: true,
dispatchAllEmsgBoxes: false,
segmentPrefetchLimit: 0,
updateIntervalSeconds: 1,
observeQualityChanges: true,
retryParameters: {
maxAttempts: 3,
},
},
manifest: {
disableAudio: false,
disableThumbnails: true,
disableText: false,
dash: {
updatePeriod: 12,
ignoreSuggestedPresentationDelay: true,
disableXlinkProcessing: true,
ignoreMinBufferTime: true,
autoCorrectDrift: false,
},
},
},
// Applied 1 second after playback started
1000: {
abr: {
switchInterval: 2,
},
manifest: {
dash: {
updatePeriod: 4,
},
},
streaming: {
bufferBehind: 5,
bufferingGoal: 8,
segmentPrefetchLimit: 0.1,
updateIntervalSeconds: 0.5,
},
},
// Applied 6 second after playback started
6000: {
manifest: {
dash: {
autoCorrectDrift: true,
},
},
},
// Applied 7 second after playback started
7000: {
streaming: {
segmentPrefetchLimit: 2,
rebufferingGoal: 2,
},
},
// Applied 9 second after playback started
9000: {
streaming: {
bufferingGoal: 12,
segmentPrefetchLimit: 4,
},
},
}