Since updating the twilio-video JS SDK from version 1.x to 2.x, I've encountered an issue when trying to add an additional device. An example of the error message is as follows: ERROR TypeError: transceiver.sender.replaceTrack(...).then(...).finally is not a function. Disabling this device results in a new error message: ERROR Error: Uncaught (in promise): Error: The [LocalVideoTrack #5: 8da6e8e0-a9c1-473b-9916-484a17f61524] was unpublished. However, if I repeat enabling the device, everything works fine.
this.room
.localParticipant
.publishTrack(this.deviceTracks[type]);
this.deviceTrackShared[type] = true;
Below is an example of unpublishing a track -
this.room
.localParticipant
.unpublishTrack(this.deviceTracks[type]);
this.deviceTrackShared[type] = false;