new NetworkStatistics()
Methods
-
addNetworkListener(networkStatisticsListener)
-
Add a listener for network statistics events to listener list
Name Type Description networkStatisticsListener
Object Name Type Description availableBitratesChanged
callback fired on possible change of available bitrates
selectedBitrateChanged
callback fired on change of selected bitrate
urlChanged
callback fired on each different file downloaded
errorChanged
callback fired on HTTP error
httpProcessingEnded
callback fired on file downloaded passing the following download information { startTime, endTime, duration, url, mimeType }
-
getAdaptiveStreaming(){NetworkStatistics~adaptiveStreamingObject}
-
Provides information on the available bitrates, and the bitrate selected for download
Returns:
Type Description NetworkStatistics~adaptiveStreamingObject -
getContentServer(){NetworkStatistics~contentServerObject}
-
Provides information about the content server
Returns:
Type Description NetworkStatistics~contentServerObject -
getNetworkUsage(){NetworkStatistics~networkUsageObject}
-
Provides information about the amount and rates of downloads
Returns:
Type Description NetworkStatistics~networkUsageObject -
removeNetworkListener(networkStatisticsListener)
-
Remove the listener for network statistics events from listener list
Name Type Description networkStatisticsListener
Object -
reset()
-
Resets the network statistics
-
setNetworkListener(networkStatisticsListener)
-
Sets listeners for network statistics events
Name Type Description networkStatisticsListener
Object Name Type Description availableBitratesChanged
callback fired on possible change of available bitrates
selectedBitrateChanged
callback fired on change of selected bitrate
urlChanged
callback fired on each different file downloaded
errorChanged
callback fired on HTTP error
httpProcessingEnded
callback fired on file downloaded passing the following download information { startTime, endTime, duration, url, mimeType }
Type Definitions
-
adaptiveStreamingObjectObject
-
An object which defines the adaptiveStreaming statistics
Properties:
Name Type Description selectedBitrate
number bitrate currently selected for download
availableBitrates
Array.<number> the bitrates available for download
-
contentServerObjectObject
-
An object describing the content server
Properties:
Name Type Description url
string Provides the URL of the downloaded file. The exact file (manifest or fragment) will depend on the type of content.
-
networkUsageObject
-
An object which defines the NetworkUsage statistics
Properties:
Name Type Description bytesDownloaded
number total bytes downloaded (video + audio)
downloadBitrate
number bits/s for last video segment downloaded
downloadBitrateAverage
number bits/s averaged over the last 5 video segments