Merge pull request 'fix(calls): explain when the soundboard is not allowed in a voice channel (EC #47)' (#415) from fix/soundboard-not-permitted into lotus
CI / Build & Quality Checks (push) Successful in 3m2s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 12s
CI / Trigger Desktop Build (push) Successful in 10s
CI / Playwright smoke (e2e) (push) Successful in 14m28s
CI / Build & Quality Checks (push) Successful in 3m2s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 12s
CI / Trigger Desktop Build (push) Successful in 10s
CI / Playwright smoke (e2e) (push) Successful in 14m28s
This commit was merged in pull request #415.
This commit is contained in:
@@ -50,6 +50,14 @@ type FlatClip = {
|
|||||||
* A management toggle reveals the pack editors (personal + this room, if
|
* A management toggle reveals the pack editors (personal + this room, if
|
||||||
* permitted). Space-wide packs are managed from Space settings.
|
* permitted). Space-wide packs are managed from Space settings.
|
||||||
*/
|
*/
|
||||||
|
/** [EC#13, EC#47] Why the fork refused to play a clip, for the user. */
|
||||||
|
export const soundboardRefusalText = (reason: string | undefined): string => {
|
||||||
|
if (reason === 'muted') return 'Unmute your microphone to play a soundboard clip.';
|
||||||
|
if (reason === 'not_permitted')
|
||||||
|
return "The soundboard isn't available in this voice channel (only microphone audio is allowed here).";
|
||||||
|
return 'Could not play that clip.';
|
||||||
|
};
|
||||||
|
|
||||||
export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
const { room } = callEmbed;
|
const { room } = callEmbed;
|
||||||
@@ -122,13 +130,10 @@ export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
|||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
const result = await callEmbed.control.injectAudio(url, vol, clipBytes);
|
const result = await callEmbed.control.injectAudio(url, vol, clipBytes);
|
||||||
if (!result.played) {
|
if (!result.played) {
|
||||||
// [EC#13] Refused fork-side (only reason today: local mic muted) —
|
// [EC#13, EC#47] Refused fork-side (mic muted, or the room's token
|
||||||
|
// only allows the microphone source, as in audio-only rooms) —
|
||||||
// don't play it locally either, or the user would think it went out.
|
// don't play it locally either, or the user would think it went out.
|
||||||
setError(
|
setError(soundboardRefusalText(result.reason));
|
||||||
result.reason === 'muted'
|
|
||||||
? 'Unmute your microphone to play a soundboard clip.'
|
|
||||||
: 'Could not play that clip.',
|
|
||||||
);
|
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user