WebRTC Video Chat 1.1.4
Loading...
Searching...
No Matches
Byn.Awrtc.AWebRtcCall Class Referenceabstract

Abstract base call class. Used for shared functionality between all platforms. More...

Inheritance diagram for Byn.Awrtc.AWebRtcCall:
Byn.Awrtc.ICall

Public Member Functions

 AWebRtcCall (NetworkConfig config=null)
 Creates a new call using a given NetworkConfig object.
 
virtual void Configure (MediaConfig config)
 Configures the camera/audio devices used for the call.
 
virtual void Call (string address)
 Starts an outgoing call. Only supported in direct mode. Use Listen to connect in conference mode no matter if ingoing or outgoing.
 
virtual void Listen (string address=null)
 Listens to incoming calls on the given address.
 
virtual void StopListening ()
 Stops the call from accepting any new connections. This is for use in conference mode only.
 
void Send (string message)
 Send a string to all connected systems.
 
void Send (string message, bool reliable)
 Sends a text message to all connected peers.
 
bool Send (string message, bool reliable, ConnectionId id)
 Send a string to a specific receiver using a set channel.
 
void Send (byte[] data, bool reliable)
 Sends data to all connections using a set channel.
 
bool Send (byte[] data, bool reliable, ConnectionId id)
 Implements send method as defined in the interface.
 
virtual void Update ()
 Updates the call. Should be called around 30 times per second to move data from browser / native webrtc to this call object (and the used thread)
 
void Dispose ()
 Destroys the call object and released underlaying resources.
 
void SetVolume (double volume, ConnectionId remoteUserId)
 Sets the volume. 0 = silent, 1 = full volume. Values outside this range might result in undefined behavior (platform dependent).
 
bool HasAudioTrack (ConnectionId remoteUserId)
 True if the connection is sending an audio track.
 
bool HasVideoTrack (ConnectionId remoteUserId)
 True if the connection is sending video.
 
bool IsMute ()
 Indicates if the sending audio is muted via the SetMute method.
 
void SetMute (bool val)
 Mutes the outgoing audio.
 
int GetBufferedAmount (ConnectionId id, bool reliable)
 Experimental. For testing only. Might be removed again.
 
void Disconnect (ConnectionId id)
 Disconnects a specific call only.
 

Protected Member Functions

void Initialize (IMediaNetwork network)
 Needs to be called by the subclass.
 
virtual void StopListeningInternal ()
 Stops new incoming calls.
 
virtual void HandleMediaEvents ()
 Called after HandleNetworkEvents and before Flush. It will handle the video frames and subclasses can use it to handle additional video or audio data.
 
virtual void HandleNetworkEvent (NetworkEvent evt)
 Method is called to handle the network events triggered by the internal media network and trigger related event handlers for the call object.
 
void TriggerCallEvent (CallEventArgs args)
 Will send out data to the user.
 
virtual void Dispose (bool disposing)
 Destroys the call.
 

Protected Attributes

NetworkConfig mNetworkConfig = new NetworkConfig()
 Used network configuration.
 
MediaConfig mMediaConfig = null
 Media configuration or null if no media is configured. != null doesn't mean the configuration was accepted.
 
IMediaNetwork mNetwork
 Local media network doing all the hard work.
 
List< ConnectionIdmConnectionIds = new List<ConnectionId>()
 Keeps track of all connected users.
 
Dictionary< ConnectionId, string > mPendingOutgoingCalls = new Dictionary<ConnectionId, string>()
 Calls that are currently attempted but haven't been accepted yet.
 
bool mPendingStopListen = false
 Set to true if the user requests to stop listening to correctly handle the following ServerStop event. If this is true a StopServer event is expected and returned as event. If this is false a StopServer event is treated as an error (disconnected from signaling server).
 

Properties

ListeningState ListeningState [get]
 Gets the current listening state of the call. Inactive - if we don't allow incoming connections / wait for calls. RequestingAddress - if we are waiting for a server response weather can can use a specific address Listening - if we are listening on an address and waiting for a connection.
 
MediaConfigState MediaState [get]
 Returns the current media configuration state.
 
bool IsDisposed [get]
 Will return true after Dispose is called. Just for testing. Software should be designed to never need this.
 
bool LocalFrameEvents [get, set]
 Set to true to block delivery of local frames to increase performance.
 
bool InCall [get]
 Returns true if there is at least one active connection.
 
bool HasPendingOutgoingCalls [get]
 True if there are outgoing calls pending.
 

Events

CallEventHandler CallEvent
 Event handler. All call events are delivered via this event handler.
 
- Events inherited from Byn.Awrtc.ICall
CallEventHandler CallEvent
 Event handler. Returns all events from new accepted calls to frame updates of the local and remote camera.
 

Detailed Description

Abstract base call class. Used for shared functionality between all platforms.

Constructor & Destructor Documentation

◆ AWebRtcCall()

Byn.Awrtc.AWebRtcCall.AWebRtcCall ( NetworkConfig config = null)

Creates a new call using a given NetworkConfig object.

Parameters
configNetworkConfig deciding url of the signaling server + WebRTC ice servers.

Member Function Documentation

◆ Call()

virtual void Byn.Awrtc.AWebRtcCall.Call ( string address)
virtual

Starts an outgoing call. Only supported in direct mode. Use Listen to connect in conference mode no matter if ingoing or outgoing.

Parameters
address

Implements Byn.Awrtc.ICall.

◆ Configure()

