destroyRoom method
this can be used to destroy a room .
Notice that, in general, all users can create rooms. If you want to limit this functionality, you can configure an admin admin_key in the plugin settings. When configured, only "create" requests that include the correct admin_key value in an "admin_key" property will succeed, and will be rejected otherwise. Notice that you can optionally extend this functionality to RTP forwarding as well, in order to only allow trusted clients to use that feature.
roomId
: unique numeric ID, optional, chosen by plugin if missing.
permanent
: true|false, whether the room should be also removed from the config file; default=false.
secret
: password required to edit/destroy the room, optional.
Implementation
Future<dynamic> destroyRoom(
{int? roomId, String? secret, bool? permanent}) async {
var payload = {
"textroom": "destroy",
"room": roomId,
"secret": secret,
"permanent": permanent,
};
_handleRoomIdTypeDifference(payload);
_context._logger.fine('destroyRoom invoked with roomId:$roomId');
JanusEvent response = JanusEvent.fromJson(await this.send(data: payload));
JanusError.throwErrorFromEvent(response);
return response;
}