📝Update constraints for audio sharing[ci skip]

This commit is contained in:
Daniel Pereira 2017-05-15 13:42:47 -05:00
parent e38e294be3
commit 37bcc96e95

View file

@ -1,7 +1,7 @@
# desktopCapturer # desktopCapturer
> Access information about media sources that can be used to capture audio and > 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) Process: [Renderer](../glossary.md#renderer-process)
@ -48,8 +48,23 @@ passed to [`navigator.mediaDevices.getUserMedia`] must include
`chromeMediaSource: 'desktop'`, and `audio: false`. `chromeMediaSource: 'desktop'`, and `audio: false`.
To capture both audio and video from the entire desktop the constraints passed To capture both audio and video from the entire desktop the constraints passed
to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'screen'`, to [`navigator.mediaDevices.getUserMedia`] must include `chromeMediaSource: 'desktop'`,
and `audio: true`, but should not include a `chromeMediaSourceId` constraint. for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint.
```
const constraints = {
audio: {
mandatory: {
chromeMediaSource: 'desktop'
}
},
video: {
mandatory: {
chromeMediaSource: 'desktop'
}
}
};
```
## Methods ## Methods