Back to Exoplayer

DeviceInfo.Builder (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/DeviceInfo.Builder.html

latest4.7 KB
Original Source

Package com.google.android.exoplayer2

Class DeviceInfo.Builder


public static final classDeviceInfo.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Builder for DeviceInfo.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Builder​(@com.google.android.exoplayer2.DeviceInfo.PlaybackType int playbackType) | Creates the builder. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | DeviceInfo | build() | Builds the DeviceInfo. | | DeviceInfo.Builder | setMaxVolume​(int maxVolume) | Sets the maximum supported device volume. | | DeviceInfo.Builder | setMinVolume​(int minVolume) | Sets the minimum supported device volume. | | DeviceInfo.Builder | setRoutingControllerId​(String routingControllerId) | Sets the routing controller id of the associated MediaRouter2.RoutingController. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Builder

public Builder​(@com.google.android.exoplayer2.DeviceInfo.PlaybackType int playbackType)

Creates the builder. Parameters:playbackType - The DeviceInfo.PlaybackType.

Method Detail

- 

setMinVolume

@CanIgnoreReturnValue
public[DeviceInfo.Builder](DeviceInfo.Builder.html "class in com.google.android.exoplayer2")setMinVolume​(@IntRange(from=0L)
                                       int minVolume)

Sets the minimum supported device volume.

The minimum will be set to 0 if not specified.

Parameters:minVolume - The minimum device volume.Returns:This builder.

- 

setMaxVolume

@CanIgnoreReturnValue
public[DeviceInfo.Builder](DeviceInfo.Builder.html "class in com.google.android.exoplayer2")setMaxVolume​(@IntRange(from=0L)
                                       int maxVolume)

Sets the maximum supported device volume. Parameters:maxVolume - The maximum device volume, or 0 to leave the maximum unspecified.Returns:This builder.

- 

setRoutingControllerId

@CanIgnoreReturnValue
public[DeviceInfo.Builder](DeviceInfo.Builder.html "class in com.google.android.exoplayer2")setRoutingControllerId​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")routingControllerId)

Sets the routing controller id of the associated MediaRouter2.RoutingController.

This id allows mapping this device information to a routing controller, which provides information about the media route and allows controlling its volume.

The set value must be null if DeviceInfo.playbackType is DeviceInfo.PLAYBACK_TYPE_LOCAL.

Parameters:routingControllerId - The routing controller id of the associated MediaRouter2.RoutingController, or null to leave it unspecified.Returns:This builder.

- 

build

public[DeviceInfo](DeviceInfo.html "class in com.google.android.exoplayer2")build()

Builds the DeviceInfo.