OpenTera WebRTC API (JavaScript) 1.2.6
Public Member Functions | List of all members
StreamDataChannelClient Class Reference

A signaling client to join a WebRTC room, stream a video source and send data channel communication. More...

Inheritance diagram for StreamDataChannelClient:
WebrtcClient

Public Member Functions

 constructor (signalingServerConfiguration, streamConfiguration, dataChannelConfiguration, rtcConfiguration, logger)
 Creates a stream data channel client. More...
 
 _createRtcPeerConnection (id, isCaller)
 
 _connectRtcPeerConnectionEvents (id, rtcPeerConnection)
 
 _disconnectRtcPeerConnectionEvents (rtcPeerConnection)
 
 _connectDataChannelEvents (id, dataChannel)
 
 _disconnectDataChannelEvents (dataChannel)
 
 _removeConnection (id)
 
 _closeAllDataChannels ()
 
 _closeAllRemoteStreams ()
 
 hangUpAll ()
 Hangs up all clients.
 
 close ()
 Closes all client connections.
 
get isLocalAudioMuted ()
 Indicates if the local audio is muted. More...
 
get isRemoteAudioMuted ()
 Indicates if the remote audio is muted. More...
 
get isLocalVideoMuted ()
 Indicates if the local video is muted. More...
 
 muteLocalAudio ()
 Mutes the local audio.
 
 unmuteLocalAudio ()
 Unmutes the local audio.
 
 setLocalAudioMuted (muted)
 Mutes or unmutes the local audio. More...
 
 muteRemoteAudio ()
 Mutes the remote audio.
 
 unmuteRemoteAudio ()
 Unmutes the remote audio.
 
 setRemoteAudioMuted (muted)
 Mutes or unmutes the remote audio. More...
 
 muteLocalVideo ()
 Mutes the local video.
 
 unmuteLocalVideo ()
 Unmutes the local video.
 
 setLocalVideoMuted (muted)
 Mutes or unmutes the local video. More...
 
 _setAllLocalTracksEnabled (kind, enabled)
 
 _setAllRemoteTracksEnabled (kind, enabled)
 
 sendTo (data, ids)
 Sends binary data to the specified clients. More...
 
 sendToAll (data)
 Sends binary data to all clients. More...
 
set onDataChannelMessage (onDataChannelMessage)
 Sets the callback that is called when data are received. More...
 
set onDataChannelOpen (onDataChannelOpen)
 Sets the callback that is called when a data channel opens. More...
 
set onDataChannelClose (onDataChannelClose)
 Sets the callback that is called when a data channel closes. More...
 
set onDataChannelError (onDataChannelError)
 Sets the callback that is called when a data channel error occurs. More...
 
set onAddRemoteStream (onAddRemoteStream)
 Sets the callback that is called when a stream is added. More...
 
- Public Member Functions inherited from WebrtcClient
 constructor (signalingServerConfiguration, logger)
 Creates a signaling client with the specified configurations. More...
 
 _connectSignalingClientCallbacks ()
 
async connect ()
 Connects the client the signaling server. More...
 
 _disconnect ()
 
async _peerCallReceived (data)
 
async _peerCallAnswerReceived (data)
 
async _addIceCandidate (data)
 
async _makePeerCall (ids)
 
async _getCallAcceptance (id)
 
 _connectRtcPeerConnectionEvents (id, rtcPeerConnection)
 
 _disconnectRtcPeerConnectionEvents (rtcPeerConnection)
 
 _removeConnection (id, callOnClientDisconnect)
 
 _addConnectionStateToClients (clients)
 
 _updateClientNamesById (clients)
 
 _updateClientDatumById (clients)
 
 _hasRtcPeerConnection (id)
 
 _getAllRtcPeerConnection ()
 
 _closeAllRtcPeerConnections ()
 
 updateRoomClients ()
 
 close ()
 Closes all client connections.
 
 callAll ()
 Calls all room clients.
 
 callIds (ids)
 Calls the specified clients. More...
 
 hangUpAll ()
 Hangs up all clients.
 
 closeAllRoomPeerConnections ()
 Closes all room peer connections.
 
 getClientName (id)
 Gets the client name from the client id. More...
 
 getClientData (id)
 Gets the client data from the client id. More...
 
get isConnected ()
 Indicates if the client is connected to the signaling server. More...
 
get isRtcConnected ()
 Indicates if the client is connected to at least one client (RTCPeerConnection). More...
 
get id ()
 Returns the client id. More...
 
get connectedRoomClientIds ()
 Returns the connected room client ids. More...
 
get roomClients ()
 Returns the room clients. More...
 
set onSignalingConnectionOpen (onSignalingConnectionOpen)
 Sets the callback that is called when the signaling connection opens. More...
 
set onSignalingConnectionClose (onSignalingConnectionClose)
 Sets the callback that is called when the signaling connection closes. More...
 
set onSignalingConnectionError (onSignalingConnectionError)
 Sets the callback that is called when a signaling connection error occurs. More...
 
