diff --git a/modules/contrib/varbase_media/js/lazy-load-oembed.js b/modules/contrib/varbase_media/js/lazy-load-oembed.js
index d851334e7..cba524346 100644
--- a/modules/contrib/varbase_media/js/lazy-load-oembed.js
+++ b/modules/contrib/varbase_media/js/lazy-load-oembed.js
@@ -6,37 +6,48 @@

   'use strict';

-  Drupal.behaviors.lazyLoadYoutube = {
-    attach: function (context) {
-      const video_embeds = context.querySelectorAll('.js-lazy-load-oembed');
-      video_embeds.forEach(function (video_embed) {
-        if (video_embed.closest('.media').querySelector('.media-cover-image') == null) {
-          let div = document.createElement("div");
-          let image = document.createElement("img");
-          image.setAttribute('src', video_embed.getAttribute('data-video-thumbnail'));
-          image.setAttribute('width', '100%');
-          div.classList.add("media-cover-image");
-          div.classList.add("video-player-icon");
-          div.classList.add("js-video-player-icon");
-          div.prepend(image);
-          video_embed.closest('.media').prepend(div);
-        }
-        const button = video_embed.closest('.media').querySelector('.js-video-player-icon');
-        // When a play button is clicked:
-        // 1) Copy the data-src attribute to the src attribute
-        // 2) Delete the data-src attribute
-        // 3) Detach the button from the DOM
-        button.addEventListener('click', function (event) {
-          const iframe = video_embed.closest('.media').querySelector('iframe');
-          const src = iframe.getAttribute('data-src');
-          iframe.removeAttribute('data-src');
-          iframe.setAttribute('src', src);
-        });
-      });
+// Define a global variable to track if the behavior has been attached
+var lazyLoadYoutubeInitialized = false;

-      $('.js-lazy-load-oembed').on("load", function () {
-        $(this).get(0).contentWindow.postMessage("play", "*");
-      });
+Drupal.behaviors.lazyLoadYoutube = {
+  attach: function (context, settings) {
+    if (lazyLoadYoutubeInitialized) {
+      return; // Prevent multiple executions
     }
+
+    const video_embeds = context.querySelectorAll('.js-lazy-load-oembed');
+    video_embeds.forEach(function (video_embed) {
+      if (video_embed.closest('.media').querySelector('.media-cover-image') == null) {
+        let div = document.createElement("div");
+        let image = document.createElement("img");
+        image.setAttribute('src', video_embed.getAttribute('data-video-thumbnail'));
+        image.setAttribute('width', '100%');
+        div.classList.add("media-cover-image");
+        div.classList.add("video-player-icon");
+        div.classList.add("js-video-player-icon");
+        div.prepend(image);
+        video_embed.closest('.media').prepend(div);
+      }
+    });
+
+    // Add event listener to a common parent element using event delegation
+    document.addEventListener('click', function(event) {
+      if (event.target && event.target.closest('.js-video-player-icon')) {
+        const button = event.target.closest('.js-video-player-icon');
+        const video_embed = button.closest('.media').querySelector('.js-lazy-load-oembed');
+        const iframe = video_embed.closest('.media').querySelector('iframe');
+        const src = iframe.getAttribute('data-src');
+        iframe.removeAttribute('data-src');
+        iframe.setAttribute('src', src);
+      }
+    });
+
+    $('.js-lazy-load-oembed').on("load", function () {
+      $(this).get(0).contentWindow.postMessage("play", "*");
+    });
+
+    // Set the global variable to indicate that the behavior has been attached
+    lazyLoadYoutubeInitialized = true;
   }
+};
 })(window.jQuery, Drupal);
