Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to read active audio output device #497

Closed
davideberlein opened this issue Oct 28, 2022 · 0 comments · Fixed by #500
Closed

Allow to read active audio output device #497

davideberlein opened this issue Oct 28, 2022 · 0 comments · Fixed by #500

Comments

@davideberlein
Copy link
Contributor

Describe the problem

Room.switchActiveDevice() allows us to set the audiooutput device for all subscribed remote participants.

Retrieving the actively set device is possible for the audioinput (microphone) by calling
room.localParticipant.getTrack('microphone')?.audioTrack?.getDeviceId(). The same can be done for the videoinput (camera).
However there is not method to retrieve the currently configured output device for all remote participants.

Describe the proposed solution

One possibility would be to provide the symmetric equivalent to switchActiveDevice():

  /**
   * Returns the currently active device used in this room.
   *
   * Note: setting and reading AudioOutput is not supported on some browsers. See [setSinkId](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId#browser_compatibility)
   *
   * @param kind use `videoinput` for camera track,
   *  `audioinput` for microphone track,
   *  `audiooutput` to set speaker for all incoming audio tracks
   * @returns promise that resolves to the active deviceId
   */
async getActiveDevice(deviceId :  Kind) : Promise<string>;

Alternatives considered

As there already are valid methods to retrieve the active microphone and camera one could also provide an explicit method for the audiooutput as an alternative

/**
   * Returns the currently active audio output used for all attached remote participants in this room.
   *
   * Note: setting and reading AudioOutput is not supported on some browsers. See [setSinkId](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId#browser_compatibility)
   * Note: Use [[LocalTrack.getDeviceId()]] to get the active audioinput and videoinput.
   * @returns promise that resolves to the active audio output deviceId
   */
async getActiveAudioOutputDevice() : Promise<string>

Importance

would make my life easier

Additional Information

Discussed with @lukasIO on slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant