Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.71 KB

File metadata and controls

41 lines (30 loc) · 1.71 KB

InputDeviceInfo

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

Constructors

Signature Description
InputDeviceInfo(SpawnJSObjectReference _ref) Deserialization constructor

Methods

Method Return Type Description
GetCapabilities() MediaTrackCapabilities Returns a MediaTrackCapabilities object describing the primary audio or video track of a device's MediaStream.

Examples

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., readyState becomes ReadyState)
  • Events use ActionEvent with +=/-= (e.g., addEventListener("click", fn) becomes OnClick += handler)
  • Async methods return Task<T> instead of Promise<T>
  • Objects should be disposed with using statements
  • Access via JS.Get<InputDeviceInfo>(...) or constructor new 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.
  });
});

See full example on MDN