FEATURE refactoring Video block and introducing audio variation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
64715817a5
commit
dc16228d12
35
plugins/carhop-blocks/acf-blocks/custom-audio/block.json
Normal file
35
plugins/carhop-blocks/acf-blocks/custom-audio/block.json
Normal 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"
|
||||||
|
}
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
"foreground": "#136f63",
|
"foreground": "#136f63",
|
||||||
"src": "format-video"
|
"src": "format-video"
|
||||||
},
|
},
|
||||||
|
"description": "Pour intégrer une vidéo auto-hébergée sur infomaniak",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"vidéo",
|
"vidéo",
|
||||||
"video",
|
"video",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
<?php
|
<?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')) ?>>
|
<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;">
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ function create_block_carhop_blocks_block_init()
|
||||||
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
||||||
register_block_type(__DIR__ . '/acf-blocks/social-networks');
|
register_block_type(__DIR__ . '/acf-blocks/social-networks');
|
||||||
register_block_type(__DIR__ . '/acf-blocks/custom-video');
|
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/team-carhop');
|
||||||
register_block_type(__DIR__ . '/acf-blocks/member-card');
|
register_block_type(__DIR__ . '/acf-blocks/member-card');
|
||||||
register_block_type(__DIR__ . '/acf-blocks/statistiques-collections');
|
register_block_type(__DIR__ . '/acf-blocks/statistiques-collections');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user