Mercurial
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 241:9c2eec61a152 | 242:543df0fe7168 |
|---|---|
| 293 Seobeo_Render_Html_FilePath(final_body, "/tools/file_converter/index.html", arena); | 293 Seobeo_Render_Html_FilePath(final_body, "/tools/file_converter/index.html", arena); |
| 294 Dowa_HashMap_Push_Arena(resp, "body", final_body, arena); | 294 Dowa_HashMap_Push_Arena(resp, "body", final_body, arena); |
| 295 return resp; | 295 return resp; |
| 296 } | 296 } |
| 297 | 297 |
| 298 Seobeo_Request_Entry* GetHlsPlayer(Seobeo_Request_Entry *req, Dowa_Arena *arena) | |
| 299 { | |
| 300 Seobeo_Request_Entry *resp = NULL; | |
| 301 char *final_body = Dowa_Arena_Allocate(arena, 50 * 1024); | |
| 302 Seobeo_Render_Html_FilePath(final_body, "/tools/hls_player/index.html", arena); | |
| 303 Dowa_HashMap_Push_Arena(resp, "body", final_body, arena); | |
| 304 return resp; | |
| 305 } | |
| 306 | |
| 298 // Background thread function for media processing | 307 // Background thread function for media processing |
| 299 void *Simple_WebpConverter_Background(void *arg) | 308 void *Simple_WebpConverter_Background(void *arg) |
| 300 { | 309 { |
| 301 File_Converter_Config *configuration = (File_Converter_Config *)arg; | 310 File_Converter_Config *configuration = (File_Converter_Config *)arg; |
| 302 | 311 |
| 734 CREATE_REDIRECT_HANDLER(HomePage, "/") | 743 CREATE_REDIRECT_HANDLER(HomePage, "/") |
| 735 CREATE_REDIRECT_HANDLER(Resume, "/resume") | 744 CREATE_REDIRECT_HANDLER(Resume, "/resume") |
| 736 CREATE_REDIRECT_HANDLER(Tools, "/tools") | 745 CREATE_REDIRECT_HANDLER(Tools, "/tools") |
| 737 CREATE_REDIRECT_HANDLER(MarkDownToHtml, "/tools/markdown_to_html") | 746 CREATE_REDIRECT_HANDLER(MarkDownToHtml, "/tools/markdown_to_html") |
| 738 CREATE_REDIRECT_HANDLER(FileConverter, "/tools/file_converter") | 747 CREATE_REDIRECT_HANDLER(FileConverter, "/tools/file_converter") |
| 748 CREATE_REDIRECT_HANDLER(HlsPlayer, "/tools/hls_player") | |
| 739 CREATE_REDIRECT_HANDLER(Talk, "/talk") | 749 CREATE_REDIRECT_HANDLER(Talk, "/talk") |
| 740 CREATE_REDIRECT_HANDLER(Editor, "/editor") | 750 CREATE_REDIRECT_HANDLER(Editor, "/editor") |
| 741 | 751 |
| 742 // S3 Upload URL API | 752 // S3 Upload URL API |
| 743 // POST /api/s3/upload-url | 753 // POST /api/s3/upload-url |
| 1854 Seobeo_Router_Register("GET", "/tools/markdown_to_html", GetMDToHTML); | 1864 Seobeo_Router_Register("GET", "/tools/markdown_to_html", GetMDToHTML); |
| 1855 Seobeo_Router_Register("GET", "/tools/markdown_to_html/index.html", GetRedirectMarkDownToHtml); | 1865 Seobeo_Router_Register("GET", "/tools/markdown_to_html/index.html", GetRedirectMarkDownToHtml); |
| 1856 | 1866 |
| 1857 Seobeo_Router_Register("GET", "/tools/file_converter", GetFileConverter); | 1867 Seobeo_Router_Register("GET", "/tools/file_converter", GetFileConverter); |
| 1858 Seobeo_Router_Register("GET", "/tools/file_converter/index.html", GetRedirectFileConverter); | 1868 Seobeo_Router_Register("GET", "/tools/file_converter/index.html", GetRedirectFileConverter); |
| 1869 Seobeo_Router_Register("GET", "/tools/hls_player", GetHlsPlayer); | |
| 1870 Seobeo_Router_Register("GET", "/tools/hls_player/index.html", GetRedirectHlsPlayer); | |
| 1859 | 1871 |
| 1860 // -- File converter --/ | 1872 // -- File converter --/ |
| 1861 Seobeo_Router_Register("POST", "/api/convert/image-to-webp", ConvertImageToWebP); | 1873 Seobeo_Router_Register("POST", "/api/convert/image-to-webp", ConvertImageToWebP); |
| 1862 Seobeo_Router_Register("POST", "/api/convert/video-to-mp4", ConvertVideoToMP4); | 1874 Seobeo_Router_Register("POST", "/api/convert/video-to-mp4", ConvertVideoToMP4); |
| 1863 Seobeo_Router_Register("GET", "/api/download/:filename", DownloadConvertedFile); | 1875 Seobeo_Router_Register("GET", "/api/download/:filename", DownloadConvertedFile); |