dispose previous stream also

This commit is contained in:
Hiroshi Horie
2021-10-26 23:29:08 +09:00
parent 18d12613f6
commit 4779b3306c
+2 -1
View File
@@ -38,8 +38,9 @@ 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);