This commit is contained in:
2024-10-24 16:23:50 +08:00
parent 8634c204f1
commit efe39dda4d
3 changed files with 19 additions and 19 deletions

View File

@@ -1,5 +1,10 @@
package websocket
import (
"live-streamer/streamer"
"os"
)
type RequestType string
const (
@@ -18,3 +23,15 @@ type Date struct {
VideoList []string `json:"videoList"`
Output string `json:"output"`
}
func RequestHandler(reqType RequestType) {
switch reqType {
case TypeStreamNextVideo:
streamer.GlobalStreamer.Next()
case TypeStreamPrevVideo:
streamer.GlobalStreamer.Prev()
case TypeQuit:
streamer.GlobalStreamer.Close()
os.Exit(0)
}
}