live-streamer/websocket_handler.go

19 lines
330 B
Go
Raw Normal View History

2024-10-23 14:35:37 -04:00
package main
import (
"live-streamer/websocket"
2024-10-23 17:06:19 -04:00
"os"
2024-10-23 14:35:37 -04:00
)
2024-10-23 17:06:19 -04:00
func websocketRequestHandler(reqType websocket.RequestType) {
switch reqType {
2024-10-23 14:35:37 -04:00
case websocket.TypeStreamNextVideo:
GlobalStreamer.Next()
case websocket.TypeStreamPrevVideo:
GlobalStreamer.Prev()
case websocket.TypeQuit:
GlobalStreamer.Close()
2024-10-23 17:06:19 -04:00
os.Exit(0)
2024-10-23 14:35:37 -04:00
}
}