mirror of https://github.com/OpenVidu/openvidu.git
ov-components: Fixed directive value update
Ensures consistent identification of participant elements by using the participant identity, facilitating easier manipulation and tracking of elements. Improves component updates by storing the remote participants value locally.master
parent
a3810f4f51
commit
3531932c88
|
|
@ -10,7 +10,7 @@
|
||||||
OV_big: track.isPinned,
|
OV_big: track.isPinned,
|
||||||
OV_ignored: track.isAudioTrack && !track.participant.onlyHasAudioTracks
|
OV_ignored: track.isAudioTrack && !track.participant.onlyHasAudioTracks
|
||||||
}"
|
}"
|
||||||
[id]="'local-element-' + track.source"
|
[id]="'participant-' + track.participant.identity"
|
||||||
cdkDrag
|
cdkDrag
|
||||||
cdkDragBoundary=".layout"
|
cdkDragBoundary=".layout"
|
||||||
[cdkDragDisabled]="!track.isMinimized"
|
[cdkDragDisabled]="!track.isMinimized"
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
<div
|
<div
|
||||||
*ngFor="let track of remoteParticipants | tracks; trackBy: trackParticipantElement"
|
*ngFor="let track of remoteParticipants | tracks; trackBy: trackParticipantElement"
|
||||||
class="remote-participant"
|
class="remote-participant"
|
||||||
|
[id]="'participant-' + track.participant.identity"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
OV_root: !track.isAudioTrack,
|
OV_root: !track.isAudioTrack,
|
||||||
OV_publisher: !track.isAudioTrack,
|
OV_publisher: !track.isAudioTrack,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,10 @@ export class FallbackLogoDirective implements OnInit {
|
||||||
standalone: false
|
standalone: false
|
||||||
})
|
})
|
||||||
export class LayoutRemoteParticipantsDirective {
|
export class LayoutRemoteParticipantsDirective {
|
||||||
|
private _ovRemoteParticipants: ParticipantModel[] | undefined;
|
||||||
|
|
||||||
@Input() set ovRemoteParticipants(value: ParticipantModel[] | undefined) {
|
@Input() set ovRemoteParticipants(value: ParticipantModel[] | undefined) {
|
||||||
|
this._ovRemoteParticipants = value;
|
||||||
this.update(value);
|
this.update(value);
|
||||||
}
|
}
|
||||||
constructor(
|
constructor(
|
||||||
|
|
@ -71,7 +74,7 @@ export class LayoutRemoteParticipantsDirective {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.update(this.ovRemoteParticipants);
|
this.update(this._ovRemoteParticipants);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(value: ParticipantModel[] | undefined) {
|
update(value: ParticipantModel[] | undefined) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue