How to share screen with audio option enabled?

Is it possible to share the a browser tab which playing a video, and let other parties can hear the audio of the playing video? How can I enable audio option of the screen share function? Thanks

Hi, take a look this github issue https://github.com/OpenVidu/openvidu/issues/194

Need to use chrome extension? Is there any setting to enable it in openvidu browser?

There are not any extra setting that allow do this in openvidu
This is not supported for all browsers. Please, read this official API

Thank you for your suggestion, I can see the audio check box now.


However, in the screen share video tag, the audio still show disable, and can’t hear any voice from it.
My settings as below, is it correct?

var displayMediaOptions = {

  video: {

    cursor: "always"

  },

  audio: true

};



let mediaDevices = navigator.mediaDevices as any;

mediaDevices.getDisplayMedia(displayMediaOptions).then((screenStream) => {

let screenVideoTrack = screenStream.getVideoTracks()[0];

let screenAudioTrack = screenStream.getAudioTracks()[0];

this.OVScreen.initPublisherAsync(undefined, {

  audioSource: screenAudioTrack,

  videoSource: screenVideoTrack,

  publishAudio: true,

  publishVideo: true,

  mirror: false    

})

//this.OVScreen.initPublisherAsync(undefined, publisherProperties)

.then((publisher: Publisher) => {................
1 Like

Have you checked if other users can hear the audio? Your own video tag is muted to avoid echo.

Yes, it works, thank you!

1 Like

When I share a tab with audio, the video resolution is reduced, even if I apply the following settings:

publisherScreen.stream.getMediaStream().getVideoTracks()[0].applyConstraints({
width: 1280,
height: 720
});

When I share a window the quality follows the settings above.

Do you know what I can do to share a tab with audio and have an HD or FullHD resolution?

Thanks!