feat: permit display one video in index
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Section Hero - Affichage conditionnel (Direct / Playlist / Rien)
|
||||
* Section Hero - Affichage conditionnel (Direct / Playlist / Vidéo / Rien)
|
||||
*
|
||||
* Ce fichier gère l'affichage de la section hero en fonction de la configuration:
|
||||
* - HERO_TYPE = 'live': Affiche le direct PeerTube
|
||||
* - HERO_TYPE = 'video': Affiche une vidéo PeerTube unique
|
||||
* - HERO_TYPE = 'playlist': Affiche une playlist (PeerTube/Funkwhale/Castopod)
|
||||
* - HERO_TYPE = 'none': N'affiche rien
|
||||
*/
|
||||
@@ -19,7 +20,15 @@ if ($heroType === 'none') {
|
||||
|
||||
<section class="hero" aria-labelledby="hero-section-title">
|
||||
<h2 id="hero-section-title" class="sr-only">
|
||||
<?php echo $heroType === 'live' ? 'Diffusion en direct' : 'Playlist'; ?>
|
||||
<?php
|
||||
if ($heroType === 'live') {
|
||||
echo 'Diffusion en direct';
|
||||
} elseif ($heroType === 'video') {
|
||||
echo 'Vidéo';
|
||||
} else {
|
||||
echo 'Playlist';
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<?php if ($heroType === 'live'): ?>
|
||||
@@ -252,5 +261,31 @@ if ($heroType === 'none') {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php elseif ($heroType === 'video'): ?>
|
||||
<!-- Mode VIDÉO -->
|
||||
<?php
|
||||
$videoId = defined('HERO_VIDEO_ID') ? HERO_VIDEO_ID : '';
|
||||
$videoTitle = defined('HERO_VIDEO_TITLE') ? HERO_VIDEO_TITLE : 'Vidéo de présentation';
|
||||
|
||||
if (!empty($videoId)):
|
||||
?>
|
||||
<div class="hero-video-container">
|
||||
<iframe
|
||||
src="<?php echo PEERTUBE_URL; ?>/videos/embed/<?php echo $videoId; ?>"
|
||||
frameborder="0"
|
||||
allowfullscreen="allowfullscreen"
|
||||
sandbox="allow-same-origin allow-scripts allow-popups"
|
||||
allow="autoplay; fullscreen"
|
||||
title="<?php echo htmlspecialchars($videoTitle); ?>">
|
||||
</iframe>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="hero-no-live">
|
||||
<i class="fas fa-video"></i>
|
||||
<h2>Vidéo non configurée</h2>
|
||||
<p>Configurez HERO_VIDEO_ID dans votre fichier de configuration.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user