From e38e294be31635c085c8e5810b42b596930fd735 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 May 2017 13:38:32 -0500 Subject: [PATCH 1/3] :memo:Update use of deprecated getUserMedia[ci skip] --- docs/api/desktop-capturer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 00542f402f45..c581d46e0dc1 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -16,7 +16,7 @@ desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => { if (error) throw error for (let i = 0; i < sources.length; ++i) { if (sources[i].name === 'Electron') { - navigator.webkitGetUserMedia({ + navigator.mediaDevices.getUserMedia({ audio: false, video: { mandatory: { @@ -44,11 +44,11 @@ function handleError (e) { ``` To capture video from a source provided by `desktopCapturer` the constraints -passed to [`navigator.webkitGetUserMedia`] must include +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.webkitGetUserMedia`] must include `chromeMediaSource: 'screen'`, +to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'screen'`, and `audio: true`, but should not include a `chromeMediaSourceId` constraint. ## Methods @@ -73,4 +73,4 @@ and calls `callback(error, sources)` when finished. objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured. -[`navigator.webkitGetUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/Navigator/getUserMedia +[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia From 37bcc96e9514d52e70147e93fcc56fc2805e8f17 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 May 2017 13:42:47 -0500 Subject: [PATCH 2/3] :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 c581d46e0dc1..590895ce4f16 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 From f4d3c169b00f20d8e0f2b4c8d218ea75bca967b8 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 May 2017 13:45:14 -0500 Subject: [PATCH 3/3] :memo:Update documentation desktopCapturer to javascript[ci skip] --- docs/api/desktop-capturer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 590895ce4f16..5cc233e6cd92 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -51,7 +51,7 @@ To capture both audio and video from the entire desktop the constraints passed to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'desktop'`, for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint. -``` +```javascript const constraints = { audio: { mandatory: {