streamHLS($videoKey, $hlsPath, $userId); } elseif ($format) { // Stream progressive video $streaming->streamVideo($videoKey, $format, $userId); } else { // Return streaming information as JSON header('Content-Type: application/json'); $streamInfo = $streaming->getVideoStreams($videoKey, $userId); echo json_encode($streamInfo); } } catch (Exception $e) { VLogger::getInstance()->error('Streaming endpoint error', [ 'video_key' => $videoKey, 'format' => $format, 'hls_path' => $hlsPath, 'user_id' => $userId, 'error' => $e->getMessage() ]); http_response_code(500); exit('Streaming error'); } ?>