Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 14, 2024
1 parent 70fcedd commit 0fc8f5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/track/local/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ abstract class LocalTrack extends Track {
final newStream = await LocalTrack.createStream(currentOptions);
final newTrack = newStream.getTracks().first;

var processor = _processor;

await stopProcessor();

// replace track on sender
Expand All @@ -274,8 +276,8 @@ abstract class LocalTrack extends Track {
// set new stream & track to this object
updateMediaStreamAndTrack(newStream, newTrack);

if (_processor != null) {
await setProcessor(_processor!);
if (processor != null) {
await setProcessor(processor);
}

// mark as started
Expand Down Expand Up @@ -324,10 +326,12 @@ abstract class LocalTrack extends Track {
// processorElement?.remove();
// processorElement = null;
}

// apply original track constraints in case the processor changed them
//await this._mediaStreamTrack.applyConstraints(this._constraints);
// force re-setting of the mediaStreamTrack on the sender
//await this.setMediaStreamTrack(this._mediaStreamTrack, true);

events.emit(TrackProcessorUpdateEvent(track: this));
}

Expand Down

0 comments on commit 0fc8f5b

Please sign in to comment.