Open un-hongly opened 2 years ago
LOL. Sorry for that. Im working on major update. For now, implement it by closing producer and creating new.
LOL. Sorry for that. Im working on major update. For now, implement it with closing producer and creating new.
вт, 30 авг. 2022 г., 19:22 un-hongly @.***>:
I'm working on a feature where user can switch their camera. To do that I replace a new track for the producer using producer.replaceTrack(newTrack) but it always returns a log that says "replaceTrack() | same track, ignored." even when I pass a completely new track.
I looked into your code inside producer.dart file at line 357 you compare a track parameter to the track parameter itself (see below) which is why the condition is always matched.
Future
replaceTrack(MediaStreamTrack track) async { ... if (track == track) { _logger.debug('replaceTrack() | same track, ignored.'); return; }
... }
— Reply to this email directly, view it on GitHub https://github.com/Blancduman/mediasoup-client-flutter/issues/62, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVXEO7OULNBCAAXEFTFS2LV3YYKZANCNFSM6AAAAAAQASFCLU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Two years since then function "replaceTrack" is yet unable to work.
By looking at producer.dart, I foud something weird :)
// Set the new track.
track = track;
why not using:
this.track = track;
or, rename the class property with '_' prefix, then
_track = track;
I'm working on a feature where user can switch their camera. To do that I replace a new track for the producer using
producer.replaceTrack(newTrack)
but it always returns a log that says "replaceTrack() | same track, ignored.
" even when I pass a completely new track.I looked into your code inside producer.dart file at line 357 you compare a
track
parameter to thetrack
parameter itself (see below) which is why the condition is always matched.