Added in API level 31

Builder


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

A builder for PlaybackErrorEvent

Summary

Public constructors

Creates a new Builder.

Public methods
PlaybackErrorEvent

Builds the instance.

PlaybackErrorEvent.Builder
setErrorCode(value: Int)

Sets error code.

PlaybackErrorEvent.Builder

Sets the Exception object.

PlaybackErrorEvent.Builder
setMetricsBundle(metricsBundle: Bundle)

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

PlaybackErrorEvent.Builder

Sets sub error code.

PlaybackErrorEvent.Builder

Set the timestamp since creation in milliseconds.

Public constructors

Builder

Added in API level 31
Builder()

Creates a new Builder.

Public methods

build

Added in API level 31
fun build(): PlaybackErrorEvent

Builds the instance.

Return
PlaybackErrorEvent This value cannot be null.

setErrorCode

Added in API level 31
fun setErrorCode(value: Int): PlaybackErrorEvent.Builder

Sets error code.

Parameters
value Int: Value is android.media.metrics.PlaybackErrorEvent#ERROR_UNKNOWN, android.media.metrics.PlaybackErrorEvent#ERROR_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_RUNTIME, android.media.metrics.PlaybackErrorEvent#ERROR_IO_NETWORK_UNAVAILABLE, android.media.metrics.PlaybackErrorEvent#ERROR_IO_NETWORK_CONNECTION_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_IO_BAD_HTTP_STATUS, android.media.metrics.PlaybackErrorEvent#ERROR_IO_DNS_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_IO_CONNECTION_TIMEOUT, android.media.metrics.PlaybackErrorEvent#ERROR_IO_CONNECTION_CLOSED, android.media.metrics.PlaybackErrorEvent#ERROR_IO_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_PARSING_MANIFEST_MALFORMED, android.media.metrics.PlaybackErrorEvent#ERROR_PARSING_CONTAINER_MALFORMED, android.media.metrics.PlaybackErrorEvent#ERROR_PARSING_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_DECODER_INIT_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_DECODING_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_DECODING_FORMAT_EXCEEDS_CAPABILITIES, android.media.metrics.PlaybackErrorEvent#ERROR_DECODING_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_AUDIO_TRACK_INIT_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_AUDIO_TRACK_WRITE_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_AUDIO_TRACK_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_PLAYER_REMOTE, android.media.metrics.PlaybackErrorEvent#ERROR_PLAYER_BEHIND_LIVE_WINDOW, android.media.metrics.PlaybackErrorEvent#ERROR_PLAYER_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_SCHEME_UNSUPPORTED, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_PROVISIONING_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_LICENSE_ACQUISITION_FAILED, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_DISALLOWED_OPERATION, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_SYSTEM_ERROR, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_CONTENT_ERROR, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_DEVICE_REVOKED, android.media.metrics.PlaybackErrorEvent#ERROR_DRM_OTHER, android.media.metrics.PlaybackErrorEvent#ERROR_IO_FILE_NOT_FOUND, android.media.metrics.PlaybackErrorEvent#ERROR_IO_NO_PERMISSION, android.media.metrics.PlaybackErrorEvent#ERROR_PARSING_MANIFEST_UNSUPPORTED, android.media.metrics.PlaybackErrorEvent#ERROR_PARSING_CONTAINER_UNSUPPORTED, or android.media.metrics.PlaybackErrorEvent#ERROR_DECODING_FORMAT_UNSUPPORTED
Return
PlaybackErrorEvent.Builder This value cannot be null.

setException

Added in API level 31
fun setException(value: Exception): PlaybackErrorEvent.Builder

Sets the Exception object.

Parameters
value Exception: This value cannot be null.
Return
PlaybackErrorEvent.Builder This value cannot be null.

setMetricsBundle

Added in API level 31
fun setMetricsBundle(metricsBundle: Bundle): PlaybackErrorEvent.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
PlaybackErrorEvent.Builder This value cannot be null.

setSubErrorCode

Added in API level 31
fun setSubErrorCode(value: Int): PlaybackErrorEvent.Builder

Sets sub error code.

Parameters
value Int: Value is between Integer.MIN_VALUE and Integer.MAX_VALUE inclusive
Return
PlaybackErrorEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
fun setTimeSinceCreatedMillis(value: Long): PlaybackErrorEvent.Builder

Set the timestamp since creation in milliseconds.

Parameters
value Long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater
Return
PlaybackErrorEvent.Builder This value cannot be null.