💄 Optimize design of the call content
This commit is contained in:
@@ -362,6 +362,7 @@ class CallNotifier extends _$CallNotifier {
|
|||||||
sourceId: source.id,
|
sourceId: source.id,
|
||||||
maxFrameRate: 30.0,
|
maxFrameRate: 30.0,
|
||||||
captureScreenAudio: true,
|
captureScreenAudio: true,
|
||||||
|
useiOSBroadcastExtension: true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await _localParticipant!.publishVideoTrack(track);
|
await _localParticipant!.publishVideoTrack(track);
|
||||||
|
|||||||
@@ -55,25 +55,26 @@ class CallContent extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stage view: show main speaker(s) large, others in row
|
// Show all participants in a responsive grid
|
||||||
final mainSpeakers =
|
return LayoutBuilder(
|
||||||
participants
|
builder: (context, constraints) {
|
||||||
.where(
|
// Calculate width for responsive 2-column layout
|
||||||
(p) => p.remoteParticipant.trackPublications.values.any(
|
final itemWidth = (constraints.maxWidth / 2) - 16;
|
||||||
(pub) => pub.track != null && pub.kind == TrackType.VIDEO,
|
|
||||||
|
return Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
runAlignment: WrapAlignment.center,
|
||||||
|
spacing: 8,
|
||||||
|
runSpacing: 8,
|
||||||
|
children: [
|
||||||
|
for (final participant in participants)
|
||||||
|
SizedBox(
|
||||||
|
width: itemWidth,
|
||||||
|
child: CallParticipantTile(live: participant),
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
.toList();
|
);
|
||||||
if (mainSpeakers.isEmpty && participants.isNotEmpty) {
|
},
|
||||||
mainSpeakers.add(participants.first);
|
|
||||||
}
|
|
||||||
return Wrap(
|
|
||||||
alignment: WrapAlignment.center,
|
|
||||||
runAlignment: WrapAlignment.center,
|
|
||||||
children: [
|
|
||||||
for (final speaker in mainSpeakers)
|
|
||||||
Expanded(child: CallParticipantTile(live: speaker)),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user