From 2de2920acfdf18960fe06d6cbc26e40aa5e9cd3c Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Wed, 18 Jun 2025 10:12:39 +0200 Subject: [PATCH] ov-components: Add check for existing Material Icons link in VideoconferenceComponent --- .../videoconference/videoconference.component.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.ts index 60a09c8b..f58d0189 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.ts @@ -413,11 +413,14 @@ export class VideoconferenceComponent implements OnDestroy, AfterViewInit { * @internal */ ngAfterViewInit() { - //Add material icons to the page - const link = document.createElement('link'); - link.href = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&icon_names=background_replace,keep_off'; - link.rel = 'stylesheet'; - document.head.appendChild(link); + //Add material icons to the page if not already present + const existingLink = document.querySelector('link[href*="Material+Symbols+Outlined"]'); + if (!existingLink) { + const link = document.createElement('link'); + link.href = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&icon_names=background_replace,keep_off'; + link.rel = 'stylesheet'; + document.head.appendChild(link); + } if (this.externalToolbar) { this.log.d('Setting EXTERNAL TOOLBAR'); this.openviduAngularToolbarTemplate = this.externalToolbar.template;