@100mslive/hms-video-store 0.15.2-alpha.3 → 0.15.2-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import { HMSException } from '../error/HMSException';
6
6
  import { DeviceMap, SelectedDevices } from '../interfaces';
7
7
  import { HMSTrackSettings } from '../media/settings/HMSTrackSettings';
8
8
  import { HMSRemoteVideoTrack } from '../media/tracks/HMSRemoteVideoTrack';
9
+ import { PublishAnswerDiscardReason } from '../transport/models/PublishAnswerDiscardReason';
9
10
  export default class AnalyticsEventFactory {
10
11
  private static KEY_REQUESTED_AT;
11
12
  private static KEY_RESPONDED_AT;
@@ -51,12 +52,22 @@ export default class AnalyticsEventFactory {
51
52
  unproven: boolean;
52
53
  sent: boolean;
53
54
  }): AnalyticsEvent;
55
+ /**
56
+ * A migration that did not finish. `reason` separates a deliberate abort — a newer migration
57
+ * owns the peer — from a genuine failure, which nothing retries.
58
+ */
59
+ static sfuMigrationIncomplete({ reason, sfuNodeId, transportState, error, }: {
60
+ reason: 'superseded' | 'failed';
61
+ sfuNodeId?: string;
62
+ transportState: string;
63
+ error?: HMSException;
64
+ }): AnalyticsEvent;
54
65
  /**
55
66
  * A publish answer was dropped because the offer it answers is no longer staged.
56
67
  * `action` names the owner that must re-drive; `reason` separates the three causes.
57
68
  */
58
69
  static publishAnswerDiscarded(properties: {
59
- reason: 'connection_replaced' | 'superseded_offer' | 'unexpected_state';
70
+ reason: PublishAnswerDiscardReason;
60
71
  action: string;
61
72
  signaling_state: RTCSignalingState;
62
73
  transport_state: string;
@@ -22,7 +22,7 @@ export default abstract class HMSConnection {
22
22
  readonly candidates: RTCIceCandidateInit[];
23
23
  sfuNodeId?: string;
24
24
  selectedCandidatePair?: RTCIceCandidatePair;
25
- /** Monotonic id of the local description this connection is staging. */
25
+ /** Monotonic id of the most recently requested local description (bumped on entry, not on apply). */
26
26
  private localDescriptionEpoch;
27
27
  protected constructor(role: HMSConnectionRole, signal: JsonRpcSignal);
28
28
  get iceConnectionState(): RTCIceConnectionState;
@@ -31,6 +31,8 @@ export default abstract class HMSConnection {
31
31
  private get action();
32
32
  setSfuNodeId(nodeId?: string): void;
33
33
  addTransceiver(track: MediaStreamTrack, init: RTCRtpTransceiverInit): RTCRtpTransceiver;
34
+ /** True when the transceiver is still attached to this connection. */
35
+ hasTransceiver(transceiver?: RTCRtpTransceiver): boolean;
34
36
  createOffer(tracks?: Map<string, TrackState>, options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;
35
37
  createAnswer(options?: RTCOfferOptions | undefined): Promise<RTCSessionDescriptionInit>;
36
38
  /** True while `epoch` is still the newest local description staged on this connection. */
@@ -41,6 +43,11 @@ export default abstract class HMSConnection {
41
43
  */
42
44
  setLocalDescription(description: RTCSessionDescriptionInit): Promise<number>;
43
45
  setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;
46
+ /**
47
+ * Applies the answer, then flushes the candidates onTrickle buffered before any remote
48
+ * description. Gated on this being the first answer; after it onTrickle adds directly.
49
+ */
50
+ setRemoteDescriptionAndDrainCandidates(description: RTCSessionDescriptionInit): Promise<void>;
44
51
  addIceCandidate(candidate: RTCIceCandidateInit): Promise<void>;
45
52
  get remoteDescription(): RTCSessionDescription | null;
46
53
  getSenders(): Array<RTCRtpSender>;