mediaDeviceChanged

Emitted when the user selects a different camera, microphone or speakers device.

The kind property can be:

  • videoinput - for camera

  • audioinput - for microphone

  • audiooutput - for speakers

Sample payloads

{
    "type": "mediaDeviceChanged",
    "data": {
      "kind": "videoinput OR audioinput OR audiooutput",
      "deviceId": "...id here...",
      "label": "...Speakers (USB Audio Device) (1b3f:2008)..."
    }
}

Sample subscription code

sambaFrame.on('mediaDeviceChanged', (event) => {
  const data = event.data;
  console.log('New device id:', data.deviceId);
});

Last updated