JanusTextRoomPlugin class
Constructors
-
JanusTextRoomPlugin({dynamic handleId, dynamic context, dynamic transport, dynamic session})
-
Methods
-
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({String? roomId, String? adminKey, String? description, String? secret, String? pin, bool? isPrivate, int? history, bool? permanent})
→ Future
-
this can be used to create a new text 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 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.
adminKey
: plugin administrator key; mandatory if configured.
history
: number of messages to store as a history, and send back to new participants (default=0, no history)
-
destroyRoom({int? roomId, String? secret, bool? permanent})
→ Future
-
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.
-
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({String? roomId, String? description, String? secret, String? newSecret, String? pin, bool? isPrivate, bool? permanent})
→ Future
-
editRoom
this can be used to create a new text 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 saved in the config file, default=false.
description
: pretty name of the room, optional.
secret
: existing password required to edit/destroy the room, optional.
newSecret
: new 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.
-
exists(dynamic roomId)
→ Future<bool?>
-
You can check whether a room exists using the exists
override
-
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>
-
inherited
-
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(int roomId, String username, {String? pin, String? display, String? token, bool? history})
→ Future<void>
-
joinRoom
-
kickParticipant(dynamic roomId, String username, {String? secret})
→ Future
-
If you're the administrator of a room (that is, you created it and have access to the secret) you can kick out individual participant.
roomId
unique numeric ID of the room to stop the forwarder from.
username
username of the participant to kick.
secret
admin secret should be provided if configured.
-
leaveRoom(int roomId)
→ Future<void>
-
you use a leave request to leave already joined Text Room, make sure to call setup before calling leaveRoom
roomId
: numeric ID of the room to join.
-
listParticipants(dynamic roomId)
→ Future<List?>
-
-
listRooms()
→ Future<List<JanusTextRoom>?>
-
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
onCreate()
→ void
-
inherited
-
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
-
sendMessage(dynamic roomId, String text, {bool? ack, String? to, List<String>? tos})
→ Future<void>
-
roomId
: numeric ID of the room to join.
text
: content of the message to send, as a string.
ack
: true|false, whether the sender wants an ack for the sent message(s); optional, true by default
.
to
: username to send the message to; optional, only needed in case of private messages.
tos
: array of usernames to send the message to; optional, only needed in case of private messages.
-
setup()
→ Future<void>
-
setup
setup is a method to be called very early to negotiate open PeerConnection on which data channels can be created and further operations of text room can be performed.
-
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