GetDisplaymedia with audio

I want to share screen or chrome tab using getDisplayMedia({ video: true , audio: true}) to share a video with internal audio. How can I send them through one producer.

You need a Producer for the audio and another for the video.

1 Like

@ibc Happy week ahead

Am having similar issues, i have a different variable for both the audio && video producer but the later will get replaced by the previous

for example

    videoProducer = await transport.produce({
        track: stream.getVideoTracks()[0],
        { maxBitrate: 100000 },
        { maxBitrate: 300000 },
        { maxBitrate: 900000 },
... etc

then i also have an audio producer

audioProducer = await transport.produce({
  track: stream.getAudioTracks()[0];,
  codecOptions: {
    opusStereo: 1,
    opusDtx: 1,

But the consumer will only consume the audio producer leaving the video producer, and if i assign the video producer before the audio producer, it will be over-written by the video producer
Am currently following mediasoup-sample-app as its simpler for a new bie like me, and since there’s no audio output i decided to add mine but am having issues, please help me out

I cannot review code made by others, sorry.

This is something that you must fix into your application. Not a mediasoup issue or bug. mediasoup makes it possible to produce and consume MANY audio/video streams.

1 Like

Thanks for the quick reply, i understand that you are a very busy person, am a junior dev and the official mediasoup demo is just to big and high for me to understand (am not an experienced developer), ive been struggling with the problem since yesterday though, but thanks for creating this awesome library am very grateful :pray:

Just a tip: I’m not the only person supposed to answer or help in this forum.

1 Like

Thanks a lot sir, this library is the best out there, i wonder the kind of super brains you guys have to create this :slight_smile:

@Rotciv If you want you can try

It’s also a simple implementation with rooms.
This could help you get started. Also check the other examples on the examples page of the website.

Thanks a lot @Dirvann the code is neat, this will help me greatly

1 Like