virtual void Byn.Awrtc.AWebRtcCall.Configure ( MediaConfig config)
virtual

Configures the camera/audio devices used for the call.

Parameters
config

Implements Byn.Awrtc.ICall.

◆ Disconnect()

void Byn.Awrtc.AWebRtcCall.Disconnect ( ConnectionId id)

Disconnects a specific call only.

Parameters
idConnectionId for the call to disconnect.

Implements Byn.Awrtc.ICall.

◆ Dispose()

virtual void Byn.Awrtc.AWebRtcCall.Dispose ( bool disposing)
protectedvirtual

Destroys the call.

Parameters
disposing

◆ GetBufferedAmount()

int Byn.Awrtc.AWebRtcCall.GetBufferedAmount ( ConnectionId id,
bool reliable )

Experimental. For testing only. Might be removed again.

Implements Byn.Awrtc.ICall.

◆ HandleNetworkEvent()

virtual void Byn.Awrtc.AWebRtcCall.HandleNetworkEvent ( NetworkEvent evt)
protectedvirtual

Method is called to handle the network events triggered by the internal media network and trigger related event handlers for the call object.

Parameters
evt

◆ HasAudioTrack()

bool Byn.Awrtc.AWebRtcCall.HasAudioTrack ( ConnectionId remoteUserId)

True if the connection is sending an audio track.

Parameters
remoteUserId
Returns
True if an outgoing audio track is attached.

Implements Byn.Awrtc.ICall.

◆ HasVideoTrack()

bool Byn.Awrtc.AWebRtcCall.HasVideoTrack ( ConnectionId remoteUserId)

True if the connection is sending video.

Parameters
remoteUserId
Returns
True if an outgoing video track is attached

Implements Byn.Awrtc.ICall.

◆ IsMute()

bool Byn.Awrtc.AWebRtcCall.IsMute ( )

Indicates if the sending audio is muted via the SetMute method.

Note: If the OS or hardware mutes the audio or the audio source simply returns silence this method will not return true!

Returns
True if audio was muted via SetMute.

Implements Byn.Awrtc.ICall.

◆ Listen()

virtual void Byn.Awrtc.AWebRtcCall.Listen ( string address = null)
virtual

Listens to incoming calls on the given address.

Parameters
address

Implements Byn.Awrtc.ICall.

◆ Send() [1/5]

void Byn.Awrtc.AWebRtcCall.Send ( byte[] data,
bool reliable )

Sends data to all connections using a set channel.

Parameters
data
reliable

Implements Byn.Awrtc.ICall.

◆ Send() [2/5]

bool Byn.Awrtc.AWebRtcCall.Send ( byte[] data,
bool reliable,
ConnectionId id )

Implements send method as defined in the interface.

Parameters
data
reliable
id
Returns

Implements Byn.Awrtc.ICall.

◆ Send() [3/5]

void Byn.Awrtc.AWebRtcCall.Send ( string message)

Send a string to all connected systems.

Parameters
message

Implements Byn.Awrtc.ICall.

◆ Send() [4/5]

void Byn.Awrtc.AWebRtcCall.Send ( string message,
bool reliable )

Sends a text message to all connected peers.

Parameters
messageAny text message
reliableSet false for sending messages unreliably

Implements Byn.Awrtc.ICall.

◆ Send() [5/5]

bool Byn.Awrtc.AWebRtcCall.Send ( string message,
bool reliable,
ConnectionId id )

Send a string to a specific receiver using a set channel.

Parameters
message
reliable
id
Returns

Implements Byn.Awrtc.ICall.

◆ SetMute()

void Byn.Awrtc.AWebRtcCall.SetMute ( bool val)

Mutes the outgoing audio.

Parameters
valSet to true to mute audio.

Implements Byn.Awrtc.ICall.

◆ SetVolume()

void Byn.Awrtc.AWebRtcCall.SetVolume ( double volume,
ConnectionId remoteUserId )

Sets the volume. 0 = silent, 1 = full volume. Values outside this range might result in undefined behavior (platform dependent).

Parameters
volumeValue between 0 and 1.
remoteUserIdConnectionId this value applies to.

Implements Byn.Awrtc.ICall.

◆ StopListening()

virtual void Byn.Awrtc.AWebRtcCall.StopListening ( )
virtual

Stops the call from accepting any new connections. This is for use in conference mode only.

StopListening is always safe to call.

Implements Byn.Awrtc.ICall.

◆ TriggerCallEvent()

void Byn.Awrtc.AWebRtcCall.TriggerCallEvent ( CallEventArgs args)
protected

Will send out data to the user.

Parameters
args

◆ Update()

virtual void Byn.Awrtc.AWebRtcCall.Update ( )
virtual

Updates the call. Should be called around 30 times per second to move data from browser / native webrtc to this call object (and the used thread)

Implements Byn.Awrtc.ICall.

Property Documentation

◆ ListeningState

ListeningState Byn.Awrtc.AWebRtcCall.ListeningState
get

Gets the current listening state of the call. Inactive - if we don't allow incoming connections / wait for calls. RequestingAddress - if we are waiting for a server response weather can can use a specific address Listening - if we are listening on an address and waiting for a connection.

Note this component reflects the state when the Update method was last called.

◆ LocalFrameEvents

bool Byn.Awrtc.AWebRtcCall.LocalFrameEvents
getset

Set to true to block delivery of local frames to increase performance.

Implements Byn.Awrtc.ICall.


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