Package com.google.android.exoplayer2
Class DeviceInfo.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.DeviceInfo.Builder
-
- Enclosing class:
- DeviceInfo
public static final class DeviceInfo.Builder extends Object
Builder forDeviceInfo
.
-
-
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 theDeviceInfo
.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 associatedMediaRouter2.RoutingController
.
-
-
-
Constructor Detail
-
Builder
public Builder(@com.google.android.exoplayer2.DeviceInfo.PlaybackType int playbackType)
Creates the builder.- Parameters:
playbackType
- TheDeviceInfo.PlaybackType
.
-
-
Method Detail
-
setMinVolume
@CanIgnoreReturnValue public DeviceInfo.Builder 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 setMaxVolume(@IntRange(from=0L) int maxVolume)
Sets the maximum supported device volume.- Parameters:
maxVolume
- The maximum device volume, or0
to leave the maximum unspecified.- Returns:
- This builder.
-
setRoutingControllerId
@CanIgnoreReturnValue public DeviceInfo.Builder setRoutingControllerId(@Nullable String routingControllerId)
Sets the routing controller id of the associatedMediaRouter2.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
isDeviceInfo.PLAYBACK_TYPE_LOCAL
.- Parameters:
routingControllerId
- The routing controller id of the associatedMediaRouter2.RoutingController
, or null to leave it unspecified.- Returns:
- This builder.
-
build
public DeviceInfo build()
Builds theDeviceInfo
.
-
-