mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: fix getDisplayMedia audio bug
parent
c8fd2090f2
commit
ad96776571
|
@ -567,7 +567,7 @@ export class OpenVidu {
|
|||
if (navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
|
||||
// getDisplayMedia supported
|
||||
try {
|
||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true });
|
||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: options.audioSource === 'screen' });
|
||||
this.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
||||
if (mustAskForAudioTrackLater) {
|
||||
return await askForAudioStreamOnly(mediaStream, <MediaStreamConstraints>myConstraints.constraints);
|
||||
|
@ -1017,7 +1017,7 @@ export class OpenVidu {
|
|||
) {
|
||||
const audioSource = publisherProperties.audioSource;
|
||||
const videoSource = publisherProperties.videoSource;
|
||||
if (typeof audioSource === 'string') {
|
||||
if (typeof audioSource === 'string' && audioSource !== 'screen') {
|
||||
myConstraints.constraints!.audio = { deviceId: { exact: audioSource } };
|
||||
}
|
||||
|
||||
|
|
|
@ -644,7 +644,7 @@ export class Publisher extends StreamManager {
|
|||
|
||||
try {
|
||||
if (this.stream.isSendScreen() && navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
|
||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: true });
|
||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: this.properties.audioSource === 'screen' });
|
||||
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
||||
await getMediaSuccess(mediaStream, definedAudioConstraint);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue