# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# PlaybackMetrics.Builder

`public static final class PlaybackMetrics.Builder`
`extends Object` ``

java.lang.Object
↳ | android.media.metrics.PlaybackMetrics.Builder

A builder for `PlaybackMetrics`

## Summary

### Public constructors
`Builder()` Creates a new Builder.

### Public methods
`PlaybackMetrics.Builder` | `addExperimentId(long value)` Adds the experiment ID.
`PlaybackMetrics` | `build()` Builds the instance.
`PlaybackMetrics.Builder` | `setAudioUnderrunCount(int value)` Sets the audio underrun count.
`PlaybackMetrics.Builder` | `setContentType(int value)` Sets the content type.
`PlaybackMetrics.Builder` | `setDrmSessionId(byte[] drmSessionId)` Sets DRM session ID.
`PlaybackMetrics.Builder` | `setDrmType(int value)` Sets the DRM type.
`PlaybackMetrics.Builder` | `setLocalBytesRead(long value)` Sets the number of local bytes read.
`PlaybackMetrics.Builder` | `setMediaDurationMillis(long value)` Sets the media duration in milliseconds.
`PlaybackMetrics.Builder` | `setMetricsBundle(Bundle metricsBundle)` Sets metrics-related information that is not supported by dedicated methods.
`PlaybackMetrics.Builder` | `setNetworkBytesRead(long value)` Sets the number of network bytes read.
`PlaybackMetrics.Builder` | `setNetworkTransferDurationMillis(long value)` Sets the network transfer duration in milliseconds.
`PlaybackMetrics.Builder` | `setPlaybackType(int value)` Sets the playback type.
`PlaybackMetrics.Builder` | `setPlayerName(String value)` Sets the player name.
`PlaybackMetrics.Builder` | `setPlayerVersion(String value)` Sets the player version.
`PlaybackMetrics.Builder` | `setStreamSource(int value)` Sets the stream source type.
`PlaybackMetrics.Builder` | `setStreamType(int value)` Sets the stream type.
`PlaybackMetrics.Builder` | `setVideoFramesDropped(int value)` Sets the video frames dropped.
`PlaybackMetrics.Builder` | `setVideoFramesPlayed(int value)` Sets the video frames played.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder ()

Creates a new Builder.

## Public methods

### addExperimentId

    public PlaybackMetrics.Builder addExperimentId (long value)

Adds the experiment ID.

Parameters
`value` | `long`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### build

    public PlaybackMetrics build ()

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

Returns
`PlaybackMetrics` | This value cannot be `null`.

### setAudioUnderrunCount

    public PlaybackMetrics.Builder setAudioUnderrunCount (int value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setContentType

    public PlaybackMetrics.Builder setContentType (int value)

Sets the content type.

Parameters
`value` | `int`: Value is `PlaybackMetrics.CONTENT_TYPE_UNKNOWN`, `PlaybackMetrics.CONTENT_TYPE_MAIN`, `PlaybackMetrics.CONTENT_TYPE_AD`, or `PlaybackMetrics.CONTENT_TYPE_OTHER`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setDrmSessionId

    public PlaybackMetrics.Builder setDrmSessionId (byte[] drmSessionId)

Sets DRM session ID.

Parameters
`drmSessionId` | `byte`: This value cannot be `null`.

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setDrmType

    public PlaybackMetrics.Builder setDrmType (int value)

Sets the DRM type.

Parameters
`value` | `int`: Value is `PlaybackMetrics.DRM_TYPE_NONE`, `PlaybackMetrics.DRM_TYPE_OTHER`, `PlaybackMetrics.DRM_TYPE_PLAY_READY`, `PlaybackMetrics.DRM_TYPE_WIDEVINE_L1`, `PlaybackMetrics.DRM_TYPE_WIDEVINE_L3`, `PlaybackMetrics.DRM_TYPE_WV_L3_FALLBACK`, or `PlaybackMetrics.DRM_TYPE_CLEARKEY`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setLocalBytesRead

    public PlaybackMetrics.Builder setLocalBytesRead (long value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setMediaDurationMillis

    public PlaybackMetrics.Builder setMediaDurationMillis (long value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

See also:

- `PlaybackMetrics.getMediaDurationMillis()`

### setMetricsBundle

    public PlaybackMetrics.Builder setMetricsBundle (Bundle metricsBundle)

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`.

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setNetworkBytesRead

    public PlaybackMetrics.Builder setNetworkBytesRead (long value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setNetworkTransferDurationMillis

    public PlaybackMetrics.Builder setNetworkTransferDurationMillis (long value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

See also:

- `PlaybackMetrics.getNetworkTransferDurationMillis()`

### setPlaybackType

    public PlaybackMetrics.Builder setPlaybackType (int value)

Sets the playback type.

Parameters
`value` | `int`: Value is `PlaybackMetrics.PLAYBACK_TYPE_UNKNOWN`, `PlaybackMetrics.PLAYBACK_TYPE_VOD`, `PlaybackMetrics.PLAYBACK_TYPE_LIVE`, or `PlaybackMetrics.PLAYBACK_TYPE_OTHER`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setPlayerName

    public PlaybackMetrics.Builder setPlayerName (String value)

Sets the player name.

Parameters
`value` | `String`: This value cannot be `null`.

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setPlayerVersion

    public PlaybackMetrics.Builder setPlayerVersion (String value)

Sets the player version.

Parameters
`value` | `String`: This value cannot be `null`.

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setStreamSource

    public PlaybackMetrics.Builder setStreamSource (int value)

Sets the stream source type.

Parameters
`value` | `int`: Value is `PlaybackMetrics.STREAM_SOURCE_UNKNOWN`, `PlaybackMetrics.STREAM_SOURCE_NETWORK`, `PlaybackMetrics.STREAM_SOURCE_DEVICE`, or `PlaybackMetrics.STREAM_SOURCE_MIXED`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setStreamType

    public PlaybackMetrics.Builder setStreamType (int value)

Sets the stream type.

Parameters
`value` | `int`: Value is `PlaybackMetrics.STREAM_TYPE_UNKNOWN`, `PlaybackMetrics.STREAM_TYPE_OTHER`, `PlaybackMetrics.STREAM_TYPE_PROGRESSIVE`, `PlaybackMetrics.STREAM_TYPE_DASH`, `PlaybackMetrics.STREAM_TYPE_HLS`, or `PlaybackMetrics.STREAM_TYPE_SS`

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setVideoFramesDropped

    public PlaybackMetrics.Builder setVideoFramesDropped (int value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

### setVideoFramesPlayed

    public PlaybackMetrics.Builder setVideoFramesPlayed (int value)

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

Returns
`PlaybackMetrics.Builder` | This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*