Skip to main content

Internet Speed Test

The Quickplay SDK enables speed measurement on a device, providing real-time progress and final results. It supports both suspending functions (Kotlin) and callback interfaces (Java). This information can also be reported to analytics and used to enhance playback strategies based on network conditions.

Measure Speed

Use the SpeedAnalyser class to measure the average download speed and DNS resolution time.

Test URLs are provided in the QualityURLSet class, which includes three URLs with varying quality levels:

AttributeDescription
lowThe URL intended for low-bandwidth or low-quality testing.
mediumThe URL intended for medium-bandwidth or medium-quality testing.
highThe URL intended for high-bandwidth or high-quality testing.
SpeedAnalyser.measureSpeed(
urls = QualityURLSet, // your set of test URLs
onProgress = { instantaneousMbps, elapsedMs ->
// Called with the instantaneous download speed in Mbps and elapsed time in ms
},
onComplete = { result: SpeedTestResult ->
// Called with test result on completion
},
onError = { error: Error ->
// Called on error
}
)

The SpeedTestResult object contains the following fields:

AttributeDescription
averageSpeedMbpsThe average download speed in Mbps
avgDNSResolutionTimeMsAverage DNS resolution time (ms)
timeTakenForTestMsTotal time taken (ms) to complete the speed test