mirror of https://github.com/OpenVidu/openvidu.git
Revert "openvidu-browser: fix wrong screen audio track management"
This reverts commit 50a07ed203
.
pull/828/head
parent
55728b7235
commit
1e416325b6
|
@ -568,7 +568,6 @@ export class OpenVidu {
|
||||||
// getDisplayMedia supported
|
// getDisplayMedia supported
|
||||||
try {
|
try {
|
||||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: options.audioSource === 'screen' });
|
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: options.audioSource === 'screen' });
|
||||||
this.removeScreenAudioTrackIfNotAvailable(mediaStream);
|
|
||||||
this.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
this.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
||||||
if (mustAskForAudioTrackLater) {
|
if (mustAskForAudioTrackLater) {
|
||||||
return await askForAudioStreamOnly(mediaStream, <MediaStreamConstraints>myConstraints.constraints);
|
return await askForAudioStreamOnly(mediaStream, <MediaStreamConstraints>myConstraints.constraints);
|
||||||
|
@ -1162,21 +1161,6 @@ export class OpenVidu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
removeScreenAudioTrackIfNotAvailable(mediaStream: MediaStream) {
|
|
||||||
const [screenVideoTrack] = mediaStream.getVideoTracks();
|
|
||||||
const displaySurface = (screenVideoTrack.getSettings() as any).displaySurface;
|
|
||||||
if (displaySurface !== 'browser') {
|
|
||||||
// tab screen share. This is the only way in CHromium right now that is possible to share the audio of a screen
|
|
||||||
mediaStream.getAudioTracks().forEach((screenAudioTrack) => {
|
|
||||||
mediaStream.removeTrack(screenAudioTrack);
|
|
||||||
screenAudioTrack.stop();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
|
@ -1314,5 +1298,4 @@ export class OpenVidu {
|
||||||
private isScreenShare(videoSource: string) {
|
private isScreenShare(videoSource: string) {
|
||||||
return videoSource === 'screen' || videoSource === 'window' || (platform.isElectron() && videoSource.startsWith('screen:'));
|
return videoSource === 'screen' || videoSource === 'window' || (platform.isElectron() && videoSource.startsWith('screen:'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -645,7 +645,6 @@ export class Publisher extends StreamManager {
|
||||||
try {
|
try {
|
||||||
if (this.stream.isSendScreen() && navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
|
if (this.stream.isSendScreen() && navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
|
||||||
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: this.properties.audioSource === 'screen' });
|
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: this.properties.audioSource === 'screen' });
|
||||||
this.openvidu.removeScreenAudioTrackIfNotAvailable(mediaStream);
|
|
||||||
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream);
|
||||||
await getMediaSuccess(mediaStream, definedAudioConstraint);
|
await getMediaSuccess(mediaStream, definedAudioConstraint);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue