@100mslive/hms-video-store 0.15.2-alpha.0 → 0.15.2-alpha.2

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.
@@ -51,6 +51,17 @@ export default class AnalyticsEventFactory {
51
51
  unproven: boolean;
52
52
  sent: boolean;
53
53
  }): AnalyticsEvent;
54
+ /**
55
+ * A publish answer was dropped because the offer it answers is no longer staged.
56
+ * `action` names the owner that must re-drive; `reason` separates the three causes.
57
+ */
58
+ static publishAnswerDiscarded(properties: {
59
+ reason: 'connection_replaced' | 'superseded_offer' | 'unexpected_state';
60
+ action: string;
61
+ signaling_state: RTCSignalingState;
62
+ transport_state: string;
63
+ epoch: number;
64
+ }): AnalyticsEvent;
54
65
  /** no attempt was answered, so the SFU is left on a state nobody asked for */
55
66
  static subscribeRequestUnanswered(properties: {
56
67
  method: string;
@@ -22,6 +22,8 @@ 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. */
26
+ private localDescriptionEpoch;
25
27
  protected constructor(role: HMSConnectionRole, signal: JsonRpcSignal);
26
28
  get iceConnectionState(): RTCIceConnectionState;
27
29
  get connectionState(): RTCPeerConnectionState;
@@ -31,7 +33,13 @@ export default abstract class HMSConnection {
31
33
  addTransceiver(track: MediaStreamTrack, init: RTCRtpTransceiverInit): RTCRtpTransceiver;
32
34
  createOffer(tracks?: Map<string, TrackState>, options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;
33
35
  createAnswer(options?: RTCOfferOptions | undefined): Promise<RTCSessionDescriptionInit>;
34
- setLocalDescription(description: RTCSessionDescriptionInit): Promise<void>;
36
+ /** True while `epoch` is still the newest local description staged on this connection. */
37
+ isStagingLocalDescription(epoch: number): boolean;
38
+ /**
39
+ * Returns the epoch of the offer just staged. Bumped on entry, before the native call is
40
+ * chained onto the operations queue, so a racer is visible from the moment it starts.
41
+ */
42
+ setLocalDescription(description: RTCSessionDescriptionInit): Promise<number>;
35
43
  setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;
36
44
  addIceCandidate(candidate: RTCIceCandidateInit): Promise<void>;
37
45
  get remoteDescription(): RTCSessionDescription | null;
@@ -36,6 +36,7 @@ export declare const ErrorCodes: {
36
36
  ICE_FAILURE: number;
37
37
  ICE_DISCONNECTED: number;
38
38
  STATS_FAILED: number;
39
+ PUBLISH_ANSWER_SUPERSEDED: number;
39
40
  };
40
41
  WebsocketMethodErrors: {
41
42
  SERVER_ERRORS: number;
@@ -37,6 +37,8 @@ export declare const ErrorFactory: {
37
37
  CreateAnswerFailed(action: HMSAction, description?: string): HMSException;
38
38
  SetLocalDescriptionFailed(action: HMSAction, description?: string): HMSException;
39
39
  SetRemoteDescriptionFailed(action: HMSAction, description?: string): HMSException;
40
+ /** The offer this answer replies to is no longer staged. Non-terminal: the owner retries. */
41
+ PublishAnswerSuperseded(action: HMSAction, description?: string): HMSException;
40
42
  ICEFailure(action: HMSAction, description?: string, isTerminal?: boolean): HMSException;
41
43
  ICEDisconnected(action: HMSAction, description?: string): HMSException;
42
44
  StatsFailed(action: HMSAction, description?: string): HMSException;