# GetDisplaymedia with audio

**URL:** <https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757>\
**Category:** mediasoup libraries\
**Created:** [September 17, 2020, 10:42pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757 "2020-09-17T22:42:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustafa](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mustafa](https://mediasoup.discourse.group/u/mustafa)\
**Post date:** [September 17, 2020, 10:42pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/1 "2020-09-17T22:42:37Z")

</div>

Hi,  
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.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 17, 2020, 11:20pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/2 "2020-09-17T23:20:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rotciv](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/rotciv/32/559_2.png) [@Rotciv](https://mediasoup.discourse.group/u/Rotciv)\
**Post date:** [September 18, 2020, 11:50am UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/3 "2020-09-18T11:50:02Z")

</div>

@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

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

```

then i also have an audio producer

```auto
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](https://github.com/mkhahani/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

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 18, 2020, 12:07pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/4 "2020-09-18T12:07:42Z")

</div>

I cannot review code made by others, sorry.

> [@Rotciv](#):
>
> 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

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.

---

<div class="post-metadata">

**Author:** ![Rotciv](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/rotciv/32/559_2.png) [@Rotciv](https://mediasoup.discourse.group/u/Rotciv)\
**Post date:** [September 18, 2020, 12:13pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/5 "2020-09-18T12:13:58Z")

</div>

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 🙏

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 18, 2020, 12:22pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/6 "2020-09-18T12:22:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rotciv](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/rotciv/32/559_2.png) [@Rotciv](https://mediasoup.discourse.group/u/Rotciv)\
**Post date:** [September 18, 2020, 3:45pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/7 "2020-09-18T15:45:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dirvann](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/dirvann/32/419_2.png) [@Dirvann](https://mediasoup.discourse.group/u/Dirvann)\
**Post date:** [September 18, 2020, 7:48pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/8 "2020-09-18T19:48:24Z")

</div>

@Rotciv If you want you can try

> **[Dirvann/mediasoup-sfu-webrtc-video-rooms](https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms)**
>
> A simple video conferencing example using the mediasoup sfu - Dirvann/mediasoup-sfu-webrtc-video-rooms

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.

---

<div class="post-metadata">

**Author:** ![Rotciv](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/rotciv/32/559_2.png) [@Rotciv](https://mediasoup.discourse.group/u/Rotciv)\
**Post date:** [September 19, 2020, 7:38pm UTC](https://mediasoup.discourse.group/t/getdisplaymedia-with-audio/1757/9 "2020-09-19T19:38:56Z")

</div>

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