Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: MediaDeviceInfo
Source: JSObjects/InputDeviceInfo.cs
MDN Reference: InputDeviceInfo on MDN
The InputDeviceInfo interface of the Media Capture and Streams API gives access to the capabilities of the input device that it represents. https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo
| Signature | Description |
|---|---|
InputDeviceInfo(SpawnJSObjectReference _ref) |
Deserialization constructor |
| Method | Return Type | Description |
|---|---|---|
GetCapabilities() |
MediaTrackCapabilities |
Returns a MediaTrackCapabilities object describing the primary audio or video track of a device's MediaStream. |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<InputDeviceInfo>(...)or constructornew InputDeviceInfo(...)
navigator.mediaDevices.enumerateDevices().then((devices) => {
devices.forEach((device) => {
console.log(device); // an InputDeviceInfo object if the device is an input device, otherwise a MediaDeviceInfo object.
});
});