2025-04-08 06:37:14 +04:00
|
|
|
<?php
|
2025-04-08 09:12:46 +04:00
|
|
|
// Inclure la configuration si ce n'est pas déjà fait
|
|
|
|
|
if (!function_exists('getRecentVideos')) {
|
|
|
|
|
require_once __DIR__ . '/config.php';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Récupérer les vidéos récentes depuis l'API PeerTube
|
|
|
|
|
$recentVideos = getRecentVideos();
|
2025-04-08 06:37:14 +04:00
|
|
|
|
|
|
|
|
// Affichage des vidéos
|
2025-04-08 09:12:46 +04:00
|
|
|
foreach ($recentVideos as $video):
|
2025-04-08 06:37:14 +04:00
|
|
|
?>
|
|
|
|
|
<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; ?>
|