Builder
class Builder
kotlin.Any | |
↳ | android.media.metrics.PlaybackMetrics.Builder |
A builder for PlaybackMetrics
Summary
Public constructors | |
---|---|
Builder() Creates a new Builder. |
Public methods | |
---|---|
PlaybackMetrics.Builder |
addExperimentId(value: Long) Adds the experiment ID. |
PlaybackMetrics |
build() Builds the instance. |
PlaybackMetrics.Builder |
setAudioUnderrunCount(value: Int) Sets the audio underrun count. |
PlaybackMetrics.Builder |
setContentType(value: Int) Sets the content type. |
PlaybackMetrics.Builder |
setDrmSessionId(drmSessionId: ByteArray) Sets DRM session ID. |
PlaybackMetrics.Builder |
setDrmType(value: Int) Sets the DRM type. |
PlaybackMetrics.Builder |
setLocalBytesRead(value: Long) Sets the number of local bytes read. |
PlaybackMetrics.Builder |
setMediaDurationMillis(value: Long) Sets the media duration in milliseconds. |
PlaybackMetrics.Builder |
setMetricsBundle(metricsBundle: Bundle) Sets metrics-related information that is not supported by dedicated methods. |
PlaybackMetrics.Builder |
setNetworkBytesRead(value: Long) Sets the number of network bytes read. |
PlaybackMetrics.Builder |
setNetworkTransferDurationMillis(value: Long) Sets the network transfer duration in milliseconds. |
PlaybackMetrics.Builder |
setPlaybackType(value: Int) Sets the playback type. |
PlaybackMetrics.Builder |
setPlayerName(value: String) Sets the player name. |
PlaybackMetrics.Builder |
setPlayerVersion(value: String) Sets the player version. |
PlaybackMetrics.Builder |
setStreamSource(value: Int) Sets the stream source type. |
PlaybackMetrics.Builder |
setStreamType(value: Int) Sets the stream type. |
PlaybackMetrics.Builder |
setVideoFramesDropped(value: Int) Sets the video frames dropped. |
PlaybackMetrics.Builder |
setVideoFramesPlayed(value: Int) Sets the video frames played. |
Public constructors
Public methods
addExperimentId
fun addExperimentId(value: Long): PlaybackMetrics.Builder
Adds the experiment ID.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
build
fun build(): PlaybackMetrics
Builds the instance. This builder should not be touched after calling this!
Return | |
---|---|
PlaybackMetrics |
This value cannot be null . |
setAudioUnderrunCount
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 . |
setContentType
fun setContentType(value: Int): PlaybackMetrics.Builder
Sets the content type.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
setDrmSessionId
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 . |
setDrmType
fun setDrmType(value: Int): PlaybackMetrics.Builder
Sets the DRM type.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
setLocalBytesRead
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
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 . |
See Also
setMetricsBundle
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
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
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 . |
See Also
setPlaybackType
fun setPlaybackType(value: Int): PlaybackMetrics.Builder
Sets the playback type.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
setPlayerName
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
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 . |
setStreamSource
fun setStreamSource(value: Int): PlaybackMetrics.Builder
Sets the stream source type.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
setStreamType
fun setStreamType(value: Int): PlaybackMetrics.Builder
Sets the stream type.
Return | |
---|---|
PlaybackMetrics.Builder |
This value cannot be null . |
setVideoFramesDropped
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
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 . |