name field for participant
This commit is contained in:
@@ -126,7 +126,9 @@ abstract class _ParticipantWidgetState<T extends ParticipantWidget>
|
|||||||
children: [
|
children: [
|
||||||
...extraWidgets(),
|
...extraWidgets(),
|
||||||
ParticipantInfoWidget(
|
ParticipantInfoWidget(
|
||||||
title: widget.participant.identity,
|
title: widget.participant.name.isNotEmpty
|
||||||
|
? '${widget.participant.name} (${widget.participant.identity})'
|
||||||
|
: widget.participant.identity,
|
||||||
audioAvailable: firstAudioPublication?.muted == false &&
|
audioAvailable: firstAudioPublication?.muted == false &&
|
||||||
firstAudioPublication?.subscribed == true,
|
firstAudioPublication?.subscribed == true,
|
||||||
connectionQuality: widget.participant.connectionQuality,
|
connectionQuality: widget.participant.connectionQuality,
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
|
|||||||
room: this,
|
room: this,
|
||||||
sid: sid,
|
sid: sid,
|
||||||
identity: '',
|
identity: '',
|
||||||
|
name: '',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
participant = RemoteParticipant.fromInfo(
|
participant = RemoteParticipant.fromInfo(
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
|
|||||||
room: room,
|
room: room,
|
||||||
sid: info.sid,
|
sid: info.sid,
|
||||||
identity: info.identity,
|
identity: info.identity,
|
||||||
|
name: info.name,
|
||||||
) {
|
) {
|
||||||
updateFromInfo(info);
|
updateFromInfo(info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ abstract class Participant<T extends TrackPublication>
|
|||||||
/// User-assigned identity.
|
/// User-assigned identity.
|
||||||
String identity;
|
String identity;
|
||||||
|
|
||||||
|
/// Name of the participant (readonly).
|
||||||
|
String get name => _name;
|
||||||
|
String _name;
|
||||||
|
|
||||||
/// Client-assigned metadata, opaque to livekit.
|
/// Client-assigned metadata, opaque to livekit.
|
||||||
String? metadata;
|
String? metadata;
|
||||||
|
|
||||||
@@ -94,7 +98,8 @@ abstract class Participant<T extends TrackPublication>
|
|||||||
required this.room,
|
required this.room,
|
||||||
required this.sid,
|
required this.sid,
|
||||||
required this.identity,
|
required this.identity,
|
||||||
}) {
|
required String name,
|
||||||
|
}) : _name = name {
|
||||||
// Any event emitted will trigger ChangeNotifier
|
// Any event emitted will trigger ChangeNotifier
|
||||||
events.listen((event) {
|
events.listen((event) {
|
||||||
logger.fine('[ParticipantEvent] $event, will notifyListeners()');
|
logger.fine('[ParticipantEvent] $event, will notifyListeners()');
|
||||||
@@ -150,6 +155,7 @@ abstract class Participant<T extends TrackPublication>
|
|||||||
@internal
|
@internal
|
||||||
void updateFromInfo(lk_models.ParticipantInfo info) {
|
void updateFromInfo(lk_models.ParticipantInfo info) {
|
||||||
identity = info.identity;
|
identity = info.identity;
|
||||||
|
_name = info.name;
|
||||||
// participantSid = info.sid;
|
// participantSid = info.sid;
|
||||||
if (info.metadata.isNotEmpty) {
|
if (info.metadata.isNotEmpty) {
|
||||||
_setMetadata(info.metadata);
|
_setMetadata(info.metadata);
|
||||||
|
|||||||
@@ -22,10 +22,12 @@ class RemoteParticipant extends Participant<RemoteTrackPublication> {
|
|||||||
required Room room,
|
required Room room,
|
||||||
required String sid,
|
required String sid,
|
||||||
required String identity,
|
required String identity,
|
||||||
|
required String name,
|
||||||
}) : super(
|
}) : super(
|
||||||
room: room,
|
room: room,
|
||||||
sid: sid,
|
sid: sid,
|
||||||
identity: identity,
|
identity: identity,
|
||||||
|
name: name,
|
||||||
);
|
);
|
||||||
|
|
||||||
@internal
|
@internal
|
||||||
@@ -36,6 +38,7 @@ class RemoteParticipant extends Participant<RemoteTrackPublication> {
|
|||||||
room: room,
|
room: room,
|
||||||
sid: info.sid,
|
sid: info.sid,
|
||||||
identity: info.identity,
|
identity: info.identity,
|
||||||
|
name: info.name,
|
||||||
) {
|
) {
|
||||||
updateFromInfo(info);
|
updateFromInfo(info);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user