Diposing a track with an effect doesn't call TRACK_REMOVED.
See original GitHub issueDescription
Diposing a track with an effect doesn’t call TRACK_REMOVED.
Current behavior
When I call .dispose() on a track with an effect it removes the track without calling TRACK_REMOVED. When I recreate the track it removes the track and directly add the new one (the listener TRACK_ADDED is called after the TRACK_REMOVED). If I call .setEffect() to remove the effect the behavior is the same. This is the behavior for 3 or more users if I have 2 users when I call dispose() it calls TRACK_REMOVED then directly call TRACK_ADDED with the same track.
Expected Behavior
When I call .dispose() on a track with an effect it removes the track and call TRACK_REMOVED on other users.
Possible Solution
Calling room.removeTrack(tracks[0])
before dispose()
call the TRACK_REMOVED listener.
Steps to reproduce
room.on(JitsiMeetJS.events.conference.TRACK_ADDED, track => {
console.log('add', track.getType(), track.getParticipantId(), track)
})
room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, track => {
console.log('remove', track.getType(), track.getParticipantId(), track)
})
const tracks = await JitsiMeetJS.createLocalTracks({ devices: ['video'] })
room.addTrack(tracks[0]) // call TRACK_ADDED
tracks[0].setEffect(new Effect()) // if I remove the effect it works as expected
// it works if I call `await room.removeTrack(tracks[0])`
tracks[0].dispose() // doesn't call TRACK_REMOVED
Environment details
Window 10 firefox, brave, chrome node 12.18.3 jitsi https://meet.jit.si/libs/lib-jitsi-meet.min.js
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to Recycle Old Electronics - Consumer Reports
Want to donate or recycle old electronics? Consumer Reports has the details on the right way to get rid of phones, laptops, and...
Read more >Disposal and recycling information for iPhone - Apple Support
For free recycling of your old device, a prepaid shipping label, and instructions, see the Apple Trade In website. The symbol above means...
Read more >Implement a Dispose method - Microsoft Learn
The Dispose method performs all object cleanup, so the garbage collector no longer needs to call the objects' Object.Finalize override.
Read more >Running side effects with reactions - MobX
How tracking works. Autorun works by running the effect in a reactive context. During the execution of the provided function, MobX keeps track...
Read more >Managing and Reducing Wastes: A Guide for Commercial ...
Conserve resources - Reuse and recycling conserves natural resources including trees, metals and water. Track Waste. Materials and wastes offer an often ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks!
@jallamsetty1 thank you very much for your work.
Now the track is removed on
dispose
, but if there is an effect I can still see the browser’s recording icon on the tab. Unless I callsetEffect
beforedispose
. I can see in your commit that you already callsetEffect
indispose
so I’m not sure what is the problem.I’m using the lib-jitsi-meet that comes with the jisti-meet 2.0.7001-1 server package.