WebRTC Video Chat 1.1.2
|
Main interface for platform independent video calls. More...
Public Member Functions | |
void | Configure (MediaConfig config) |
Sets the media configuration. Usually, this can only be called once before the actual call starts via .Call/Listen. | |
void | Listen (string address) |
Listens on a given address (any string shorter than 256 characters). | |
void | StopListening () |
Used by multiuser calls to block new users from joining. | |
void | Call (string address) |
Will try to connect to an address of another Call object (which called Listen). Don't use in conference mode! | |
void | Send (string message) |
Sends a text message to the connected users. | |
void | Send (string message, bool reliable) |
Same as Send(string message) but allows to send unreliable as well. | |
bool | Send (string message, bool reliable, ConnectionId id) |
Sends a string message to a specific connection and checks the status of the buffer. Prefer this call over the simplified methods! | |
void | Send (byte[] data, bool reliable) |
This will send data to all conencted users. | |
bool | Send (byte[] data, bool reliable, ConnectionId id) |
Sends the content of a byte array to the given connection and checks the status of the buffer. Prefer this call over the simplified methods! | |
void | Update () |
Call this to update the internal state of this object and trigger the events. You should do this around 30-60 times per second. | |
void | SetVolume (double volume, ConnectionId remoteUserId) |
Sets a volume for the replay of a remote connections audio stream. | |
bool | HasAudioTrack (ConnectionId remoteUserId) |
Checks if the connection with the given id has a media stream with an audio track attached. | |
bool | HasVideoTrack (ConnectionId remoteUserId) |
Checks if the connection with the given id has a media stream with an video track attached. | |
bool | IsMute () |
Checks if the local audio track (local microphone) is muted. True means it is muted. False means it isn't muted (via this system). This doesn't mean the microphone is actually sending. It still can be muted within the OS or via the physicial device. | |
void | SetMute (bool val) |
Allows to mute the local audio track (local microphone) | |
int | GetBufferedAmount (ConnectionId id, bool reliable) |
Allows to check the size of the internal message buffer. If this is above 0 the Send methods try to push more data to the network than the network layer can deliver. | |
void | Disconnect (ConnectionId id) |
Disconnects a specific connection. | |
Properties | |
bool | LocalFrameEvents [get, set] |
If this property is set to true the call object will return an Event of type FrameUpdateEventArgs each time the local video device created a new frame. Set this to false if you don't want to show the local user image or there is an alternative way to showing the frame. | |
Events | |
CallEventHandler | CallEvent |
Event handler. Returns all events from new accepted calls to frame updates of the local and remote camera. | |
Main interface for platform independent video calls.
Usage of this interface usually follows a specific pattern:
Do not forget to call Dispose method after you finished the call or the connection might run forever in the background!
void Byn.Awrtc.ICall.Call | ( | string | address | ) |
Will try to connect to an address of another Call object (which called Listen). Don't use in conference mode!
address | Any string. Max 256 characters. |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Configure | ( | MediaConfig | config | ) |
Sets the media configuration. Usually, this can only be called once before the actual call starts via .Call/Listen.
If you want to call Configure at runtime to change settings on the fly use set the flag NetworkConfig.KeepSignalingAlive (experimental)
config | The new configuration to apply. |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Disconnect | ( | ConnectionId | id | ) |
Disconnects a specific connection.
id | ID of the connection to cut. |
Implemented in Byn.Awrtc.AWebRtcCall.
int Byn.Awrtc.ICall.GetBufferedAmount | ( | ConnectionId | id, |
bool | reliable ) |
Allows to check the size of the internal message buffer. If this is above 0 the Send methods try to push more data to the network than the network layer can deliver.
id | |
reliable |
Implemented in Byn.Awrtc.AWebRtcCall.
bool Byn.Awrtc.ICall.HasAudioTrack | ( | ConnectionId | remoteUserId | ) |
Checks if the connection with the given id has a media stream with an audio track attached.
Implemented in Byn.Awrtc.AWebRtcCall.
bool Byn.Awrtc.ICall.HasVideoTrack | ( | ConnectionId | remoteUserId | ) |
Checks if the connection with the given id has a media stream with an video track attached.
Implemented in Byn.Awrtc.AWebRtcCall.
bool Byn.Awrtc.ICall.IsMute | ( | ) |
Checks if the local audio track (local microphone) is muted. True means it is muted. False means it isn't muted (via this system). This doesn't mean the microphone is actually sending. It still can be muted within the OS or via the physicial device.
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Listen | ( | string | address | ) |
Listens on a given address (any string shorter than 256 characters).
The event handler will return WaitForIncomingCall once incoming calls can be received and ListeningFailed if an error occurred.
In conference mode multiple calls listening on the same address will be connected.
address | Any string. Max 256 characters. |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Send | ( | byte[] | data, |
bool | reliable ) |
This will send data to all conencted users.
Use only for low traffic applications (e.g. text messages). Messages might be dropped if too much data is sent. Use bool Send(byte[] data, bool reliable, ConnectionId id); for advanced use cases.
data | |
reliable | true to use the TCP style channel, false for UDP style |
Implemented in Byn.Awrtc.AWebRtcCall.
bool Byn.Awrtc.ICall.Send | ( | byte[] | data, |
bool | reliable, | ||
ConnectionId | id ) |
Sends the content of a byte array to the given connection and checks the status of the buffer. Prefer this call over the simplified methods!
Make sure to check the result of this method. False indicates the data wasn't sent.
Calls to SendData will store the data in an internal buffer. Once the network is ready the data will be sent.
Pitfalls and additional information:
data | Byte array containing the data to send. Keep below 16,000,000 bytes |
reliable | True to send a reliable message(TCP style) and false to send unreliable (UDP style). Reliable messages are ordered and will be resent if lost during transmission. They can still be dropped if the internal buffer overflows (will return false). Unreliable messages are sent without a specific order and won't be resent if delivery fails even if this method returned true! |
id | The id of the recipient |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Send | ( | string | message | ) |
Sends a text message to the connected users.
Use only for low traffic applications (e.g. text messages). Messages might be dropped if too much data is sent. See bool Send(string message, bool reliable, ConnectionId id); for advanced use cases.
message |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Send | ( | string | message, |
bool | reliable ) |
Same as Send(string message) but allows to send unreliable as well.
Use only for low traffic applications (e.g. text messages). Messages might be dropped if too much data is sent. See bool Send(string message, bool reliable, ConnectionId id); for advanced use cases.
message | |
reliable |
Implemented in Byn.Awrtc.AWebRtcCall.
bool Byn.Awrtc.ICall.Send | ( | string | message, |
bool | reliable, | ||
ConnectionId | id ) |
Sends a string message to a specific connection and checks the status of the buffer. Prefer this call over the simplified methods!
For details see also the documentation of bool Send(string message, bool reliable, ConnectionId id);
message | Any string message. Keep below 8000 characters. |
reliable | true for TCP style connections, false for UDP style (messages might not be delivered) |
id | The ConnectionId to send the message two. |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.SetMute | ( | bool | val | ) |
Allows to mute the local audio track (local microphone)
True = mute False = send the microphone data if available
val | true - set to mute false - not muted |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.SetVolume | ( | double | volume, |
ConnectionId | remoteUserId ) |
Sets a volume for the replay of a remote connections audio stream.
volume | 1 = normal volume, 0 = mute, everything above 1 might increase volume but reduce quality |
remoteUserId | Id of the remote connection. |
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.StopListening | ( | ) |
Used by multiuser calls to block new users from joining.
Implemented in Byn.Awrtc.AWebRtcCall.
void Byn.Awrtc.ICall.Update | ( | ) |
Call this to update the internal state of this object and trigger the events. You should do this around 30-60 times per second.
Implemented in Byn.Awrtc.AWebRtcCall.
|
getset |
If this property is set to true the call object will return an Event of type FrameUpdateEventArgs each time the local video device created a new frame. Set this to false if you don't want to show the local user image or there is an alternative way to showing the frame.
Setting this value to false will increase performance and reduce needed memory as it avoids unnecessary image copies / processing.
Implemented in Byn.Awrtc.AWebRtcCall.
CallEventHandler Byn.Awrtc.ICall.CallEvent |
Event handler. Returns all events from new accepted calls to frame updates of the local and remote camera.
All events will be triggered during call of the Update method (see below) to avoid multi threading issues.