- Vidéos recompressées (CRF 23, faststart, full res/fps) : 22MB → 5.8MB et 4.8MB - Champs Kirby dynamiques pour vidéo desktop/mobile + posters - Source vidéo dynamique via data.backgroundVideo (corrige le hardcode) - Lecture déclenchée sur canplay plutôt qu'immédiatement (évite freeze) - preload="auto" pour un buffering plus agressif Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1 KiB
PHP
27 lines
1 KiB
PHP
<?php
|
|
|
|
$specificData = [
|
|
'hero' => [
|
|
'title' => $page->heroTitle()->value(),
|
|
'titleHighlight' => $page->heroTitleHighlight()->value(),
|
|
'subtitle' => $page->heroSubtitle()->value(),
|
|
'ctaText' => $page->ctaText()->value(),
|
|
'ctaPath' => $page->ctaLink()->toPage()?->id() ?? '#',
|
|
'image' => $page->heroImage()->toFile()?->url()
|
|
],
|
|
'backgroundVideo' => $page->backgroundVideo()->toFile()?->url(),
|
|
'backgroundVideoPoster' => $page->backgroundVideoPoster()->toFile()?->url(),
|
|
'backgroundVideoMobile' => $page->backgroundVideoMobile()->toFile()?->url(),
|
|
'backgroundVideoMobilePoster' => $page->backgroundVideoMobilePoster()->toFile()?->url(),
|
|
'floatingBubbles' => $page->floatingBubbles()->toStructure()->map(function($bubble) {
|
|
return [
|
|
'text' => $bubble->text()->value(),
|
|
'position' => $bubble->position()->value()
|
|
];
|
|
})->values()
|
|
];
|
|
|
|
$pageData = array_merge($genericData, $specificData);
|
|
|
|
header('Content-Type: application/json');
|
|
echo json_encode($pageData);
|