Add web HTTP-FLV playback path

This commit is contained in:
2026-04-01 11:30:52 +08:00
parent 01b25883e1
commit 48dc6c7b26
11 changed files with 455 additions and 93 deletions

View File

@@ -18,9 +18,11 @@ func main() {
// Initialize Chat WebSocket Hub
chat.InitChat()
srv := stream.NewRTMPServer()
// Start the API server in a goroutine so it doesn't block the RTMP server
go func() {
r := api.SetupRouter()
r := api.SetupRouter(srv)
log.Println("[INFO] API Server is listening on :8080...")
if err := r.Run(":8080"); err != nil {
log.Fatalf("Failed to start API server: %v", err)
@@ -29,7 +31,6 @@ func main() {
// Setup and start the RTMP server
log.Println("[INFO] Ready to receive RTMP streams from OBS.")
srv := stream.NewRTMPServer()
if err := srv.Start(":1935"); err != nil {
log.Fatalf("Failed to start RTMP server: %v", err)
}