Custom content request headers
The SDK provides an option to include customized request headers in the streaming HTTP requests it sends for stream playback. This can be used to match CDN logs to playback activity.
On Android, this functionality is utilized via the SDK 5 Advanced Player Configuration: OTVPlayerConfiguration.setDefaultRequestProperties(Map<String, String> requestProperties).
This method sets custom headers to be attached to outbound requests to the CDN, if required. Different headers can be set for each stream playback by passing key/value pairs when the player configuration is applied to the player—before setting the video source.
The defaultRequestProperties object is optional; omitting it ensures no additional headers are attached.
Example
For the options of customer HTTP headers, configure the OTVPlayerConfiguration as below (Kotlin):
val playerConfig: OTVPlayerConfiguration = OTVPlayerConfiguration.Builder()
.setDefaultRequestProperties(mapOf("customHeader" to "headerValue"))
.build()
otvVideoView.playerConfiguration = playerConfig
otvVideoView.setVideoPath(stream_url)