demo · v144
Custom Adaptor
The whole point of the new enum value: switch off the internal adapter so your adapter can run. Drag the bandwidth slider and watch what each strategy does — maintain-framerate, maintain-resolution, balanced, or your custom rule that compares all of them.
RTCRtpSender.getParameters: checking…
internal adapter (off)
degradationPreference = "maintain-framerate-and-resolution" — engine doesn't touch fps/resolution.
- fps
- 30
- resolution
- 1280×720
- quality
- 100%
simulated frame
your adapter
JS adapter watches outboundRtp stats and reacts.
- fps
- 30
- resolution
- 1280×720
- quality
- 100%
simulated frame
the API
const sender = pc.getSenders().find((s) => s.track.kind === "video");
const params = sender.getParameters();
params.degradationPreference = "maintain-framerate-and-resolution"; // new in v144
await sender.setParameters(params);
// then run your own adapter loop
setInterval(async () => {
const stats = await sender.getStats();
if (currentBitrate < targetBitrate * 0.6) {
const p = sender.getParameters();
p.encodings[0].scaleResolutionDownBy = 2; // your call
await sender.setParameters(p);
}
}, 2000);