From 58543669e84c56605a3d91d64fbc5779ce387ae6 Mon Sep 17 00:00:00 2001 From: Emily Berghen Date: Thu, 15 May 2025 08:55:54 +0200 Subject: [PATCH] Update video parser url --- tailoff/js/components/videoToggle.component.ts | 7 ++++++- templates/_site/_snippet/_content/_blocks/_textVideo.twig | 2 +- templates/_site/_snippet/_content/_blocks/_video.twig | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tailoff/js/components/videoToggle.component.ts b/tailoff/js/components/videoToggle.component.ts index 749916d3..c2c969bb 100644 --- a/tailoff/js/components/videoToggle.component.ts +++ b/tailoff/js/components/videoToggle.component.ts @@ -119,7 +119,12 @@ class VideoToggle { this.clearVideoContainer(); this.trigger.setAttribute('aria-expanded', 'true'); this.videoContent.classList.remove(this.options.hideClass); - this.videoIFrame.setAttribute('src', this.options.url + '?autoplay=1'); + + let url = new URL(this.options.url); + url.searchParams.append('autoplay', '1'); + + this.videoIFrame.setAttribute('src', url.toString()); + if (this.options.showCloseButton) { this.videoCloseButton.classList.remove(this.options.hideClass); } diff --git a/templates/_site/_snippet/_content/_blocks/_textVideo.twig b/templates/_site/_snippet/_content/_blocks/_textVideo.twig index dd17d936..19f4b726 100644 --- a/templates/_site/_snippet/_content/_blocks/_textVideo.twig +++ b/templates/_site/_snippet/_content/_blocks/_textVideo.twig @@ -35,7 +35,7 @@ {% endif %} {% endif %}