diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 995af675..a2bbecb7 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -73,7 +73,7 @@ class SecureHeaders ); $response->headers->set('Feature-Policy', \implode(',', [ 'fullscreen', 'accelerometer', 'encrypted-media', - 'gyroscope', 'picture-in-picture', '\'self\'' + 'gyroscope', 'picture-in-picture' ]) . ';'); return $response; } diff --git a/resources/js/main.js b/resources/js/main.js index cab2ffda..b8157620 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -41,6 +41,52 @@ pages.keys().map(key => { }); }); +document.addEventListener('DOMContentLoaded', function () { + // * Video frames. + console.log('là'); + const videoFrameList = document.querySelectorAll(".video-frame"); + console.log(videoFrameList); + for (const videoLink of videoFrameList) { + if (!videoLink.dataset.type) { + throw new Error("Missing dataset type"); + } + if (!videoLink.dataset.frame) { + throw new Error("Missing dataset frame"); + } + // @ts-ignore + window.__CN_VIDEO = window.__CN_VIDEO ?? {}; + + const newIframe = document.createElement("iframe"); + newIframe.frameBorder = "0"; + newIframe.allow = "fullscreen"; + newIframe.width = "1920px"; + newIframe.height = "1080px"; + newIframe.setAttribute("allowfullscreen", "allowfullscreen"); + + // @ts-ignore + const instance = new FsLightbox(); + instance.props.sources = [newIframe]; + + setTimeout(() => { + videoLink.addEventListener("click", (e) => { + e.preventDefault(); + + // * This comes fslightbox lib + // @ts-ignore + instance.open(); + setTimeout(function () { + // @ts-ignore + newIframe.src = window.__CN_VIDEO[videoLink.dataset.type] + ? String(videoLink.href) + : String(videoLink.dataset.frame); + console.log(newIframe); + }, 50); + return false; + }); + }, 300); + } +}) + let vueOptions = { el: "#app" }; diff --git a/resources/views/front/modules/video-vimeo.blade.php b/resources/views/front/modules/video-vimeo.blade.php index 8034591b..52565aaa 100644 --- a/resources/views/front/modules/video-vimeo.blade.php +++ b/resources/views/front/modules/video-vimeo.blade.php @@ -1,3 +1,9 @@ -
- -
+ + Alt + + diff --git a/resources/views/front/webldc-cn.blade.php b/resources/views/front/webldc-cn.blade.php index 4309d700..f27c7e94 100644 --- a/resources/views/front/webldc-cn.blade.php +++ b/resources/views/front/webldc-cn.blade.php @@ -64,9 +64,9 @@ FALLBACK; // VIMEO $cookies['vimeo'] = [ - 'name' => __('cookie-notice.custom.youtube.name'), - 'description' => __('cookie-notice.custom.youtube.description'), - 'labelLink' => __('cookie-notice.custom.youtube.labelLink'), + 'name' => __('cookie-notice.custom.vimeo.name'), + 'description' => __('cookie-notice.custom.vimeo.description'), + 'labelLink' => __('cookie-notice.custom.vimeo.labelLink'), 'link' => 'https://vimeo.com/cookie_policy', 'cookies' => [] ]; @@ -201,23 +201,26 @@ SCRIPT; @push('scripts') @endpush +