Files
kaubuntu.re/includes/recent-videos.php
T
2025-04-08 06:37:14 +04:00

78 lines
2.7 KiB
PHP

<?php
// Dans un vrai projet, ces données viendraient d'une API PeerTube
// Pour cet exemple, on utilise des données statiques
$recentVideos = [
[
'id' => 4,
'title' => 'Festival Sakifo 2023 - Les meilleurs moments',
'thumbnail' => 'img/video-thumbnails/recent-1.jpg',
'duration' => 1832, // en secondes
'channel' => 'Culture 974',
'views' => 3420,
'date' => '2023-12-15'
],
[
'id' => 5,
'title' => 'Cuisine créole: Recette du rougail saucisse traditionnel',
'thumbnail' => 'img/video-thumbnails/recent-2.jpg',
'duration' => 685,
'channel' => 'Saveurs des Îles',
'views' => 7245,
'date' => '2023-12-10'
],
[
'id' => 6,
'title' => 'Tutoriel: Créer votre première application web avec PHP',
'thumbnail' => 'img/video-thumbnails/recent-3.jpg',
'duration' => 1540,
'channel' => 'CodeMastery',
'views' => 2180,
'date' => '2023-12-08'
],
[
'id' => 7,
'title' => 'Les plus belles plages de La Réunion en 2023',
'thumbnail' => 'img/video-thumbnails/recent-4.jpg',
'duration' => 925,
'channel' => 'Île Aventure',
'views' => 5690,
'date' => '2023-12-05'
],
[
'id' => 8,
'title' => 'Débat: L\'avenir du numérique à La Réunion',
'thumbnail' => 'img/video-thumbnails/recent-5.jpg',
'duration' => 3245,
'channel' => 'Tech Libre',
'views' => 1250,
'date' => '2023-12-01'
],
[
'id' => 9,
'title' => 'Concert live: Groupe Sakili au Téat Plein Air',
'thumbnail' => 'img/video-thumbnails/recent-6.jpg',
'duration' => 4512,
'channel' => 'Culture 974',
'views' => 4325,
'date' => '2023-11-28'
]
];
// Affichage des vidéos
foreach ($recentVideos as $video) :
?>
<div class="video-card" data-video-id="<?php echo $video['id']; ?>">
<div class="video-thumbnail">
<img src="<?php echo $video['thumbnail']; ?>" alt="<?php echo $video['title']; ?>" data-src="<?php echo $video['thumbnail']; ?>">
<div class="video-duration"><?php echo formatDuration($video['duration']); ?></div>
</div>
<div class="video-info">
<h3 class="video-title"><?php echo $video['title']; ?></h3>
<div class="video-channel"><?php echo $video['channel']; ?></div>
<div class="video-metadata">
<span class="video-views"><?php echo formatViewCount($video['views']); ?> vues</span>
<span class="video-date"><?php echo formatDate($video['date']); ?></span>
</div>
</div>
</div>
<?php endforeach; ?>