@streaming-cdn/rtc-web 1.3.19 → 1.3.21

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RTC Web SDK 1.3.19
1
+ # RTC Web SDK 1.3.21
2
2
 
3
3
  The customer package contains compiled ESM/UMD JavaScript and TypeScript declarations. It intentionally excludes implementation source and source maps. Example source remains available under `examples/`.
4
4
 
@@ -84,7 +84,7 @@ const phone = createRtcIncomingClient({
84
84
  if (!response.ok) throw new Error("Unable to refresh RTC identity");
85
85
  return response.json();
86
86
  },
87
- apiBaseUrl: "https://streaming-cdn.ewin888.com",
87
+ callActionsUrl: "https://streaming-cdn.ewin888.com",
88
88
  autoConnect: false,
89
89
  mount: document.querySelector("#incoming-call")
90
90
  });
@@ -99,6 +99,47 @@ yourPush.onMessage((payload) => phone.handleIncomingCall({
99
99
 
100
100
  Omit `mount` when your application also owns the incoming-call UI. Call `accept`, `reject`, `busy`, `end`, or `cancel` from your own controls.
101
101
 
102
+ ## Where call actions go: `callActionsUrl`
103
+
104
+ Accept, reject, busy, end and cancel are not local actions: the call's state
105
+ lives in a record on the platform, and pressing Accept must (1) update that
106
+ record, (2) notify the caller, and (3) stop the ringing on the callee's other
107
+ devices. The button therefore sends one authenticated HTTP request — and it
108
+ cannot ride the signaling socket, because when a push notification wakes the
109
+ app there is no socket yet. `callActionsUrl` is the origin those requests go
110
+ to. It applies ONLY to the incoming-call client's call actions; no other SDK
111
+ API reads it.
112
+
113
+ ```
114
+ Caller Platform Callee device
115
+ | create call (server API) | |
116
+ |-------------------------->| call record: "ringing" |
117
+ | ringback tone |---- push / signaling notify ------>| incoming-call UI shows
118
+ | | | (no connection exists yet)
119
+ | | | user taps Accept / Reject
120
+ | |<== POST {callActionsUrl}/v1/rtc/client/calls/:id/accept
121
+ | | the server arbitrates: accepted,
122
+ | | or "already cancelled" if the
123
+ | | caller hung up first
124
+ |<-- "accepted" notify -----|--- stop ringing other devices ---->|
125
+ | | | connect signaling (signalingUrl)
126
+ |<================== media session establishes ================>|
127
+ ```
128
+
129
+ Resolution order: `callActionsUrl` -> `signalingUrl`'s origin -> the page's own
130
+ origin. In practice:
131
+
132
+ | Scenario | Needed? |
133
+ | --- | --- |
134
+ | Web app served from the platform's own domain | No — the page origin is used |
135
+ | Your own website (different domain) embedding the incoming-call UI | Yes — set it to the platform origin |
136
+ | `signalingUrl` already provided | No — its origin is reused |
137
+ | React Native / non-browser | Provide `signalingUrl` or `callActionsUrl` (there is no page origin to fall back to) |
138
+
139
+ `apiBaseUrl` is the deprecated former name; it is still accepted as an alias
140
+ so existing integrations keep working.
141
+
142
+
102
143
  For outgoing UI, show `contacting` while mobile push is being delivered, move to `ringing` on `call.delivery`, and show `connected` only after both `call.updated: accepted` and the media client's `connected` event. Do not call `join()` before acceptance. Cancel unanswered calls at the invitation `expiresAt` timestamp (45 seconds by default).
103
144
 
104
145
  ## Complete managed integration
@@ -315,3 +356,14 @@ Abnormal close, reconnect, and recovery duration are also sent as bounded
315
356
  operational diagnostics. Tokens, SDP, media, and chat content are never part of
316
357
  that report. Set `reportSignalingDiagnostics: false` only when replacing this
317
358
  with an application-owned diagnostics pipeline.
359
+
360
+ ## 1.3.21 notes
361
+
362
+ - Per-peer quality: a `bandwidth` limitation reason counts against a link only
363
+ when the measured uplink does not comfortably clear the current tier
364
+ (`bandwidthHeadroomRatio`, default 1.25) — encoder ramp-up during the first
365
+ minute no longer forces a downgrade.
366
+ - Quality samples carry direction-explicit resolutions:
367
+ `inboundFrameWidth/Height` (received; equals the historical
368
+ `frameWidth/Height`) and `outboundFrameWidth/Height` (what your encoder
369
+ sends).
package/dist/index.d.ts CHANGED
@@ -101,8 +101,21 @@ export interface RtcQualitySample {
101
101
  outboundBitrateBps: number | null;
102
102
  availableOutgoingBitrateBps: number | null;
103
103
  framesPerSecond: number | null;
104
+ /**
105
+ * INBOUND (received) resolution — the remote side's picture, which moves
106
+ * with THEIR quality tier, not yours (N3: an integrator saw "low" record a
107
+ * larger frame than "medium" and reasonably read it as a bug). Kept under
108
+ * the historical names for compatibility; prefer the direction-explicit
109
+ * fields below.
110
+ */
104
111
  frameWidth: number | null;
105
112
  frameHeight: number | null;
113
+ /** Received (inbound) video resolution — same values as frameWidth/frameHeight. */
114
+ inboundFrameWidth: number | null;
115
+ inboundFrameHeight: number | null;
116
+ /** Sent (outbound) video resolution — what YOUR encoder is producing. */
117
+ outboundFrameWidth: number | null;
118
+ outboundFrameHeight: number | null;
106
119
  framesDropped: number | null;
107
120
  freezeCount: number | null;
108
121
  freezeDurationMs: number | null;
@@ -253,6 +266,15 @@ export interface RtcIncomingClientOptions {
253
266
  /** Refresh lead time. Defaults to five minutes and scales down for short-lived tokens. */
254
267
  tokenRefreshSkewMs?: number;
255
268
  signalingUrl?: string;
269
+ /**
270
+ * Origin for call-action requests (accept / reject / busy / end / cancel).
271
+ * These change the call record on the platform, so they are HTTP requests —
272
+ * a push-woken app has no signaling socket yet when the user answers. Only
273
+ * the incoming-call client reads this; no other SDK API needs it. Falls
274
+ * back to signalingUrl's origin, then to the page's own origin.
275
+ */
276
+ callActionsUrl?: string;
277
+ /** @deprecated Former name of callActionsUrl; still honored as an alias. */
256
278
  apiBaseUrl?: string;
257
279
  autoConnect?: boolean;
258
280
  mount?: HTMLElement | string | null;
@@ -355,4 +377,4 @@ export declare class RtcIncomingClient extends EventTarget {
355
377
  private emit;
356
378
  }
357
379
  export declare function createRtcIncomingClient(options: RtcIncomingClientOptions): RtcIncomingClient;
358
- export declare const version = "1.3.19";
380
+ export declare const version = "1.3.21";
@@ -37,6 +37,8 @@ export interface PeerQualityThresholds {
37
37
  goodLossPct: number;
38
38
  goodRttMs: number;
39
39
  sustainRatio: number;
40
+ /** "bandwidth" counts only when the uplink estimate is below this multiple of the tier target. */
41
+ bandwidthHeadroomRatio: number;
40
42
  }
41
43
  export declare const defaultPeerQualityThresholds: PeerQualityThresholds;
42
44
  export interface PeerQualitySample {