Adds io.lotus.set_quality (toWidget): caps mic audio bitrate and screenshare bitrate/framerate via RTCRtpSender.setParameters (no republish). Settings are sticky and re-applied on LocalTrackPublished so they survive mute/unmute and reconnects. These encoding controls lived in EC's module scope, unreachable from the host against the prebuilt bundle. Additive: no-op unless the host sends the action. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
/*
|
|
Copyright 2026 Lotus Guild
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
/**
|
|
* Custom widget actions exchanged between the Lotus host (cinny) and this fork.
|
|
* Kept dependency-free so both `widget.ts` and `lotus/*` can import it without
|
|
* a circular dependency.
|
|
*/
|
|
export enum LotusWidgetActions {
|
|
/**
|
|
* fromWidget: in-call per-participant speaking / mute state.
|
|
* NOTE: matrix-widget-api `transport.send` is request/response — the host
|
|
* MUST reply/ack each one (cinny's `listenAction` does, replying `{}`),
|
|
* otherwise every send sits pending for the 10s transport timeout and then
|
|
* rejects, producing continuous churn + log noise for the whole call.
|
|
*/
|
|
CallState = "io.lotus.call_state",
|
|
/** toWidget: pin/spotlight (or clear, with userId=null) a participant. */
|
|
FocusParticipant = "io.lotus.focus_participant",
|
|
/** toWidget: mix an audio clip into the local published mic track. */
|
|
InjectAudio = "io.lotus.inject_audio",
|
|
/** toWidget: set audio/screenshare encoding quality (bitrate/framerate). */
|
|
SetQuality = "io.lotus.set_quality",
|
|
}
|
|
|
|
/** toWidget Lotus actions that must be allow-listed in `initializeWidget`. */
|
|
export const LOTUS_TO_WIDGET_ACTIONS: LotusWidgetActions[] = [
|
|
LotusWidgetActions.FocusParticipant,
|
|
LotusWidgetActions.InjectAudio,
|
|
LotusWidgetActions.SetQuality,
|
|
];
|