CourseHub: AJAX video course player (PHP + MySQL + Bootstrap + Plyr)

Scans nested course folders for mp4s, tracks per-user resume position
and per-folder progress. SPA frontend with hash routing over a JSON API;
range-request streaming via stream.php.
This commit is contained in:
Harwinder Sekhon
2026-07-11 10:25:35 -04:00
commit 3ae6c1ae2e
16 changed files with 1328 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
// POST api/scan.php -> rescan the library, returns stats.
require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../includes/functions.php';
header('Content-Type: application/json');
requireLoginApi();
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['error' => 'Method not allowed']);
exit;
}
try {
echo json_encode(['ok' => true, 'stats' => scanLibrary()]);
} catch (Throwable $e) {
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}