diff mrjunejune/main.c @ 242:543df0fe7168

[tools] Add full HLS player support
author MrJuneJune <me@mrjunejune.com>
date Mon, 03 Aug 2026 13:14:41 -0700
parents 9c2eec61a152
children b8aa08503378
line wrap: on
line diff
--- a/mrjunejune/main.c	Mon Aug 03 11:26:30 2026 -0700
+++ b/mrjunejune/main.c	Mon Aug 03 13:14:41 2026 -0700
@@ -295,6 +295,15 @@
   return resp;
 }
 
+Seobeo_Request_Entry* GetHlsPlayer(Seobeo_Request_Entry *req, Dowa_Arena *arena)
+{
+  Seobeo_Request_Entry *resp = NULL;
+  char *final_body = Dowa_Arena_Allocate(arena, 50 * 1024);
+  Seobeo_Render_Html_FilePath(final_body, "/tools/hls_player/index.html", arena);
+  Dowa_HashMap_Push_Arena(resp, "body", final_body, arena);
+  return resp;
+}
+
 // Background thread function for media processing
 void *Simple_WebpConverter_Background(void *arg)
 {
@@ -736,6 +745,7 @@
 CREATE_REDIRECT_HANDLER(Tools, "/tools")
 CREATE_REDIRECT_HANDLER(MarkDownToHtml, "/tools/markdown_to_html")
 CREATE_REDIRECT_HANDLER(FileConverter, "/tools/file_converter")
+CREATE_REDIRECT_HANDLER(HlsPlayer, "/tools/hls_player")
 CREATE_REDIRECT_HANDLER(Talk, "/talk")
 CREATE_REDIRECT_HANDLER(Editor, "/editor")
 
@@ -1856,6 +1866,8 @@
 
   Seobeo_Router_Register("GET", "/tools/file_converter", GetFileConverter);
   Seobeo_Router_Register("GET", "/tools/file_converter/index.html", GetRedirectFileConverter);
+  Seobeo_Router_Register("GET", "/tools/hls_player", GetHlsPlayer);
+  Seobeo_Router_Register("GET", "/tools/hls_player/index.html", GetRedirectHlsPlayer);
 
   // -- File converter --/
   Seobeo_Router_Register("POST", "/api/convert/image-to-webp", ConvertImageToWebP);