Constructor
new InternetSpeedTester()
Creates an instance of the InternetSpeedTester class.
Initializes the cache for the speed test result.
- Source:
Methods
resetCache()
Resets the cached speed test result.
This method clears the stored speed result, allowing for a fresh test the next time.
- Source:
(async) testSpeed(url) → {Promise.<string>}
Tests the internet speed by fetching a sample video file.
If the test has already been performed and the result is cached,
it returns the cached result to avoid making another request.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | The URL of the video file to fetch for testing speed. |
- Source:
Returns:
A promise that resolves to the quality of the video file to use.
The result can be either 'link_low' or 'link'.
- Type
- Promise.<string>