@streaming-cdn/rtc-web 1.3.11 → 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.
- package/README.md +58 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# RTC Web SDK 1.3.
|
|
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
|
|
|
@@ -147,6 +147,63 @@ side receives a terminal call state. Manual integrations must call
|
|
|
147
147
|
`await media.leave(); media.destroy()` for `ended`, `cancelled`, `rejected`,
|
|
148
148
|
`busy`, `failed`, and `missed`. Calling the same terminal action twice is safe.
|
|
149
149
|
|
|
150
|
+
## Transports
|
|
151
|
+
|
|
152
|
+
`transport: "mesh"` (the default) opens one connection per pair, which suits
|
|
153
|
+
direct calls and small rooms. `transport: "sfu"` sends media once to the
|
|
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.
|
|
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.
|
|
206
|
+
|
|
150
207
|
## Quality and codecs
|
|
151
208
|
|
|
152
209
|
Use `setQuality("low" | "medium" | "high" | "audio" | "auto")` at runtime.
|