The Upload/Download rule API setters allow you to customize the activation of CDN Mesh Delivery upload and download, either based on network type or your own custom logic.
Note |
dnaDownloadAllowed and dnaUploadAllowed
They start with the value true and can be changed during the user's session.
If set to false, users won't download or upload on the CDN Mesh Delivery network.
These setters do not depend on the network type and will always be applied.
dnaDownloadOnCellularAllowed and dnaUploadOnCellularAllowed
They start with the value null but will switch to the values defined in the dashboard right after the client contacts Streamroot's backend.
If set to false, the user will not download or upload through Mesh Delivery when they are connected to a network with potential data limitation (Cellular and others*), they will download all of their video data through the CDN instead.
These setters take precedence over any rules defined in Streamroot Dashboard (in the property section).
dnaDownloadOnWifiEthernetAllowed and dnaUploadOnWifiEthernetAllowed
They start with the value null but will switch to the values defined in the dashboard right after the client contacts Streamroot's backend.
If set to false, the user will not download or upload through Mesh Delivery when they are connected to a network with no data limitation (Wi-Fi and Ethernet*), they will download all of their video data through the CDN instead.
These setters take precedence over any rules defined in Streamroot Dashboard (in the property section).
The diagram below gives you the detailed steps for the Upload use-case. The same can be applied for Download.
Example
To get the dnaDownload
status
get() = dnaContext?.dnaBehaviourService?.dnaDownload ?: false
To set the dnaDownload
to false
set(value) {
dnaContext?.dnaBehaviourService?.dnaDownload = false
}
* To learn more about the different network types, please refer to our documentation on the Download and Upload rules.