Package com.oorian.html.js.mediadevices
Class MediaDevice
java.lang.Object
com.oorian.html.js.mediadevices.MediaDevice
Represents information about a media input or output device.
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMediaDevice(String deviceId, String groupId, String kind, String label) Constructs a MediaDevice. -
Method Summary
Modifier and TypeMethodDescriptionReturns the unique identifier for this device.Returns the group identifier.getKind()Returns the kind of device.getLabel()Returns the human-readable label for the device.booleanReturns whether this device is an audio input (microphone).booleanReturns whether this device is an audio output (speaker/headphones).booleanReturns whether this device is a video input (camera).toString()
-
Constructor Details
-
MediaDevice
Constructs a MediaDevice.- Parameters:
deviceId- The unique identifier for the device.groupId- The group identifier (devices in the same group are on the same physical device).kind- The kind of device: "audioinput", "audiooutput", or "videoinput".label- The human-readable label for the device.
-
-
Method Details
-
getDeviceId
Returns the unique identifier for this device.- Returns:
- The device ID.
-
getGroupId
Returns the group identifier.Devices with the same group ID are on the same physical device (e.g., a webcam with built-in microphone).
- Returns:
- The group ID.
-
getKind
Returns the kind of device.- Returns:
- "audioinput" for microphones, "audiooutput" for speakers, "videoinput" for cameras.
-
getLabel
Returns the human-readable label for the device.Note: This may be empty if the user hasn't granted permission to access media devices.
- Returns:
- The device label.
-
isAudioInput
public boolean isAudioInput()Returns whether this device is an audio input (microphone).- Returns:
- True if this is a microphone.
-
isAudioOutput
public boolean isAudioOutput()Returns whether this device is an audio output (speaker/headphones).- Returns:
- True if this is an audio output device.
-
isVideoInput
public boolean isVideoInput()Returns whether this device is a video input (camera).- Returns:
- True if this is a camera.
-
toString
-