From d2423b012d2af5749ef19a49fe9286182016fc67 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 5 Oct 2023 16:54:56 +0200 Subject: [PATCH] openvidu-browser: document audioSource to "screen". Warn when no videoSource to "screen" --- openvidu-browser/src/OpenVidu/OpenVidu.ts | 4 ++++ .../OpenViduInternal/Interfaces/Public/PublisherProperties.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/openvidu-browser/src/OpenVidu/OpenVidu.ts b/openvidu-browser/src/OpenVidu/OpenVidu.ts index c1ae88bc88..fa7f61916f 100644 --- a/openvidu-browser/src/OpenVidu/OpenVidu.ts +++ b/openvidu-browser/src/OpenVidu/OpenVidu.ts @@ -1024,6 +1024,10 @@ export class OpenVidu { if (typeof videoSource === 'string') { if (!this.isScreenShare(videoSource)) { this.setVideoSource(myConstraints, videoSource); + if (audioSource === 'screen') { + logger.warn('Parameter "audioSource" is set to "screen", which means rquesting audio from screen sharing source. But "videoSource" is not set to "screen". No audio source will be requested'); + myConstraints.constraints!.audio = false; + } } else { // Screen sharing diff --git a/openvidu-browser/src/OpenViduInternal/Interfaces/Public/PublisherProperties.ts b/openvidu-browser/src/OpenViduInternal/Interfaces/Public/PublisherProperties.ts index 20570aacdd..e440560cf4 100644 --- a/openvidu-browser/src/OpenViduInternal/Interfaces/Public/PublisherProperties.ts +++ b/openvidu-browser/src/OpenViduInternal/Interfaces/Public/PublisherProperties.ts @@ -25,6 +25,7 @@ export interface PublisherProperties { /** * Which device should provide the audio source. Can be: * - Property `deviceId` of a {@link Device} + * - `"screen"` to share the screen audio when {@link videoSource} is set to `"screen"`. If {@link videoSource} is not set to `"screen"` this will result in no audio source and a video-only publisher. * - A MediaStreamTrack obtained from a MediaStream object with {@link OpenVidu.getUserMedia} * - `false` or null to have a video-only publisher * @default _Default microphone_