live-streamer/websocket_handler.go
2024-10-24 05:06:19 +08:00

19 lines
330 B
Go

package main
import (
"live-streamer/websocket"
"os"
)
func websocketRequestHandler(reqType websocket.RequestType) {
switch reqType {
case websocket.TypeStreamNextVideo:
GlobalStreamer.Next()
case websocket.TypeStreamPrevVideo:
GlobalStreamer.Prev()
case websocket.TypeQuit:
GlobalStreamer.Close()
os.Exit(0)
}
}