MKPCdnOptions

class MKPCdnOptions: MKConfiguration

CDN Token authentication helps to protect CDN streams from being snitched. This feature allows users to enter a secret token key during setting up a CDN resource.

This configuration applies only to MK Streams.

For example:


val cdnTokens = mapOf("cdntoken" to "239d67703a9b8fd18199d539a13c1ca2", "token" to "339d67703a9b8fd18199d539a13c1ca3")
//OR
val cdnTokens = HashMap()
cdnTokens.put("cdntoken", "239d67703a9b8fd18199d539a13c1ca2")
cdnTokens.put("token", "339d67703a9b8fd18199d539a13c1ca3")
val cdnOptions = MKPCdnOptions(cdnTokens)
//OR
val cdnOptions = MKPCdnOptions(cdnTokens, 10 /*cdn Failover Percent*/)
 val sourceConfiguration = MKPSourceConfiguration(sourceConfig, cdnOptions = cdnOptions)
 mkplayer.load(sourceConfiguration)

Fields

Name Description
var cdnTokens: Map<String, String>?

holds key value pair and would be appended with the url

var cdnFailoverPercent: Int

CDN failover percentage range between 0..100. Default failover percent is 0. This percentage would be used when more than 1 cdn's are available. A value of 0 would result in all traffic going to the first item in the CDN list. A value of 100 would result in all traffic going to the 2nd item in the CDN list. Any other value will be compared with random number generated and select item in the CDN list. Currently applies to MK Streams.

Constructors

<init>

constructor(cdnTokens: Map<String, String>?, cdnFailoverPercent: Int)

CDN Token authentication helps to protect CDN streams from being snitched. This feature allows users to enter a secret token key during setting up a CDN resource.

This configuration applies only to MK Streams.

For example:


val cdnTokens = mapOf("cdntoken" to "239d67703a9b8fd18199d539a13c1ca2", "token" to "339d67703a9b8fd18199d539a13c1ca3")
//OR
val cdnTokens = HashMap()
cdnTokens.put("cdntoken", "239d67703a9b8fd18199d539a13c1ca2")
cdnTokens.put("token", "339d67703a9b8fd18199d539a13c1ca3")
val cdnOptions = MKPCdnOptions(cdnTokens)
//OR
val cdnOptions = MKPCdnOptions(cdnTokens, 10 /*cdn Failover Percent*/)
 val sourceConfiguration = MKPSourceConfiguration(sourceConfig, cdnOptions = cdnOptions)
 mkplayer.load(sourceConfiguration)

Parameters

Name Description
cdnTokens: Map<String, String>?

holds key value pair and would be appended with the url

cdnFailoverPercent: Int

CDN failover percentage range between 0..100. Default failover percent is 0. This percentage would be used when more than 1 cdn's are available. A value of 0 would result in all traffic going to the first item in the CDN list. A value of 100 would result in all traffic going to the 2nd item in the CDN list. Any other value will be compared with random number generated and select item in the CDN list. Currently applies to MK Streams.