📝Update constraints for audio sharing[ci skip]
This commit is contained in:
parent
e38e294be3
commit
37bcc96e95
1 changed files with 18 additions and 3 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue