JanusAudioBridgePlugin class
Methods
-
configure({bool? muted, int? bitrate, String? display, int? preBuffer, int? quality, int? volume, int? spatialPosition, bool? record, String? filename, String? group, RTCSessionDescription? offer})
→ Future<void>
-
configure
-
createAnswer()
→ Future<RTCSessionDescription>
-
This method is used to create webrtc answer, sets local description on internal PeerConnection object
It supports both style of answer creation that is plan-b and unified.
inherited
-
createOffer({bool audioRecv = true, bool videoRecv = true})
→ Future<RTCSessionDescription>
-
This method is used to create webrtc offer, sets local description on internal PeerConnection object
It supports both style of offer creation that is plan-b and unified.
inherited
-
createRoom(dynamic roomId, {bool permanent = true, String? description, String? secret, String? pin, int? defaultBitRate, int? defaultExpectedLoss, bool? isPrivate, bool? audioLevelExt, bool? audioLevelEvent, int? audioActivePackets, int? audioLevelAverage, List<String>? allowed, bool? record, String? recordFile, String? recordDir, int? defaultPreBuffering, String? allowRtpParticipants, int? samplingRate, List<String>? groups, bool? spatialAudio})
→ Future<AudioRoomCreatedResponse>
-
createRoom
this can be used to create a new audio room .
Notice that, in general, all users can create rooms. If you want to limit this functionality, you can configure an admin adminKey in the plugin settings. When configured, only "create" requests that include the correct adminKey value in an "adminKey" 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 saved in the config file, default=false.
description
: pretty name of the room, optional.
secret
: password required to edit/destroy the room, optional.
pin
: password required to join the room, optional.
isPrivate
: true|false, whether the room should appear in a list request.
allowed
: array of string tokens users can use to join this room, optional.
samplingRate
: sampling rate of the room, optional, 16000 by default.
spatialAudio
: true|false, whether the mix should spatially place users, default=false.
audioLevelExt
: true|false, whether the ssrc-audio-level RTP extension must be negotiated for new joins, default=true.
audioLevelEvent
: true|false (whether to emit event to other users or not).
audioActivePackets
: number of packets with audio level (default=100, 2 seconds).
audioLevelAverage
: average value of audio level (127=muted, 0='too loud', default=25).
defaultPreBuffering
: number of packets to buffer before decoding each participant (default=DEFAULT_PREBUFFERING).
defaultExpectedLoss
: percent of packets we expect participants may miss, to help with FEC (default=0, max=20; automatically used for forwarders too).
defaultBitRate
: bitrate in bps to use for the all participants (default=auto, libopus decides; automatically used for forwarders too).
record
: true|false, whether to record the room or not, default=false.
recordFile
: /path/to/the/recording.wav, optional>.
recordDir
: /path/to/, optional; makes recordFile a relative path, if provided.
allowRtpParticipants
: true|false, whether participants should be allowed to join via plain RTP as well, default=false.
groups
: non-hierarchical array of string group names to use to gat participants, for external forwarding purposes only, optional.
-
dispose()
→ Future<void>
-
This function takes care of cleaning up all the internal stream controller and timers used to make janus_client compatible with streams and polling support
inherited
-
editRoom(dynamic roomId, {String? secret, String? newDescription, String? newSecret, String? newPin, bool? newIsPrivate, bool? permanent})
→ Future
-
Once a room has been created, you can still edit some (but not all) of its properties using the edit request. This allows you to modify the room description, secret, pin and whether it's private or not: you won't be able to modify other more static properties, like the room ID, the sampling rate, the extensions-related stuff and so on. If you're interested in changing the ACL, instead, check the allowed message.
roomId
: unique numeric ID of the room to edit
secret
: room secret, mandatory if configured
newDescription
: new pretty name of the room, optional
newSecret
: new password required to edit/destroy the room, optional
newPin
: new password required to join the room, optional
newIsPrivate
: true|false, whether the room should appear in a list request
permanent
: true|false, whether the room should be also removed from the config file, default=false
-
exists(int roomId)
→ Future
-
You can check whether a room exists using the exists
inherited
-
getAudioInputDevices()
→ Future<List<MediaDeviceInfo>>
-
inherited
-
getVideoInputDevices()
→ Future<List<MediaDeviceInfo>>
-
inherited
-
handleRemoteJsep(RTCSessionDescription? data)
→ Future<void>
-
It allows you to set Remote Description on internal peer connection, Received from janus server
inherited
-
hangup()
→ Future<void>
-
override
-
initDataChannel({RTCDataChannelInit? rtcDataChannelInit})
→ Future<void>
-
this method Initialize data channel on handle's internal peer connection object.
It is mainly used for Janus TextRoom and can be used for other plugins with data channel support
inherited
-
initializeMediaDevices({Map<String, dynamic>? mediaConstraints, bool useDisplayMediaDevices = false, TransceiverDirection? transceiverDirection = TransceiverDirection.SendOnly, List<RTCRtpEncoding>? simulcastSendEncodings})
→ Future<MediaStream?>
-
Helper method that generates MediaStream from your device camera that will be automatically added to peer connection instance internally used by janus client
inherited
-
initializeWebRTCStack()
→ Future<void>
-
used to initialize/reinitialize entire webrtc stack if it is required for your application purpose
inherited
-
joinRoom(dynamic roomId, {dynamic id, String? group, String? pin, int? expectedLoss, String? display, String? token, bool? muted, String? codec, int? preBuffer, int? quality, int? volume, int? spatialPosition, String? secret, String? audioLevelAverage, String? audioActivePackets, bool? record, String? filename})
→ Future<void>
-
you use a join request to join an audio room, and wait for the joined event; this event will also include a list of the other participants, if any;
roomId
: numeric ID of the room to join
id
: unique ID to assign to the participant; optional, assigned by the plugin if missing
group
: "group to assign to this participant (for forwarding purposes only; optional, mandatory if enabled in the room)
pin
: "password required to join the room, if any; optional
display
: "display name to have in the room; optional
token
: "invitation token, in case the room has an ACL; optional
muted
: true|false, whether to start unmuted or muted
codec
: "codec to use, among opus (default), pcma (A-Law) or pcmu (mu-Law)
preBuffer
: number of packets to buffer before decoding this participant (default=room value, or DEFAULT_PREBUFFERING)
bitrate
: bitrate to use for the Opus stream in bps; optional, default=0 (libopus decides)
quality
: 0-10, Opus-related complexity to use, the higher the value, the better the quality (but more CPU); optional, default is 4
expectedLoss
: 0-20, a percentage of the expected loss (capped at 20%), only needed in case FEC is used; optional, default is 0 (FEC disabled even when negotiated) or the room default
volume
: percent value, <100 reduces volume, >100 increases volume; optional, default is 100 (no volume change)
spatialPosition
: in case spatial audio is enabled for the room, panning of this participant (0=left, 50=center, 100=right)
secret
: "room management password; optional, if provided the user is an admin and can't be globally muted with mute_room
audioLevelAverage
: "if provided, overrides the room audioLevelAverage for this user; optional
audioActivePackets
: "if provided, overrides the room audioActivePackets for this user; optional
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
-
kickParticipant(dynamic roomId, int participantId, {String? secret})
→ Future
-
kickParticipant
-
listParticipants(dynamic roomId)
→ Future<List<AudioBridgeParticipants>>
-
listParticipants
-
muteParticipant(dynamic roomId, int participantId, bool mute, {String? secret})
→ Future
-
muteParticipant
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
onCreate()
→ void
-
override
-
rtpForward(dynamic roomId, String host, int port, {String? group, String? adminKey, String? ssrc, String? codec, String? ptype, int? srtpSuite, bool? alwaysOn, String? hostFamily, String? srtpCrypto})
→ Future<RtpForwarderCreated>
-
rtpForward
-
send({dynamic data, RTCSessionDescription? jsep})
→ Future
-
This method is crucial for communicating with Janus Server's APIs it takes in data and optionally jsep for negotiating with webrtc peers
inherited
-
sendData(String message)
→ Future<void>
-
Send text message on existing text room using data channel with same label as specified during initDataChannel() method call.
inherited
-
stopRtpForward(dynamic roomId, int streamId)
→ Future<RtpForwardStopped>
-
stopRtpForward
-
switchCamera({String? deviceId})
→ Future<bool>
-
a utility method which can be used to switch camera of user device if it has more than one camera
deviceId
: device id of the camera you want to switch to
deviceId
is important for switchCamera to work in browsers.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited