# WebRTC change Track while streaming

**URL:** <https://community.wowza.com/t/webrtc-change-track-while-streaming/93269>\
**Category:** Wowza Streaming Engine\
**Tags:** webrtc\
**Created:** [May 6, 2021, 8:10am UTC](https://community.wowza.com/t/webrtc-change-track-while-streaming/93269 "2021-05-06T08:10:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Specker](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Andreas\_Specker](https://community.wowza.com/u/Andreas_Specker)\
**Post date:** [May 6, 2021, 8:10am UTC](https://community.wowza.com/t/webrtc-change-track-while-streaming/93269/1 "2021-05-06T08:10:58Z")

</div>

Hi everyone,

I’m currently implementing a streaing application with WebRTC and WSE 4.8.5. where you can user your webcam or share your screen into the world.

I have two questios:

1. While on air, I want for the presenter to change from webcam to screensharing and vice versa. I know I can just call **replaceTrack** on my PeerConnection to swap them out. But I would like to do it in a clean way, because I read on [webrtchacks.com](http://webrtchacks.com) that there could be promlems i.e. when changing the resolution. Now I can’t find I way to use the **onnegotiationneeded** emitter, because wowza tells my that my stream name is already in use. Is there way to get this working or should I just stay with the replacement?

2. Can I use more than 3 track per connection?  
I want screensharing with

- the videotrack
- the audiotrack from the selected screen
- an audio track from a microphone.  
The user Remy posted in slack that wowza only allows two tracks per PeerConnection (April 2020). I didn’t get it working till now, the second audio is omitted. Is there a way to send 3 tracks, or do I have to establish another connection?

Kind regards,  
Andi

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [May 10, 2021, 2:01pm UTC](https://community.wowza.com/t/webrtc-change-track-while-streaming/93269/2 "2021-05-10T14:01:53Z")

</div>

Sorry @Andreas_Specker, but that is not possible to do at this time through Wowza. Your only option would be hire a WebRTC consultant or Pro Services to have some custom work done and even then I’m not sure how well that would work within the our current WebRTC model.

---

<div class="post-metadata">

**Author:** ![Andreas\_Specker](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Andreas\_Specker](https://community.wowza.com/u/Andreas_Specker)\
**Post date:** [May 11, 2021, 6:14am UTC](https://community.wowza.com/t/webrtc-change-track-while-streaming/93269/3 "2021-05-11T06:14:31Z")

</div>

> [@Rose\_Power-Wowza\_Com](#):
>
> Your only option would be hire a WebRTC consultant or Pro Services to have some custom work done and even then I’m not sure how well that would work within the our current WebRTC model.

Thanks for the reply!  
At least I am certain now that the problem is not me 🙂 and I can work around somehow.
