dispose method

Future<void> dispose()

Implementation

Future<void> dispose() async {
  renderer.srcObject = null;

  /// libwebrtc does not provide a way to clone MediaStreams. So stopping the
  /// local stream here would break calls with all other participants if anyone
  /// leaves. The local stream is manually disposed when user leaves. On web
  /// streams are actually cloned.
  if (!isGroupCall || isWeb) {
    await stopMediaStream(stream);
  }

  stream = null;
  await renderer.dispose();
}