# Pause Data Coming To A Consumer

**URL:** <https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162>\
**Category:** mediasoup libraries\
**Created:** [December 21, 2020, 5:50pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162 "2020-12-21T17:50:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![redfieldp](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/redfieldp/32/711_2.png) [@redfieldp](https://mediasoup.discourse.group/u/redfieldp)\
**Post date:** [December 21, 2020, 5:50pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/1 "2020-12-21T17:50:34Z")

</div>

I am attempting to actually pause the data coming into a Consumer object.

I have tried using both  
`pause()`  
and  
`track.enabled = false`

In both cases, when I look at chrome://webrtc-internals/, it seems that I am still receiving the data (a bandwidth change does not occur). By contrast, when you call  
`track.enabled = false`  
on a the producer side, there is a significant drop off in bandwidth in the Consumers since they’re not receiving video or audio.

Is there a way on the Consumer side to have this same bandwidth savings, while still keeping a lightweight connection open to the Producer, so that it’s easy to restart streaming?

---

<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:** [December 21, 2020, 6:02pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/2 "2020-12-21T18:02:03Z")

</div>

Yes, read the Consumer API at mediasoup server side.

---

<div class="post-metadata">

**Author:** ![redfieldp](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/redfieldp/32/711_2.png) [@redfieldp](https://mediasoup.discourse.group/u/redfieldp)\
**Post date:** [December 21, 2020, 6:23pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/3 "2020-12-21T18:23:23Z")

</div>

I was hoping I could do something solely on the Client/Consumer side. Are you saying that I need to message the server, and then it needs to make the change?

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [December 21, 2020, 7:09pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/4 "2020-12-21T19:09:43Z")

</div>

Yes, you need to pause server-side Consumer (NOTE: Consumer is present both on the server and client).

---

<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:** [December 21, 2020, 7:20pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/5 "2020-12-21T19:20:55Z")

</div>

How can you stop receiving something from the other party without telling it to stop sending it?

---

<div class="post-metadata">

**Author:** ![redfieldp](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/redfieldp/32/711_2.png) [@redfieldp](https://mediasoup.discourse.group/u/redfieldp)\
**Post date:** [December 21, 2020, 8:50pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/6 "2020-12-21T20:50:18Z")

</div>

I suppose in any case you would have to tell the server. I was just hoping this functionality would already be encapsulated in the API somehow, rather than having to implement server and client side handlers of it. Seems like it would be a relatively useful/frequent feature to pause incoming feeds. I’m guessing maybe you are just trying to keep the two sides (client/server) as modular as possible? Anyway, thanks for the heads up!

---

<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:** [December 21, 2020, 8:52pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/7 "2020-12-21T20:52:48Z")

</div>

> [@redfieldp](#):
>
> I was just hoping this functionality would already be encapsulated in the API somehow, rather than having to implement server and client side handlers of it.

How could we “encapsulate it in the API somehow” if mediasoup does not include any signalling mechanism to communicate client and server?

> **[mediasoup :: Communication Between Client and Server](https://mediasoup.org/documentation/v3/communication-between-client-and-server/)**
>
> Cutting Edge WebRTC Video Conferencing

---

<div class="post-metadata">

**Author:** ![redfieldp](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/redfieldp/32/711_2.png) [@redfieldp](https://mediasoup.discourse.group/u/redfieldp)\
**Post date:** [December 21, 2020, 8:54pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/8 "2020-12-21T20:54:51Z")

</div>

Fair enough! Sorry, I’m a new user and I was conflating some of the technologies that I’m seeing in some examples. Appreciate your patience!

---

<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:** [December 21, 2020, 8:58pm UTC](https://mediasoup.discourse.group/t/pause-data-coming-to-a-consumer/2162/9 "2020-12-21T20:58:17Z")

</div>

Yup, I know. Don’t worry. Please, at this stage, focus on mediasoup and mediasoup-client documentation and API. Check examples or demo projects later (my recommendation).
