FEATURE refactoring Video block and introducing audio variation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2026-05-07 16:35:14 +02:00
parent 64715817a5
commit dc16228d12
5 changed files with 66 additions and 3 deletions

View File

@ -0,0 +1,35 @@
{
"name": "acf/custom-audio",
"title": "Audio Auto-hébergée",
"category": "carhop-blocks",
"multiple": true,
"icon": {
"foreground": "#136f63",
"src": "format-video"
},
"description": "Pour intégrer un son / audio auto-hébergée sur infomaniak",
"keywords": [
"audio",
"son",
"musique",
"mp3",
"infomniak",
"auto-hébergée"
],
"supports": {
"align": [
"full"
]
},
"styles": [
{
"name": "stacked-background",
"label": "Fond empilé"
}
],
"acf": {
"mode": "auto",
"renderTemplate": "custom-audio.php"
},
"align": "full"
}

View File

@ -0,0 +1,19 @@
<?php
$share_link = get_field('share_link');
if($share_link){
$video_id_from_share_link = basename($share_link);
}
?>
<section <?php echo get_block_wrapper_attributes(array('class' => 'block-custom-video custom-video content-section')) ?>>
<div style="position: relative; width: 100%; padding-bottom: 56.25%; height: 50px; overflow: hidden;">
<iframe id="ik-vod-<?php echo $video_id_from_share_link ; ?>" class="ik-player-1jhvl2upwockr ik-embed" src="https://player.vod2.infomaniak.com/embed/<?php echo $video_id_from_share_link ; ?>" width="100%" height="0px" 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

@ -7,6 +7,7 @@
"foreground": "#136f63",
"src": "format-video"
},
"description": "Pour intégrer une vidéo auto-hébergée sur infomaniak",
"keywords": [
"vidéo",
"video",

View File

@ -1,5 +1,10 @@
<?php
$custom_video_id = get_field('custom_video_id');
$share_link = get_field('share_link');
if($share_link){
$video_id_from_share_link = basename($share_link);
}
?>
@ -7,6 +12,8 @@ $custom_video_id = get_field('custom_video_id');
<section <?php echo get_block_wrapper_attributes(array('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>
<iframe id="ik-vod-<?php echo $video_id_from_share_link ; ?>" class="ik-player-1jhvl2upwockr ik-embed" src="https://player.vod2.infomaniak.com/embed/<?php echo $video_id_from_share_link ; ?>" 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>
</section>

View File

@ -26,6 +26,7 @@ function create_block_carhop_blocks_block_init()
register_block_type(__DIR__ . '/acf-blocks/gallery');
register_block_type(__DIR__ . '/acf-blocks/social-networks');
register_block_type(__DIR__ . '/acf-blocks/custom-video');
register_block_type(__DIR__ . '/acf-blocks/custom-audio');
register_block_type(__DIR__ . '/acf-blocks/team-carhop');
register_block_type(__DIR__ . '/acf-blocks/member-card');
register_block_type(__DIR__ . '/acf-blocks/statistiques-collections');