set onRoomClientsChange (onRoomClientsChange)
 Sets the callback that is called when the room client changes. More...
 
set callAcceptor (callAcceptor)
 Sets the callback that is used to accept or reject a call. More...
 
set onCallReject (onCallReject)
 Sets the callback that is called when a call is rejected. More...
 
set onClientConnect (onClientConnect)
 Sets the callback that is called when a client peer connection opens. More...
 
set onClientDisconnect (onClientDisconnect)
 Sets the callback that is called when a client peer connection closes. More...
 
set onClientConnectionFail (onClientConnectionFail)
 Sets the callback that is called when a client peer connection fails. More...
 

Detailed Description

A signaling client to join a WebRTC room, stream a video source and send data channel communication.

Member Function Documentation

◆ constructor()

StreamDataChannelClient::constructor (   signalingServerConfiguration,
  streamConfiguration,
  dataChannelConfiguration,
  rtcConfiguration,
  logger 
)
inline

Creates a stream data channel client.

Parameters
{Object}signalingServerConfiguration The signaling server configuration
{
url: 'signaling server URL',
name: 'client name',
data: {}, // Client custom data
room: 'room name',
password: 'password'
}
{Object}streamConfiguration The stream configuration
{
localStream: localVideo.srcObject, // Optional
isSendOnly: false
}
{Object}dataChannelConfiguration The data channel configuration See https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createDataChannel options parameter
{Object}rtcConfiguration The RTC configuration See https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection configuration parameter
{CallableFunction}logger An optional logger callback

◆ isLocalAudioMuted()

get StreamDataChannelClient::isLocalAudioMuted ( )
inline

Indicates if the local audio is muted.

Returns
{Boolean} true if the local audio is muted.

◆ isLocalVideoMuted()

get StreamDataChannelClient::isLocalVideoMuted ( )
inline

Indicates if the local video is muted.

Returns
{Boolean} true if the local audio is muted.

◆ isRemoteAudioMuted()

get StreamDataChannelClient::isRemoteAudioMuted ( )
inline

Indicates if the remote audio is muted.

Returns
{Boolean} true if the remote audio is muted.

◆ onAddRemoteStream()

set StreamDataChannelClient::onAddRemoteStream (   onAddRemoteStream)
inline

Sets the callback that is called when a stream is added.

Callback parameters:
  • clientId: The client id
  • clientName: The client name
  • clientData: The client data
  • remoteStream: The remote stream
Parameters
{CallableFunction}onAddRemoteStream The callback

◆ onDataChannelClose()

set StreamDataChannelClient::onDataChannelClose (   onDataChannelClose)
inline

Sets the callback that is called when a data channel closes.

Callback parameters:
  • clientId: The client id
  • clientName: The client name
  • clientData: The client data
Parameters
{CallableFunction}onDataChannelClose

◆ onDataChannelError()

set StreamDataChannelClient::onDataChannelError (   onDataChannelError)
inline

Sets the callback that is called when a data channel error occurs.

Callback parameters:
  • clientId: The client id
  • event: The error event
Parameters
{CallableFunction}onDataChannelError

◆ onDataChannelMessage()

set StreamDataChannelClient::onDataChannelMessage (   onDataChannelMessage)
inline

Sets the callback that is called when data are received.

Callback parameters:
  • clientId: The client id
  • clientName: The client name
  • clientData: The client data
  • data: The message data
Parameters
{CallableFunction}onDataChannelMessage The callback

◆ onDataChannelOpen()

set StreamDataChannelClient::onDataChannelOpen (   onDataChannelOpen)
inline

Sets the callback that is called when a data channel opens.

Callback parameters:
  • clientId: The client id
  • clientName: The client name
  • clientData: The client data
Parameters
{CallableFunction}onDataChannelOpen The callback

◆ sendTo()

StreamDataChannelClient::sendTo (   data,
  ids 
)
inline

Sends binary data to the specified clients.

Parameters
{String| Blob | ArrayBuffer} data The data
{Array<String>}ids The client ids

◆ sendToAll()

StreamDataChannelClient::sendToAll (   data)
inline

Sends binary data to all clients.

Parameters
{String| Blob | ArrayBuffer} data

◆ setLocalAudioMuted()

StreamDataChannelClient::setLocalAudioMuted (   muted)
inline

Mutes or unmutes the local audio.

Parameters
{Boolean}muted indicates if the local audio is muted or not

◆ setLocalVideoMuted()

StreamDataChannelClient::setLocalVideoMuted (   muted)
inline

Mutes or unmutes the local video.

Parameters
{Boolean}muted indicates if the local video is muted or not

◆ setRemoteAudioMuted()

StreamDataChannelClient::setRemoteAudioMuted (   muted)
inline

Mutes or unmutes the remote audio.

Parameters
{Boolean}muted indicates if the remote audio is muted or not

The documentation for this class was generated from the following file: