dispose previous stream also

This commit is contained in:
Hiroshi Horie
2021-10-26 23:29:08 +09:00
parent 18d12613f6
commit 4779b3306c
+3 -2
View File
@@ -38,9 +38,10 @@ class LocalVideoTrack extends VideoTrack {
currentOptions = options ?? currentOptions;
// stop the current track
// stop the current track & stream
await mediaStreamTrack.stop();
await mediaStream.dispose();
// create new track with options
final newStream = await _createStream(currentOptions);
final newTrack = newStream.getVideoTracks().first;