mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-11 20:58:13 +08:00
rewrite
This commit is contained in:
32
gui/player_videoplayer.go
Normal file
32
gui/player_videoplayer.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package gui
|
||||
|
||||
import (
|
||||
"AynaLivePlayer/core/events"
|
||||
"AynaLivePlayer/global"
|
||||
"AynaLivePlayer/gui/xfyne"
|
||||
"fyne.io/fyne/v2"
|
||||
)
|
||||
|
||||
func setupPlayerWindow() {
|
||||
playerWindow = App.NewWindow("CorePlayerPreview")
|
||||
playerWindow.Resize(fyne.NewSize(480, 240))
|
||||
playerWindow.SetCloseIntercept(func() {
|
||||
playerWindow.Hide()
|
||||
})
|
||||
MainWindow.SetOnClosed(func() {
|
||||
playerWindow.Close()
|
||||
})
|
||||
playerWindow.Hide()
|
||||
}
|
||||
|
||||
func showPlayerWindow() {
|
||||
playerWindow.Show()
|
||||
if playerWindowHandle == 0 {
|
||||
playerWindowHandle = xfyne.GetWindowHandle(playerWindow)
|
||||
logger.Infof("video output window handle: %d", playerWindowHandle)
|
||||
if playerWindowHandle != 0 {
|
||||
global.EventManager.CallA(events.PlayerVideoPlayerSetWindowHandleCmd,
|
||||
events.PlayerVideoPlayerSetWindowHandleCmdEvent{Handle: playerWindowHandle})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user