mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Fixed bug with screensharing
When a screen publisher was initialized with audio but the user disable the publish audio after it, in the default browser popup, the subscriber was not able to receive the video and audio. There was an inconsistent with transceivers in webrtpeerpull/828/head
parent
809ba26b35
commit
875c8536cc
|
@ -470,6 +470,15 @@ export class Publisher extends StreamManager {
|
|||
};
|
||||
|
||||
if (this.stream.isSendScreen()) {
|
||||
|
||||
if(this.stream.isSendAudio() && mediaStream.getAudioTracks().length === 0){
|
||||
// If sending audio is enabled and there are no audio tracks in the mediaStream, disable audio for screen sharing.
|
||||
this.stream.audioActive = false;
|
||||
this.stream.hasAudio = false;
|
||||
this.stream.outboundStreamOpts.publisherProperties.publishAudio = false;
|
||||
this.stream.outboundStreamOpts.publisherProperties.audioSource = false;
|
||||
}
|
||||
|
||||
// Set interval to listen for screen resize events
|
||||
this.screenShareResizeInterval = setInterval(() => {
|
||||
const settings: MediaTrackSettings = mediaStream.getVideoTracks()[0].getSettings();
|
||||
|
|
Loading…
Reference in New Issue