Class VoiceCall
A 1:1 call with another user, as the apps show it: its state, mute and camera, and the other's pictures; a LegacyCall of m.call.* events, or a RtcCall of MatrixRTC through a LiveKit SFU.
Namespace: Uniform.Matrix.Calls
Assembly: Uniform.Matrix.Calls.dll
public abstract class VoiceCall : IAsyncDisposable
Properties
|
Edit this page
View Source
Declaration
public string CallId { get; }
Property Value
|
Edit this page
View Source
Whether this side's camera is turned off: nothing is captured or sent until it is turned on.
Declaration
public bool CameraOff { get; set; }
Property Value
|
Edit this page
View Source
Whether this side's device has another camera to switch to.
Declaration
public bool CanSwitchCamera { get; }
Property Value
|
Edit this page
View Source
When voice started to flow; null before.
Declaration
public DateTimeOffset? ConnectedAt { get; }
Property Value
|
Edit this page
View Source
Why the call ended, e.g. user_hangup, rejected, invite_timeout, ice_failed or answered_elsewhere; null until ended.
Declaration
public string? EndReason { get; }
Property Value
|
Edit this page
View Source
Whether the other side ended the call.
Declaration
public bool EndedByPeer { get; }
Property Value
|
Edit this page
View Source
Whether the other user called.
Declaration
public abstract bool IsIncoming { get; }
Property Value
|
Edit this page
View Source
Whether the call has video, which this side can show.
Declaration
public bool IsVideo { get; }
Property Value
|
Edit this page
View Source
Whether this side's microphone is muted.
Declaration
public bool Muted { get; set; }
Property Value
|
Edit this page
View Source
The local and remote candidates the media goes through, once connected, e.g. to show whether it is relayed.
Declaration
public virtual (IceCandidate? Local, IceCandidate? Remote) Path { get; }
Property Value
|
Edit this page
View Source
Declaration
public string PeerUserId { get; }
Property Value
|
Edit this page
View Source
Declaration
public string RoomId { get; }
Property Value
|
Edit this page
View Source
Whether this side sends its camera's video in the call.
Declaration
public bool SendsVideo { get; }
Property Value
|
Edit this page
View Source
Declaration
public CallState State { get; }
Property Value
Methods
|
Edit this page
View Source
Answer an incoming call, and connect; this side sends no video.
Declaration
public Task AnswerAsync(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Answer an incoming call with this side's camera too, when the platform has a camera; and connect.
Declaration
public Task AnswerWithVideoAsync(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
End the call without telling the peer, and release the media.
Declaration
public ValueTask DisposeAsync()
Returns
|
Edit this page
View Source
Hang up, or cancel an outgoing call that rings.
Declaration
public abstract Task HangupAsync(string reason = "user_hangup", CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Decline an incoming call.
Declaration
public abstract Task RejectAsync(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Reopen the microphone and speaker, e.g. to switch between the earpiece and the loudspeaker, which phones choose when the speaker opens.
Declaration
public Task RestartAudioAsync()
Returns
|
Edit this page
View Source
Restart the media path, e.g. after the network changed; nothing where the call cannot.
Declaration
public virtual Task RestartIceAsync(string reason, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Switch the camera sent, e.g. from the front to the back.
Declaration
public void SwitchCamera()
Events
|
Edit this page
View Source
Raised when State or Muted changes; on any thread.
Declaration
public event Action<VoiceCall>? Changed
Event Type
|
Edit this page
View Source
Raised with each picture of the peer's video, on a decoding thread; a handler should be quick, e.g. keep the newest picture to show.
Declaration
public event Action<VoiceCall, VideoFrame>? PictureReceived
Event Type
|
Edit this page
View Source
Raised with small pictures of this side's camera, for a preview; on any thread.
Declaration
public event Action<VoiceCall, VideoFrame>? PreviewReceived
Event Type
Implements