File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,8 @@ abstract class LocalTrack extends Track {
258258 final newStream = await LocalTrack .createStream (currentOptions);
259259 final newTrack = newStream.getTracks ().first;
260260
261+ var processor = _processor;
262+
261263 await stopProcessor ();
262264
263265 // replace track on sender
@@ -274,8 +276,8 @@ abstract class LocalTrack extends Track {
274276 // set new stream & track to this object
275277 updateMediaStreamAndTrack (newStream, newTrack);
276278
277- if (_processor != null ) {
278- await setProcessor (_processor ! );
279+ if (processor != null ) {
280+ await setProcessor (processor );
279281 }
280282
281283 // mark as started
@@ -324,10 +326,12 @@ abstract class LocalTrack extends Track {
324326 // processorElement?.remove();
325327 // processorElement = null;
326328 }
329+
327330 // apply original track constraints in case the processor changed them
328331 //await this._mediaStreamTrack.applyConstraints(this._constraints);
329332 // force re-setting of the mediaStreamTrack on the sender
330333 //await this.setMediaStreamTrack(this._mediaStreamTrack, true);
334+
331335 events.emit (TrackProcessorUpdateEvent (track: this ));
332336 }
333337
You can’t perform that action at this time.
0 commit comments