From 8083e3b5cb65ffe06810d6e37542a316a36a3ebf Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 10 Feb 2023 15:50:20 +0100 Subject: [PATCH] openvidu-components: Generate stronger unique id for participants --- .../openvidu-angular/src/lib/models/participant.model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/models/participant.model.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/models/participant.model.ts index 1cbff033..e9ff210e 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/models/participant.model.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/models/participant.model.ts @@ -68,7 +68,7 @@ export abstract class ParticipantAbstractModel { isMutedForcibly: boolean; constructor(props: ParticipantProperties, model?: StreamModel) { - this.id = props.id ? props.id : new Date().getTime().toString(); + this.id = props.id ? props.id : Math.random().toString(32).replace('.','_'); this.local = props.local; this.nickname = props.nickname; this.colorProfile = !!props.colorProfile ? props.colorProfile : `hsl(${Math.random() * 360}, 100%, 80%)`;