replaceTrack does not show new track


i am trying to change a video/camera track with a video/desktop track, but it is doing nothing. I provided you an example via github (ignore the strophe errors in console).

github: GitHub - xXTraceXx/Replace_Track

Maybe someone has an idea, what i am doing wrong. Thanks in advance!


i got it to work with adding an event-handler (“track_added”) and attaching the track:

room.on(, (track) => {

   console.log('new track added...');

I am not 100% sure if that is the way to go^^ but i works