From 37bcc96e9514d52e70147e93fcc56fc2805e8f17 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 May 2017 13:42:47 -0500 Subject: [PATCH] :memo:Update constraints for audio sharing[ci skip] --- docs/api/desktop-capturer.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index c581d46e0d..590895ce4f 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -1,7 +1,7 @@ # desktopCapturer > Access information about media sources that can be used to capture audio and -> video from the desktop using the [`navigator.webkitGetUserMedia`] API. +> video from the desktop using the [`navigator.mediaDevices.getUserMedia`] API. Process: [Renderer](../glossary.md#renderer-process) @@ -48,8 +48,23 @@ passed to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'desktop'`, and `audio: false`. To capture both audio and video from the entire desktop the constraints passed -to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'screen'`, -and `audio: true`, but should not include a `chromeMediaSourceId` constraint. +to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'desktop'`, +for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint. + +``` +const constraints = { + audio: { + mandatory: { + chromeMediaSource: 'desktop' + } + }, + video: { + mandatory: { + chromeMediaSource: 'desktop' + } + } +}; +``` ## Methods