VideoConcat/wails3-app/app.go
2026-01-06 19:35:21 +08:00

51 lines
1013 B
Go

package main
import (
"embed"
"github.com/wailsapp/wails/v3/pkg/application"
"videoconcat/services"
)
//go:embed assets
var assets embed.FS
func main() {
app := application.New(application.Options{
Name: "VideoConcat",
Description: "视频拼接工具",
Assets: application.AssetOptions{FS: assets},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
// 创建服务
videoService := services.NewVideoService()
extractService := services.NewExtractService()
authService := services.NewAuthService()
fileService := services.NewFileService()
// 绑定服务到前端
app.Bind(videoService)
app.Bind(extractService)
app.Bind(authService)
app.Bind(fileService)
// 创建窗口
window := app.NewWebviewWindow(application.WebviewWindowOptions{
Title: "视频拼接工具",
Width: 1100,
Height: 800,
MinWidth: 800,
MinHeight: 600,
})
window.SetURL("index.html")
if err := app.Run(); err != nil {
panic(err)
}
}