dispose previous stream also
This commit is contained in:
@@ -38,9 +38,10 @@ class LocalVideoTrack extends VideoTrack {
|
|||||||
|
|
||||||
currentOptions = options ?? currentOptions;
|
currentOptions = options ?? currentOptions;
|
||||||
|
|
||||||
// stop the current track
|
// stop the current track & stream
|
||||||
await mediaStreamTrack.stop();
|
await mediaStreamTrack.stop();
|
||||||
|
await mediaStream.dispose();
|
||||||
|
|
||||||
// create new track with options
|
// create new track with options
|
||||||
final newStream = await _createStream(currentOptions);
|
final newStream = await _createStream(currentOptions);
|
||||||
final newTrack = newStream.getVideoTracks().first;
|
final newTrack = newStream.getVideoTracks().first;
|
||||||
|
|||||||
Reference in New Issue
Block a user