From 9da28cb1c1915f804997672d0316598268e2956a Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Mon, 29 Jul 2024 13:49:24 +0500 Subject: [PATCH] Fix: Selecting multiple videos while embedding a Video Experience results in error --- assets/js/src/block.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/assets/js/src/block.js b/assets/js/src/block.js index ae9fd462..a920c1cf 100644 --- a/assets/js/src/block.js +++ b/assets/js/src/block.js @@ -170,11 +170,21 @@ }, [pictureinpicture]); // Sanitize the IDs we need - var sanitizeIds = function (id) { - if (id?.indexOf('ref:') === 0) { - return id; + var sanitizeIds = function (ids) { + if (!ids) { + return ids; } - return id?.replace(/\D/g, ''); + + return ids + .split(',') + .map(function (id) { + id = id.trim(); + if (id.indexOf('ref:') === 0) { + return id; + } + return id.replace(/\D/g, ''); + }) + .join(','); }; /**