client-sdk-js
client-sdk-js copied to clipboard
Fixes calling start() on a remote track multiple times
Prevent multiple redundant monitors from being started if start is called multiple times on a RemoteTrack
Fixes issue: https://github.com/livekit/client-sdk-js/issues/392
🦋 Changeset detected
Latest commit: 515fb7799d250ec5c0700d38fbb4968a5cf1fec1
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
livekit-client | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
hi @wcarle, thanks for the PR! Looking at the code (not particularly your changes), I'm thinking it might make sense to base the monitor on an interval, rather than timeouts. Then a reference to the interval could be used to track if monitoring has been started already and it wouldn't need the extra variable to track if monitoring has been started.
@lukasIO Yeah that's a good call, it's much cleaner that way. Just pushed that change
great, thank you!
I think there's only one thing left to do, which is clearing the interval at the top of the stop
function on the RemoteTrack
@lukasIO Done!