mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2026-05-19 09:15:47 +08:00
gui refactor
This commit is contained in:
19
gui/views/player/handler.go
Normal file
19
gui/views/player/handler.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package player
|
||||
|
||||
import (
|
||||
"AynaLivePlayer/core/events"
|
||||
"AynaLivePlayer/global"
|
||||
"AynaLivePlayer/gui/gctx"
|
||||
"AynaLivePlayer/pkg/eventbus"
|
||||
)
|
||||
|
||||
func registerHandlers() {
|
||||
global.EventBus.Subscribe(gctx.EventChannel, events.GUISetPlayerWindowOpenCmd, "gui.player.videoplayer.handleopen", func(event *eventbus.Event) {
|
||||
data := event.Data.(events.GUISetPlayerWindowOpenCmdEvent)
|
||||
if data.SetOpen {
|
||||
playerWindow.Close()
|
||||
} else {
|
||||
showPlayerWindow()
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user