feat(wails): add native file dialogs and video streaming

FileService exposes open/save dialogs for video, project JSON, and WAV
export. User-selected videos stream from disk at /localmedia/video with
range request support for seeking in the webview.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 22:22:37 -07:00
parent f5feefe844
commit 3a5d9d849f
7 changed files with 271 additions and 3 deletions
+18 -3
View File
@@ -3,6 +3,7 @@ package main
import (
"embed"
"log"
"net/http"
"github.com/wailsapp/wails/v3/pkg/application"
)
@@ -11,21 +12,35 @@ import (
var assets embed.FS
func main() {
var fileService *FileService
app := application.New(application.Options{
Name: "sfxkeeb",
Description: "Annotate keyboard key presses on a video timeline",
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
Middleware: func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == localMediaVideoPath && fileService != nil {
fileService.serveVideo(w, r)
return
}
next.ServeHTTP(w, r)
})
},
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
fileService = NewFileService(app)
app.RegisterService(application.NewService(fileService))
app.Window.NewWithOptions(application.WebviewWindowOptions{
Title: "sfxkeeb",
Width: 1280,
Height: 900,
Title: "sfxkeeb",
Width: 1280,
Height: 900,
MinWidth: 960,
MinHeight: 600,
Mac: application.MacWindow{