FEATURE Introducing block custom vidéo
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-10-13 11:15:22 +02:00
parent 43d1c2418d
commit 699a2efe1b
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,25 @@
{
"name": "acf/custom-video",
"title": "Vidéo Auto-hébergée",
"category": "carhop-blocks",
"multiple": true,
"icon": {
"foreground": "#136f63",
"src": "format-video"
},
"keywords": [
"vidéo",
"video",
"auto-hébergée"
],
"supports": {
"align": [
"full"
]
},
"acf": {
"mode": "auto",
"renderTemplate": "custom-video.php"
},
"align": "full"
}

View File

@ -0,0 +1,10 @@
<?php
$custom_video_id = get_field('custom_video_id');
?>
<section class="block-custom-video custom-video content-section">
<div style="position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden;">
<iframe id="ik-vod-<?php echo $custom_video_id; ?>" class="ik-player-1jhvl2upwockr ik-embed" src="https://player.vod2.infomaniak.com/embed/<?php echo $custom_video_id; ?>" width="100%" height="100%" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0" allowfullscreen crossorigin="anonymous" frameborder="0" allow="autoplay; fullscreen; picture-in-picture"></iframe>
</div>
</section>

View File

@ -56,6 +56,7 @@ function carhop_register_blocks()
register_block_type(__DIR__ . '/acf-blocks/gallery');
register_block_type(__DIR__ . '/acf-blocks/social-networks');
register_block_type(__DIR__ . '/acf-blocks/custom-video');
// Enregistrer le script pour le bloc gallery
wp_register_script(