Package com.google.android.exoplayer2
Interface ExoPlayer.DeviceComponent
-
- All Known Implementing Classes:
SimpleExoPlayer
- Enclosing interface:
- ExoPlayer
public static interface ExoPlayer.DeviceComponent
The device component of anExoPlayer
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addDeviceListener(DeviceListener listener)
Deprecated.void
decreaseDeviceVolume()
Decreases the volume of the device.DeviceInfo
getDeviceInfo()
Gets the device information.int
getDeviceVolume()
Gets the current volume of the device.void
increaseDeviceVolume()
Increases the volume of the device.boolean
isDeviceMuted()
Gets whether the device is muted or not.void
removeDeviceListener(DeviceListener listener)
Deprecated.void
setDeviceMuted(boolean muted)
Sets the mute state of the device.void
setDeviceVolume(int volume)
Sets the volume of the device.
-
-
-
Method Detail
-
addDeviceListener
@Deprecated void addDeviceListener(DeviceListener listener)
Deprecated.Adds a listener to receive device events.
-
removeDeviceListener
@Deprecated void removeDeviceListener(DeviceListener listener)
Deprecated.Removes a listener of device events.
-
getDeviceInfo
DeviceInfo getDeviceInfo()
Gets the device information.
-
getDeviceVolume
int getDeviceVolume()
Gets the current volume of the device.For devices with
local playback
, the volume returned by this method varies according to the currentstream type
. The stream type is determined byAudioAttributes.usage
which can be converted to stream type withUtil.getStreamTypeForAudioUsage(int)
.For devices with
remote playback
, the volume of the remote device is returned.
-
isDeviceMuted
boolean isDeviceMuted()
Gets whether the device is muted or not.
-
setDeviceVolume
void setDeviceVolume(int volume)
Sets the volume of the device.- Parameters:
volume
- The volume to set.
-
increaseDeviceVolume
void increaseDeviceVolume()
Increases the volume of the device.
-
decreaseDeviceVolume
void decreaseDeviceVolume()
Decreases the volume of the device.
-
setDeviceMuted
void setDeviceMuted(boolean muted)
Sets the mute state of the device.
-
-