< Summary

Information
Class: LiveKit.Rtc.TranscriptionReceivedEventArgs
Assembly: LivekitRtc
File(s): /home/runner/work/livekit-server-sdk-dotnet/livekit-server-sdk-dotnet/LivekitRtc/Events.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 504
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%

File(s)

/home/runner/work/livekit-server-sdk-dotnet/livekit-server-sdk-dotnet/LivekitRtc/Events.cs

#LineLine coverage
 1// author: https://github.com/pabloFuente
 2
 3using System;
 4using System.Collections.Generic;
 5
 6namespace LiveKit.Rtc
 7{
 8    /// <summary>
 9    /// Event arguments for local track published events.
 10    /// </summary>
 11    public class LocalTrackPublishedEventArgs : EventArgs
 12    {
 13        /// <summary>
 14        /// The publication that was published/unpublished.
 15        /// </summary>
 16        public LocalTrackPublication Publication { get; }
 17
 18        /// <summary>
 19        /// The local participant.
 20        /// </summary>
 21        public LocalParticipant Participant { get; }
 22
 23        internal LocalTrackPublishedEventArgs(
 24            LocalTrackPublication publication,
 25            LocalParticipant participant
 26        )
 27        {
 28            Publication = publication;
 29            Participant = participant;
 30        }
 31    }
 32
 33    /// <summary>
 34    /// Event arguments for remote track published events.
 35    /// </summary>
 36    public class TrackPublishedEventArgs : EventArgs
 37    {
 38        /// <summary>
 39        /// The publication that was published/unpublished.
 40        /// </summary>
 41        public RemoteTrackPublication Publication { get; }
 42
 43        /// <summary>
 44        /// The remote participant.
 45        /// </summary>
 46        public RemoteParticipant Participant { get; }
 47
 48        internal TrackPublishedEventArgs(
 49            RemoteTrackPublication publication,
 50            RemoteParticipant participant
 51        )
 52        {
 53            Publication = publication;
 54            Participant = participant;
 55        }
 56    }
 57
 58    /// <summary>
 59    /// Event arguments for track subscribed events.
 60    /// </summary>
 61    public class TrackSubscribedEventArgs : EventArgs
 62    {
 63        /// <summary>
 64        /// The subscribed track.
 65        /// </summary>
 66        public RemoteTrack Track { get; }
 67
 68        /// <summary>
 69        /// The track publication.
 70        /// </summary>
 71        public RemoteTrackPublication Publication { get; }
 72
 73        /// <summary>
 74        /// The remote participant.
 75        /// </summary>
 76        public RemoteParticipant Participant { get; }
 77
 78        internal TrackSubscribedEventArgs(
 79            RemoteTrack track,
 80            RemoteTrackPublication publication,
 81            RemoteParticipant participant
 82        )
 83        {
 84            Track = track;
 85            Publication = publication;
 86            Participant = participant;
 87        }
 88    }
 89
 90    /// <summary>
 91    /// Event arguments for track muted events.
 92    /// </summary>
 93    public class TrackMutedEventArgs : EventArgs
 94    {
 95        /// <summary>
 96        /// The track publication.
 97        /// </summary>
 98        public TrackPublication Publication { get; }
 99
 100        /// <summary>
 101        /// The participant.
 102        /// </summary>
 103        public Participant Participant { get; }
 104
 105        internal TrackMutedEventArgs(TrackPublication publication, Participant participant)
 106        {
 107            Publication = publication;
 108            Participant = participant;
 109        }
 110    }
 111
 112    /// <summary>
 113    /// Event arguments for active speakers changed events.
 114    /// </summary>
 115    public class ActiveSpeakersChangedEventArgs : EventArgs
 116    {
 117        /// <summary>
 118        /// The list of active speakers.
 119        /// </summary>
 120        public IReadOnlyList<Participant> Speakers { get; }
 121
 122        internal ActiveSpeakersChangedEventArgs(IReadOnlyList<Participant> speakers)
 123        {
 124            Speakers = speakers;
 125        }
 126    }
 127
 128    /// <summary>
 129    /// Event arguments for connection quality changed events.
 130    /// </summary>
 131    public class ConnectionQualityChangedEventArgs : EventArgs
 132    {
 133        /// <summary>
 134        /// The new connection quality.
 135        /// </summary>
 136        public Proto.ConnectionQuality Quality { get; }
 137
 138        /// <summary>
 139        /// The participant whose connection quality changed.
 140        /// </summary>
 141        public Participant Participant { get; }
 142
 143        internal ConnectionQualityChangedEventArgs(
 144            Proto.ConnectionQuality quality,
 145            Participant participant
 146        )
 147        {
 148            Quality = quality;
 149            Participant = participant;
 150        }
 151    }
 152
 153    /// <summary>
 154    /// Event arguments for data received events.
 155    /// </summary>
 156    public class DataReceivedEventArgs : EventArgs
 157    {
 158        /// <summary>
 159        /// The received data.
 160        /// </summary>
 161        public byte[] Data { get; }
 162
 163        /// <summary>
 164        /// The participant who sent the data (null if from server).
 165        /// </summary>
 166        public Participant? Participant { get; }
 167
 168        /// <summary>
 169        /// The data packet kind.
 170        /// </summary>
 171        public Proto.DataPacketKind Kind { get; }
 172
 173        /// <summary>
 174        /// The topic of the data message.
 175        /// </summary>
 176        public string? Topic { get; }
 177
 178        internal DataReceivedEventArgs(
 179            byte[] data,
 180            Participant? participant,
 181            Proto.DataPacketKind kind,
 182            string? topic
 183        )
 184        {
 185            Data = data;
 186            Participant = participant;
 187            Kind = kind;
 188            Topic = topic;
 189        }
 190    }
 191
 192    /// <summary>
 193    /// Event arguments for local track subscribed events.
 194    /// </summary>
 195    public class LocalTrackSubscribedEventArgs : EventArgs
 196    {
 197        /// <summary>
 198        /// The local track publication that was subscribed.
 199        /// </summary>
 200        public LocalTrackPublication Publication { get; }
 201
 202        internal LocalTrackSubscribedEventArgs(LocalTrackPublication publication)
 203        {
 204            Publication = publication;
 205        }
 206    }
 207
 208    /// <summary>
 209    /// Event arguments for track subscription failed events.
 210    /// </summary>
 211    public class TrackSubscriptionFailedEventArgs : EventArgs
 212    {
 213        /// <summary>
 214        /// The SID of the track that failed to subscribe.
 215        /// </summary>
 216        public string TrackSid { get; }
 217
 218        /// <summary>
 219        /// The participant whose track failed to subscribe.
 220        /// </summary>
 221        public RemoteParticipant Participant { get; }
 222
 223        /// <summary>
 224        /// The error message describing why the subscription failed.
 225        /// </summary>
 226        public string Error { get; }
 227
 228        internal TrackSubscriptionFailedEventArgs(
 229            string trackSid,
 230            RemoteParticipant participant,
 231            string error
 232        )
 233        {
 234            TrackSid = trackSid;
 235            Participant = participant;
 236            Error = error;
 237        }
 238    }
 239
 240    /// <summary>
 241    /// Event arguments for participant attributes changed events.
 242    /// </summary>
 243    public class ParticipantAttributesChangedEventArgs : EventArgs
 244    {
 245        /// <summary>
 246        /// The participant whose attributes changed.
 247        /// </summary>
 248        public Participant Participant { get; }
 249
 250        /// <summary>
 251        /// All current attributes of the participant.
 252        /// </summary>
 253        public IReadOnlyDictionary<string, string> Attributes { get; }
 254
 255        /// <summary>
 256        /// The attributes that changed (subset of all attributes).
 257        /// </summary>
 258        public IReadOnlyDictionary<string, string> ChangedAttributes { get; }
 259
 260        internal ParticipantAttributesChangedEventArgs(
 261            Participant participant,
 262            IReadOnlyDictionary<string, string> attributes,
 263            IReadOnlyDictionary<string, string> changedAttributes
 264        )
 265        {
 266            Participant = participant;
 267            Attributes = attributes;
 268            ChangedAttributes = changedAttributes;
 269        }
 270    }
 271
 272    /// <summary>
 273    /// Event arguments for participant encryption status changed events.
 274    /// </summary>
 275    public class ParticipantEncryptionStatusChangedEventArgs : EventArgs
 276    {
 277        /// <summary>
 278        /// The participant whose encryption status changed.
 279        /// </summary>
 280        public Participant Participant { get; }
 281
 282        /// <summary>
 283        /// Whether the participant is encrypted.
 284        /// </summary>
 285        public bool IsEncrypted { get; }
 286
 287        internal ParticipantEncryptionStatusChangedEventArgs(
 288            Participant participant,
 289            bool isEncrypted
 290        )
 291        {
 292            Participant = participant;
 293            IsEncrypted = isEncrypted;
 294        }
 295    }
 296
 297    /// <summary>
 298    /// Event arguments for chat message received events.
 299    /// </summary>
 300    public class ChatMessageReceivedEventArgs : EventArgs
 301    {
 302        /// <summary>
 303        /// The chat message.
 304        /// </summary>
 305        public Proto.ChatMessage Message { get; }
 306
 307        /// <summary>
 308        /// The participant who sent the message (null if from server).
 309        /// </summary>
 310        public Participant? Participant { get; }
 311
 312        internal ChatMessageReceivedEventArgs(Proto.ChatMessage message, Participant? participant)
 313        {
 314            Message = message;
 315            Participant = participant;
 316        }
 317    }
 318
 319    /// <summary>
 320    /// Event arguments for SIP DTMF received events.
 321    /// </summary>
 322    public class SipDtmfReceivedEventArgs : EventArgs
 323    {
 324        /// <summary>
 325        /// The DTMF code.
 326        /// </summary>
 327        public uint Code { get; }
 328
 329        /// <summary>
 330        /// The DTMF digit (if applicable).
 331        /// </summary>
 332        public string? Digit { get; }
 333
 334        /// <summary>
 335        /// The participant who sent the DTMF.
 336        /// </summary>
 337        public RemoteParticipant Participant { get; }
 338
 339        internal SipDtmfReceivedEventArgs(uint code, string? digit, RemoteParticipant participant)
 340        {
 341            Code = code;
 342            Digit = digit;
 343            Participant = participant;
 344        }
 345    }
 346
 347    /// <summary>
 348    /// Event arguments for E2EE state changed events.
 349    /// </summary>
 350    public class E2EEStateChangedEventArgs : EventArgs
 351    {
 352        /// <summary>
 353        /// The participant whose encryption state changed.
 354        /// </summary>
 355        public Participant Participant { get; }
 356
 357        /// <summary>
 358        /// The new encryption state.
 359        /// </summary>
 360        public Proto.EncryptionState State { get; }
 361
 362        internal E2EEStateChangedEventArgs(Participant participant, Proto.EncryptionState state)
 363        {
 364            Participant = participant;
 365            State = state;
 366        }
 367    }
 368
 369    /// <summary>
 370    /// Event arguments for transcription received events.
 371    /// </summary>
 372    public class TranscriptionReceivedEventArgs : EventArgs
 373    {
 374        /// <summary>
 375        /// The participant whose transcription was received (null if not applicable).
 376        /// </summary>
 377        public Participant? Participant { get; }
 378
 379        /// <summary>
 380        /// The track SID associated with the transcription (null if not applicable).
 381        /// </summary>
 382        public string? TrackSid { get; }
 383
 384        /// <summary>
 385        /// The transcription segments.
 386        /// </summary>
 387        public IReadOnlyList<Proto.TranscriptionSegment> Segments { get; }
 388
 1389        internal TranscriptionReceivedEventArgs(
 1390            Participant? participant,
 1391            string? trackSid,
 1392            IReadOnlyList<Proto.TranscriptionSegment> segments
 1393        )
 1394        {
 395            Participant = participant;
 396            TrackSid = trackSid;
 397            Segments = segments;
 1398        }
 399    }
 400
 401    /// <summary>
 402    /// Event arguments for participant permissions changed events.
 403    /// </summary>
 404    public class ParticipantPermissionsChangedEventArgs : EventArgs
 405    {
 406        /// <summary>
 407        /// The participant whose permissions changed (local or remote).
 408        /// </summary>
 409        public Participant Participant { get; }
 410
 411        /// <summary>
 412        /// The new permissions, or null if the server cleared them.
 413        /// </summary>
 414        public Proto.ParticipantPermission? Permissions { get; }
 415
 416        internal ParticipantPermissionsChangedEventArgs(
 417            Participant participant,
 418            Proto.ParticipantPermission? permissions
 419        )
 420        {
 421            Participant = participant;
 422            Permissions = permissions;
 423        }
 424    }
 425
 426    /// <summary>
 427    /// Event arguments for local track republished events.
 428    /// </summary>
 429    public class LocalTrackRepublishedEventArgs : EventArgs
 430    {
 431        /// <summary>
 432        /// The publication, already updated in place with the new server-assigned SIDs.
 433        /// </summary>
 434        public LocalTrackPublication Publication { get; }
 435
 436        /// <summary>
 437        /// The SID the publication had before the reconnect, for reconciling state keyed by it.
 438        /// </summary>
 439        public string PreviousSid { get; }
 440
 441        /// <summary>
 442        /// The local participant.
 443        /// </summary>
 444        public LocalParticipant Participant { get; }
 445
 446        internal LocalTrackRepublishedEventArgs(
 447            LocalTrackPublication publication,
 448            string previousSid,
 449            LocalParticipant participant
 450        )
 451        {
 452            Publication = publication;
 453            PreviousSid = previousSid;
 454            Participant = participant;
 455        }
 456    }
 457
 458    /// <summary>
 459    /// Event arguments for data track unpublished events.
 460    /// </summary>
 461    public class DataTrackUnpublishedEventArgs : EventArgs
 462    {
 463        /// <summary>
 464        /// SID of the unpublished data track.
 465        /// </summary>
 466        public string Sid { get; }
 467
 468        /// <summary>
 469        /// The remote data track, if it was delivered earlier by <see cref="Room.DataTrackPublished"/>.
 470        /// </summary>
 471        public RemoteDataTrack? Track { get; }
 472
 473        internal DataTrackUnpublishedEventArgs(string sid, RemoteDataTrack? track)
 474        {
 475            Sid = sid;
 476            Track = track;
 477        }
 478    }
 479
 480    /// <summary>
 481    /// Event arguments for data channel buffered-amount-low threshold changed events.
 482    /// </summary>
 483    public class DataChannelBufferedAmountLowThresholdChangedEventArgs : EventArgs
 484    {
 485        /// <summary>
 486        /// The data channel whose threshold changed.
 487        /// </summary>
 488        public Proto.DataPacketKind Kind { get; }
 489
 490        /// <summary>
 491        /// The new threshold in bytes.
 492        /// </summary>
 493        public ulong Threshold { get; }
 494
 495        internal DataChannelBufferedAmountLowThresholdChangedEventArgs(
 496            Proto.DataPacketKind kind,
 497            ulong threshold
 498        )
 499        {
 500            Kind = kind;
 501            Threshold = threshold;
 502        }
 503    }
 504}