@streaming-cdn/rtc-web 1.3.12 → 1.3.13

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.
Files changed (2) hide show
  1. package/README.md +52 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RTC Web SDK 1.3.12
1
+ # RTC Web SDK 1.3.13
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
 
@@ -152,14 +152,57 @@ side receives a terminal call state. Manual integrations must call
152
152
  `transport: "mesh"` (the default) opens one connection per pair, which suits
153
153
  direct calls and small rooms. `transport: "sfu"` sends media once to the
154
154
  platform SFU and receives each remote participant from it, which is what a
155
- large room needs — media no longer grows with the participant count. The
156
- credential, the events and the rest of the API are identical, so an
157
- application switches transports without changing its UI or call flow. SDP for
158
- the SFU travels over `/v1/rtc/sfu/*` authenticated by the same signaling
159
- token; no separate credential exists. With a single uplink there is no
160
- per-connection tier, so `peerquality` is not emitted on this transport and
161
- `setQuality` applies to the uplink directly. The React Native adapter
162
- currently ships the mesh transport.
155
+ large room needs — media no longer grows with the participant count.
156
+ `transport: "auto"` picks the SFU for `meeting` mode and the mesh for `voice`
157
+ and `video` calls. The credential, the events and the rest of the API are
158
+ identical, so an application switches transports without changing its UI or
159
+ call flow. SDP for the SFU travels over `/v1/rtc/sfu/*` authenticated by the
160
+ same signaling token; no separate credential exists.
161
+
162
+ The SFU uplink publishes three simulcast layers (720p/360p/180p-class), so the
163
+ SFU can hand every subscriber the layer their downlink carries. `setQuality`
164
+ caps which layers are encoded; there is no per-connection tier on a single
165
+ uplink, so `peerquality` is not emitted on this transport. To deliberately
166
+ receive a lower layer for one participant — a thumbnail tile has no use for
167
+ 720p — call `setRemoteQuality(participantId, "low" | "medium" | "high")` on
168
+ the room client (`getNativeClient()`); the publisher keeps sending every
169
+ layer. The React Native adapter has the same transport option and the same
170
+ `setRemoteQuality` on the client.
171
+
172
+ ## Active speaker
173
+
174
+ The client samples WebRTC audio levels once a second on both transports and
175
+ emits `activespeaker` (`{ participantId }`, or `null` when the room is
176
+ silent). The choice has hysteresis — the highlight only moves when somebody is
177
+ clearly louder than the current speaker — so two people at similar volume do
178
+ not flap the indicator. Use it to light up the speaking tile:
179
+
180
+ ```ts
181
+ media.addEventListener("activespeaker", ({ detail }) => {
182
+ highlightTile(detail.detail.participantId);
183
+ });
184
+ ```
185
+
186
+ ## Picture-in-picture
187
+
188
+ `createPictureInPictureController(media.getNativeClient())` floats a
189
+ participant's video in the browser's always-on-top window while the user works
190
+ elsewhere. `enter(participantId?)` must run inside a click handler — browsers
191
+ require a user gesture — and picks the first remote participant by default,
192
+ falling back to the local preview. `onLeave` fires when the user closes the
193
+ floating window; `supported` is false where the browser has no PiP.
194
+
195
+ ```ts
196
+ import { createPictureInPictureController } from "@streaming-cdn/rtc-web";
197
+
198
+ const pip = createPictureInPictureController(media.getNativeClient(), {
199
+ onLeave: () => showInlineVideoAgain()
200
+ });
201
+ pipButton.onclick = () => { void pip.enter(); };
202
+ ```
203
+
204
+ Android and iOS system PiP require native application support and are on the
205
+ SDK roadmap.
163
206
 
164
207
  ## Quality and codecs
165
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streaming-cdn/rtc-web",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "type": "module",
5
5
  "main": "dist/rtc-web.umd.js",
6
6
  "module": "dist/rtc-web.es.js",