How to Stream Frames from navigator.mediaDevices.getDisplayMedia() Directly to Go in Wails for Low-Latency Screen Sharing? #4764
-
|
Hey Wails community! I'm building a real-time chat app with screen sharing (Discord-style), and I'm wondering: What's the best way to capture video frames directly from navigator.mediaDevices.getDisplayMedia() in the frontend and pipe them seamlessly into the Go backend using Wails bindings or events? Has anyone implemented this without heavy overhead like base64 encoding or extra WebSockets? I've tried using Events for this (e.g., runtime.EventsEmit('new-frame', frameData)), but it's not ideal for such high-frequency real-time updates. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
For v3, we have moved to an in-memory HTTP protocol for bindings which makes this efficient 👍 For v2 you would have to look at using a custom middleware in the AssetServer. |
Beta Was this translation helpful? Give feedback.
-
|
I decided to use WebTransport API |
Beta Was this translation helpful? Give feedback.
For v3, we have moved to an in-memory HTTP protocol for bindings which makes this efficient 👍 For v2 you would have to look at using a custom middleware in the AssetServer.