configure method
muted instructs the plugin to mute or unmute the participant; quality changes the complexity of the Opus encoder for the participant; record can be used to record this participant's contribution to a Janus .mjr file, and filename to provide a basename for the path to save the file to (notice that this is different from the recording of a whole room: this feature only records the packets this user is sending, and is not related to the mixer stuff). A successful request will result in a ok event:
muted
: true|false, whether to unmute or mute
display
: new display name to have in the room"
preBuffer
: new number of packets to buffer before decoding this participant (see "join" for more info)
bitrate
: new bitrate to use for the Opus stream (see "join" for more info)
quality
: new Opus-related complexity to use (see "join" for more info)
expectedLoss
: new value for the expected loss (see "join" for more info)
volume
: new volume percent value (see "join" for more info)
spatialPosition
: in case spatial audio is enabled for the room, new panning of this participant (0=left, 50=center, 100=right)
record
: true|false, whether to record this user's contribution to a .mjr file (mixer not involved)
filename
: basename of the file to record to, -audio.mjr will be added by the plugin
group
: new group to assign to this participant, if enabled in the room (for forwarding purposes)
offer
: provide your own webrtc offer by default sends with audiosendrecv only
Implementation
Future<void> configure(
{bool? muted,
int? bitrate,
String? display,
int? preBuffer,
int? quality,
int? volume,
int? spatialPosition,
bool? record,
String? filename,
String? group,
RTCSessionDescription? offer}) async {
var payload = {
"request": "configure",
"muted": muted,
"display": display,
"bitrate": bitrate,
"prebuffer": preBuffer,
"quality": quality,
"volume": volume,
"spatial_position": spatialPosition,
"record": record,
"filename": filename,
"group": group
}..removeWhere((key, value) => value == null);
if (offer == null) {
offer = await this.createOffer(
videoSend: false, videoRecv: false, audioSend: true, audioRecv: true);
}
JanusEvent response =
JanusEvent.fromJson(await this.send(data: payload, jsep: offer));
JanusError.throwErrorFromEvent(response);
}