Skip to content

Commit 5c2cb3a

Browse files
committed
Allow local videos, DEV-1111
1 parent c397817 commit 5c2cb3a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

view/frontend/web/js/slide-widget-mixin.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ define([
88
'use strict';
99

1010
return function (originalWidget) {
11-
/**
12-
* Check if the video source URL is from a supported platform
13-
* @param {string} url - The video source URL
14-
* @returns {boolean} - True if the URL is from YouTube, YouTube-nocookie, or Vimeo
15-
*/
1611
function isSupportedVideoPlatform(url) {
17-
if (!url) return false;
12+
if (!url) {
13+
return false;
14+
}
1815

1916
// Regex patterns for supported video platforms
2017
const youtubePattern = /^https?:\/\/(www\.)?(youtube\.com|youtu\.be)\//i;
@@ -28,7 +25,6 @@ define([
2825

2926
return function (config, element) {
3027
const videoElement = element[0].querySelector('[data-background-type=video]');
31-
console.log('videoElement', videoElement);
3228
const blockVideoConsentConfig = window.cookiebotConfig && window.cookiebotConfig.blockVideosUntilConsent;
3329
const videoSrc = videoElement.getAttribute('data-video-src');
3430
const cookieblockSrc = videoElement.getAttribute('data-cookieblock-src');
@@ -46,7 +42,7 @@ define([
4642
addEventListener('CookiebotOnLoad', sliderVideoBlocker);
4743

4844
function sliderVideoBlocker() {
49-
if (previousStatus === 'blocked' && !Cookiebot?.consent?.marketing) {
45+
if (previousStatus === 'blocked' && (!Cookiebot?.consent?.marketing)) {
5046
return;
5147
}
5248

0 commit comments

Comments
 (0)