Fix speaker view not auto switching on presenting

This commit is contained in:
Jamie Kyle 2023-08-30 14:34:58 -07:00 committed by GitHub
parent 67a51415d0
commit a4fffdfbfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 1 deletions

View file

@ -304,6 +304,7 @@ export function GroupCall1(): JSX.Element {
callMode: CallMode.Group, callMode: CallMode.Group,
remoteParticipants: [ remoteParticipants: [
{ {
aci: generateAci(),
demuxId: 0, demuxId: 0,
hasRemoteAudio: true, hasRemoteAudio: true,
hasRemoteVideo: true, hasRemoteVideo: true,
@ -328,6 +329,7 @@ GroupCall1.story = {
// We generate these upfront so that the list is stable when you move the slider. // We generate these upfront so that the list is stable when you move the slider.
const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({ const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({
aci: generateAci(),
demuxId: index, demuxId: index,
hasRemoteAudio: index % 3 !== 0, hasRemoteAudio: index % 3 !== 0,
hasRemoteVideo: index % 4 !== 0, hasRemoteVideo: index % 4 !== 0,
@ -371,6 +373,7 @@ export function GroupCallReconnecting(): JSX.Element {
connectionState: GroupCallConnectionState.Reconnecting, connectionState: GroupCallConnectionState.Reconnecting,
remoteParticipants: [ remoteParticipants: [
{ {
aci: generateAci(),
demuxId: 0, demuxId: 0,
hasRemoteAudio: true, hasRemoteAudio: true,
hasRemoteVideo: true, hasRemoteVideo: true,

View file

@ -20,6 +20,7 @@ function createParticipant(
participantProps: Partial<GroupCallRemoteParticipantType> participantProps: Partial<GroupCallRemoteParticipantType>
): GroupCallRemoteParticipantType { ): GroupCallRemoteParticipantType {
return { return {
aci: generateAci(),
demuxId: 2, demuxId: 2,
hasRemoteAudio: Boolean(participantProps.hasRemoteAudio), hasRemoteAudio: Boolean(participantProps.hasRemoteAudio),
hasRemoteVideo: Boolean(participantProps.hasRemoteVideo), hasRemoteVideo: Boolean(participantProps.hasRemoteVideo),

View file

@ -12,12 +12,14 @@ import { getDefaultConversationWithServiceId } from '../test-both/helpers/getDef
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource'; import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
import { FRAME_BUFFER_SIZE } from '../calling/constants'; import { FRAME_BUFFER_SIZE } from '../calling/constants';
import enMessages from '../../_locales/en/messages.json'; import enMessages from '../../_locales/en/messages.json';
import { generateAci } from '../types/ServiceId';
const MAX_PARTICIPANTS = 32; const MAX_PARTICIPANTS = 32;
const i18n = setupI18n('en', enMessages); const i18n = setupI18n('en', enMessages);
const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({ const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({
aci: generateAci(),
demuxId: index, demuxId: index,
hasRemoteAudio: index % 3 !== 0, hasRemoteAudio: index % 3 !== 0,
hasRemoteVideo: index % 4 !== 0, hasRemoteVideo: index % 4 !== 0,

View file

@ -51,6 +51,7 @@ const createProps = (
i18n, i18n,
audioLevel: 0, audioLevel: 0,
remoteParticipant: { remoteParticipant: {
aci: generateAci(),
demuxId: 123, demuxId: 123,
hasRemoteAudio, hasRemoteAudio,
hasRemoteVideo: true, hasRemoteVideo: true,

View file

@ -229,6 +229,7 @@ const mapStateToActiveCallProp = (
remoteParticipants.push({ remoteParticipants.push({
...remoteConversation, ...remoteConversation,
aci: remoteParticipant.aci,
demuxId: remoteParticipant.demuxId, demuxId: remoteParticipant.demuxId,
hasRemoteAudio: remoteParticipant.hasRemoteAudio, hasRemoteAudio: remoteParticipant.hasRemoteAudio,
hasRemoteVideo: remoteParticipant.hasRemoteVideo, hasRemoteVideo: remoteParticipant.hasRemoteVideo,

View file

@ -3,7 +3,7 @@
import type { AudioDevice } from '@signalapp/ringrtc'; import type { AudioDevice } from '@signalapp/ringrtc';
import type { ConversationType } from '../state/ducks/conversations'; import type { ConversationType } from '../state/ducks/conversations';
import type { ServiceIdString } from './ServiceId'; import type { AciString, ServiceIdString } from './ServiceId';
// These are strings (1) for the database (2) for Storybook. // These are strings (1) for the database (2) for Storybook.
export enum CallMode { export enum CallMode {
@ -135,6 +135,7 @@ export enum GroupCallJoinState {
} }
export type GroupCallRemoteParticipantType = ConversationType & { export type GroupCallRemoteParticipantType = ConversationType & {
aci: AciString;
demuxId: number; demuxId: number;
hasRemoteAudio: boolean; hasRemoteAudio: boolean;
hasRemoteVideo: boolean; hasRemoteVideo: boolean;