Custom content request headers
The SDK provides an option to include customised request headers in DASH HTTP requests it sends for stream playback. This could be used to match CDN logs to playback activity.
The customHeaders object is provided in the Source Object for the App to indicate headers to be attached to the outbound requests to the CDN if required. Different headers can be set for each stream playback by passing key/value pairs when the Source Object is set to the player to start playback.
The customHeaders object is optional so omitting will ensure no additional headers are attached.
Example
To ensure the manifest and each stream segment’s GET requests are associated with a session id, use code as follows:
window.changeStreamClicked = function () {
var source = {
src: "https://livesim.dashif.org/livesim-chunked/testpic4_8s/Manifest.mpd",
type: "application/dash+xml",
customHeaders: {
"X-Session-ID": "your-session-id"
}
};
window.player.src(source);
};