When we implemented #3003 in janus.js, we made it so when adding/replacing new tracks, we'd first capture the new track and only after that we'd remove the old one: actually, when doing replace: true, the previous track would not be removed at all. Apparently this caused problems on some devices, e.g., as reported in #3201.
This patch tries to address that, by removing a track before it's updated. We had a FIXME in there since this may cause problems, as with this change there could be some time in between a track is removed and then replaced when nothing is added. As such, I'm providing this as a PR: please test and ensure it doesn't cause regressions or problems, as I plan to merge soon if it fixes the problem.
When we implemented #3003 in
janus.js
, we made it so when adding/replacing new tracks, we'd first capture the new track and only after that we'd remove the old one: actually, when doingreplace: true
, the previous track would not be removed at all. Apparently this caused problems on some devices, e.g., as reported in #3201.This patch tries to address that, by removing a track before it's updated. We had a FIXME in there since this may cause problems, as with this change there could be some time in between a track is removed and then replaced when nothing is added. As such, I'm providing this as a PR: please test and ensure it doesn't cause regressions or problems, as I plan to merge soon if it fixes the problem.