feat(call): host half of the 0.25.0-lotus.2 fork changes
- io.lotus.request_state: when the fork's lotus handlers (re)register (an EC-side remount that doesn't unmount us) we re-send deafen, quality and the focus pin, and the decoration pusher re-pushes its roster — decorations and the pin no longer vanish for the rest of the call (element-call#17). - focus_participant carries the per-device media id from call_state (speaking device preferred) so a multi-device user pins the right device (element-call#30). - injectAudio returns the fork's reply; when it refuses with reason:"muted" the soundboard shows "Unmute your microphone…" instead of playing the clip locally as if it went out (element-call#13). All backwards compatible with the 0.25.0-lotus.1 bundle (unknown action is acked; missing reply fields default to "played"). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
@@ -115,7 +115,18 @@ export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
||||
try {
|
||||
const url = await resolveClipObjectUrl(mx, flat.clip.url);
|
||||
const vol = (flat.clip.volume / 100) * master;
|
||||
callEmbed.control.injectAudio(url, vol);
|
||||
const result = await callEmbed.control.injectAudio(url, vol);
|
||||
if (!result.played) {
|
||||
// [EC#13] Refused fork-side (only reason today: local mic muted) —
|
||||
// don't play it locally either, or the user would think it went out.
|
||||
setError(
|
||||
result.reason === 'muted'
|
||||
? 'Unmute your microphone to play a soundboard clip.'
|
||||
: 'Could not play that clip.',
|
||||
);
|
||||
done();
|
||||
return;
|
||||
}
|
||||
const audio = playClipLocally(url, vol);
|
||||
if (audio) {
|
||||
audio.addEventListener('ended', done, { once: true });
|
||||
|
||||
Reference in New Issue
Block a user