Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ The new camera keeps the resolution and frame rate of the old one, as far as it

### Devices

`media.devices()` returns the cameras, microphones and speakers. The first call reads them from the system; after that, the lists are snapshots kept current in the background, so reading them is cheap on any thread. `screens()` and `windows()` ask the system on each call.
`media.devices()` returns the cameras, microphones and speakers. The first call reads them from the system; after that, the lists are snapshots kept current in the background, so reading them is cheap on any thread. `screens()` and `windows()` ask the system on each call. A kind of device the system cannot list, such as audio devices on a machine without an audio system, comes back as an empty list; a query that fails otherwise throws a `MediaException`, so an empty list means there are no such devices.

```java
Devices devices = media.devices();
Expand Down
10 changes: 9 additions & 1 deletion webrtc/src/main/java/dev/onvoid/webrtc/client/Devices.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,30 @@
* the background, so reading them is cheap on any thread. Where the system
* reports no device changes, as a Linux machine without PulseAudio, they are
* read on each call. A kind of device the system cannot list, such as audio
* devices without an audio system, comes back as an empty list.
* devices without an audio system, comes back as an empty list. A query that
* fails otherwise throws a {@link MediaException}, so that an empty list means
* that there are no such devices.
*/
public interface Devices {

/**
* @return the cameras.
*
* @throws MediaException if the cameras could not be read.
*/
List<VideoDevice> cameras();

/**
* @return the microphones.
*
* @throws MediaException if the microphones could not be read.
*/
List<AudioDevice> microphones();

/**
* @return the speakers.
*
* @throws MediaException if the speakers could not be read.
*/
List<AudioDevice> speakers();

Expand Down
Loading
Loading