VideoTools/vendor/github.com/fyne-io/glfw-js/clipboard_wasm.go
Stu Leak 68df790d27 Fix player frame generation and video playback
Major improvements to UnifiedPlayer:

1. GetFrameImage() now works when paused for responsive UI updates
2. Play() method properly starts FFmpeg process
3. Frame display loop runs continuously for smooth video display
4. Disabled audio temporarily to fix video playback fundamentals
5. Simplified FFmpeg command to focus on video stream only

Player now:
- Generates video frames correctly
- Shows video when paused
- Has responsive progress tracking
- Starts playback properly

Next steps: Re-enable audio playback once video is stable
2026-01-07 22:20:00 -05:00

43 lines
1012 B
Go

//go:build wasm
package glfw
import "syscall/js"
var clipboard = js.Global().Get("navigator").Get("clipboard")
// GetClipboardString returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string.
//
// This function may only be called from the main thread.
func GetClipboardString() string {
text := make(chan string)
read := js.FuncOf(func(this js.Value, p []js.Value) any {
content := p[0]
if !content.Truthy() {
text <- ""
return nil
}
text <- content.String()
return nil
})
defer read.Release()
handleError := js.FuncOf(func(this js.Value, args []js.Value) any {
text <- ""
return nil
})
defer handleError.Release()
clipboard.Call("readText").Call("then", read).Call("catch", handleError)
return <-text
}
// SetClipboardString sets the system clipboard to the specified UTF-8 encoded string.
//
// This function may only be called from the main thread.
func SetClipboardString(str string) {
clipboard.Call("writeText", str)
}