client-sdk-js icon indicating copy to clipboard operation
client-sdk-js copied to clipboard

Calling start() on a remote track multiple times creates multiple looping monitors

Open wcarle opened this issue 3 years ago • 0 comments

When calling start() on RemoteTrack it calls this.monitorReceiver() which then calls itself with:

    setTimeout(() => {
      this.monitorReceiver();
    }, monitorFrequency);

This means that if you call start again on a remote track it will create a new setTimout loop. This can lead to a case where there are many redundant monitorReceiver calls on the same RemoteTrack if you call start on a track multiple times

wcarle avatar Aug 11 '22 19:08 wcarle