CONNECT Player React Native SDK (Deprecated)

Statistics

This feature provides statistical information to the application, which can be used for debugging, server configuration etc. The information is provided using the event listener property onStatisticsUpdate and controlled using the configuration property statisticsTypes.

statisticsConfig

statisticsConfig is an object with members statisticsUpdateInterval and statisticsTypes.

  • statisticsUpdateInterval defines the interval between successive calls to onStatisticsUpdate (in milliseconds).

  • statisticsTypes defines the types of statistics to be included in the call to onStatisticsUpdate.

Statistics Type

Value


STATISTICS_TYPE.NONE

0

No statistics passed to onStatisticsUpdate

STATISTICS_TYPE.RENDERING

1

Enable rendering-related statistics:

  • framesPerSecondNominal

  • framesPerSecond

  • frameDrops

  • frameDropsPerSecond

STATISTICS_TYPE.NETWORK

2

Enable network-related statistics:

  • availableBitrates

  • selectedBitrate

  • bitrateSwitches

  • bitrateDowngrade

  • averageBitrate

  • averageVideoBitrate

  • averageAudioBitrate

  • bytesDownloaded

  • url

  • finalUrl

  • finalIPAddress

  • numberOfServerAddressChanges

  • downloadBitrate

  • downloadBitrateAverage

  • numberOfMediaRequests

  • transferDuration

  • downloadsOverdue

STATISTICS_TYPE.PLAYBACK

4

Enable playback related statistics:

  • streamBitrate

  • selectedResolution

  • availableResolutions

  • bufferedDuration

  • startUpTime

  • numberOfStalls

  • playbackType

  • playbackStartDate

  • playbackStartOffset

STATISTICS_TYPE.EVENT

8

Enable event-related statistics (not yet implemented)

STATISTICS_TYPE.DRM

16

Enable DRM-related statistics (not yet implemented)

STATISTICS_TYPE.ALL

~0

Enable all types of statistics

STATISTICS_TYPE is a bitmask. The different types can be combined using bitwise operations:

JavaScript
    statisticsConfig={{
        statisticsUpdateInterval: 2000, // Two seconds
        statisticsTypes: STATISTICS_TYPE.RENDERING | STATISTICS_TYPE.NETWORK
    }}

onStatisticsUpdate

onStatisticsUpdate is passed a single parameter: an object which will contain values for those statistics which have been enabled by statisticsConfig.statisticsTypes. Statistics not supported on the platform will be omitted from the object

statisticsConfig are not tracked for changes for a content playback request. Any changes to statisticsConfig will not take effect until the next time the source.url property changes.

Example

JavaScript
<OTVPlayer
    ref={otvplayerInstance}
    source={source}
    progressUpdateInterval={1}
    autoplay={true}
    statisticsConfig={{statisticsUpdateInterval: 1500, statisticsTypes: STATISTICS_TYPE.ALL}}
    onStatisticsUpdate={(stats) => {console.log("statistics: " + JSON.stringify(stats, null, 4));}}
    ...
    />