Show local speaking indicator for group calls

This commit is contained in:
Evan Hahn 2022-02-25 09:24:05 -06:00 committed by GitHub
parent dbb732e7cf
commit 41b4cce6ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 87 additions and 32 deletions

View file

@ -50,6 +50,7 @@ describe('calling duck', () => {
conversationId: 'fake-direct-call-conversation-id',
hasLocalAudio: true,
hasLocalVideo: false,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -128,6 +129,7 @@ describe('calling duck', () => {
conversationId: 'fake-group-call-conversation-id',
hasLocalAudio: true,
hasLocalVideo: false,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -433,6 +435,7 @@ describe('calling duck', () => {
conversationId: 'fake-direct-call-conversation-id',
hasLocalAudio: true,
hasLocalVideo: true,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -525,6 +528,7 @@ describe('calling duck', () => {
conversationId: 'fake-group-call-conversation-id',
hasLocalAudio: true,
hasLocalVideo: true,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -762,6 +766,7 @@ describe('calling duck', () => {
it("does nothing if there's no relevant call", () => {
const action = groupCallAudioLevelsChange({
conversationId: 'garbage',
localAudioLevel: 1,
remoteDeviceStates,
});
@ -784,6 +789,7 @@ describe('calling duck', () => {
};
const action = groupCallAudioLevelsChange({
conversationId: 'fake-group-call-conversation-id',
localAudioLevel: 0.1,
remoteDeviceStates,
});
@ -792,13 +798,16 @@ describe('calling duck', () => {
assert.strictEqual(result, state);
});
it('updates the set of speaking participants', () => {
it('updates the set of speaking participants, including yourself', () => {
const action = groupCallAudioLevelsChange({
conversationId: 'fake-group-call-conversation-id',
localAudioLevel: 0.8,
remoteDeviceStates,
});
const result = reducer(stateWithActiveGroupCall, action);
assert.isTrue(result.activeCallState?.amISpeaking);
const call =
result.callsByConversation['fake-group-call-conversation-id'];
if (call?.callMode !== CallMode.Group) {
@ -1100,6 +1109,7 @@ describe('calling duck', () => {
conversationId: 'fake-group-call-conversation-id',
hasLocalAudio: true,
hasLocalVideo: false,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -1628,6 +1638,7 @@ describe('calling duck', () => {
conversationId: 'fake-conversation-id',
hasLocalAudio: true,
hasLocalVideo: true,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],
@ -1913,6 +1924,7 @@ describe('calling duck', () => {
conversationId: 'fake-conversation-id',
hasLocalAudio: true,
hasLocalVideo: false,
amISpeaking: false,
isInSpeakerView: false,
showParticipantsList: false,
safetyNumberChangedUuids: [],