Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.media.metrics.PlaybackMetrics.Builder

A builder for PlaybackMetrics

Summary

Public constructors

Creates a new Builder.

Public methods
PlaybackMetrics.Builder

Adds the experiment ID.

PlaybackMetrics

Builds the instance.

PlaybackMetrics.Builder

Sets the audio underrun count.

PlaybackMetrics.Builder

Sets the content type.

PlaybackMetrics.Builder
setDrmSessionId(drmSessionId: ByteArray)

Sets DRM session ID.

PlaybackMetrics.Builder
setDrmType(value: Int)

Sets the DRM type.

PlaybackMetrics.Builder

Sets the number of local bytes read.

PlaybackMetrics.Builder

Sets the media duration in milliseconds.

PlaybackMetrics.Builder
setMetricsBundle(metricsBundle: Bundle)

Sets metrics-related information that is not supported by dedicated methods.

PlaybackMetrics.Builder

Sets the number of network bytes read.

PlaybackMetrics.Builder

Sets the network transfer duration in milliseconds.

PlaybackMetrics.Builder

Sets the playback type.

PlaybackMetrics.Builder

Sets the player name.

PlaybackMetrics.Builder

Sets the player version.

PlaybackMetrics.Builder

Sets the stream source type.

PlaybackMetrics.Builder

Sets the stream type.

PlaybackMetrics.Builder

Sets the video frames dropped.

PlaybackMetrics.Builder

Sets the video frames played.

Public constructors

Builder

Added in API level 31
Builder()

Creates a new Builder.

Public methods

addExperimentId

Added in API level 31
fun addExperimentId(value: Long): PlaybackMetrics.Builder

Adds the experiment ID.

Return
PlaybackMetrics.Builder This value cannot be null.

build

Added in API level 31
fun build(): PlaybackMetrics

Builds the instance. This builder should not be touched after calling this!

Return
PlaybackMetrics This value cannot be null.

setAudioUnderrunCount

Added in API level 31
fun setAudioUnderrunCount(value: Int): PlaybackMetrics.Builder

Sets the audio underrun count.

Parameters
value Int: the audio underrun count. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
PlaybackMetrics.Builder This value cannot be null.

setDrmSessionId

Added in API level 31
fun setDrmSessionId(drmSessionId: ByteArray): PlaybackMetrics.Builder

Sets DRM session ID.

Parameters
drmSessionId ByteArray: This value cannot be null.
Return
PlaybackMetrics.Builder This value cannot be null.

setLocalBytesRead

Added in API level 31
fun setLocalBytesRead(value: Long): PlaybackMetrics.Builder

Sets the number of local bytes read.

Parameters
value Long: the number of local bytes read. -1 indicates the value is unknown. Value is -1 or greater
Return
PlaybackMetrics.Builder This value cannot be null.

setMediaDurationMillis

Added in API level 31
fun setMediaDurationMillis(value: Long): PlaybackMetrics.Builder

Sets the media duration in milliseconds.

Parameters
value Long: the media duration in milliseconds. -1 indicates the value is unknown. Value is -1 or greater
Return
PlaybackMetrics.Builder This value cannot be null.

setMetricsBundle

Added in API level 31
fun setMetricsBundle(metricsBundle: Bundle): PlaybackMetrics.Builder

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.
Return
PlaybackMetrics.Builder This value cannot be null.

setNetworkBytesRead

Added in API level 31
fun setNetworkBytesRead(value: Long): PlaybackMetrics.Builder

Sets the number of network bytes read.

Parameters
value Long: the number of network bytes read. -1 indicates the value is unknown. Value is -1 or greater
Return
PlaybackMetrics.Builder This value cannot be null.

setNetworkTransferDurationMillis

Added in API level 31
fun setNetworkTransferDurationMillis(value: Long): PlaybackMetrics.Builder

Sets the network transfer duration in milliseconds.

Parameters
value Long: the network transfer duration in milliseconds. -1 indicates the value is unknown. Value is -1 or greater
Return
PlaybackMetrics.Builder This value cannot be null.

setPlayerName

Added in API level 31
fun setPlayerName(value: String): PlaybackMetrics.Builder

Sets the player name.

Parameters
value String: This value cannot be null.
Return
PlaybackMetrics.Builder This value cannot be null.

setPlayerVersion

Added in API level 31
fun setPlayerVersion(value: String): PlaybackMetrics.Builder

Sets the player version.

Parameters
value String: This value cannot be null.
Return
PlaybackMetrics.Builder This value cannot be null.

setVideoFramesDropped

Added in API level 31
fun setVideoFramesDropped(value: Int): PlaybackMetrics.Builder

Sets the video frames dropped.

Parameters
value Int: the video frames dropped. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
PlaybackMetrics.Builder This value cannot be null.

setVideoFramesPlayed

Added in API level 31
fun setVideoFramesPlayed(value: Int): PlaybackMetrics.Builder

Sets the video frames played.

Parameters
value Int: the video frames played. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
PlaybackMetrics.Builder This value cannot be null.