Skip to content

Commit

Permalink
Revert "openvidu-browser: fix wrong screen audio track management"
Browse files Browse the repository at this point in the history
This reverts commit 50a07ed.
  • Loading branch information
pabloFuente committed Oct 16, 2023
1 parent 55728b7 commit 1e41632
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
17 changes: 0 additions & 17 deletions openvidu-browser/src/OpenVidu/OpenVidu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ export class OpenVidu {
// getDisplayMedia supported
try {
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: options.audioSource === 'screen' });
this.removeScreenAudioTrackIfNotAvailable(mediaStream);
this.addAlreadyProvidedTracks(myConstraints, mediaStream);
if (mustAskForAudioTrackLater) {
return await askForAudioStreamOnly(mediaStream, <MediaStreamConstraints>myConstraints.constraints);
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -1314,5 +1298,4 @@ export class OpenVidu {
private isScreenShare(videoSource: string) {
return videoSource === 'screen' || videoSource === 'window' || (platform.isElectron() && videoSource.startsWith('screen:'));
}

}
1 change: 0 additions & 1 deletion openvidu-browser/src/OpenVidu/Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ export class Publisher extends StreamManager {
try {
if (this.stream.isSendScreen() && navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
const mediaStream = await navigator.mediaDevices['getDisplayMedia']({ video: true, audio: this.properties.audioSource === 'screen' });
this.openvidu.removeScreenAudioTrackIfNotAvailable(mediaStream);
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream);
await getMediaSuccess(mediaStream, definedAudioConstraint);
} else {
Expand Down

0 comments on commit 1e41632

Please sign in to comment.