The new WebBrowserComponent and ValueTrees

Yeah I’ve already implemented both, it’s pretty straight forward. One drawback of the Resource Provider I had to work around: you can’t pass any more parameters in than a sub-path when you’re calling it from the JS frontend. Is there a possibility to have the Resource provider call the getResource function not with a string, but an URL object instead, which we could attach POST data and/or parameters to on the front end?

Either way, I realized (I think?) that neither approach is suitable for what I’m trying to do.

I’m trying to push(/poll) fully rendered frames for complex UI components to the frontend at framerate and I think it’s not possible with either solution due to the constraints of http calls (please correct my dangerous half-knowledge if I’m wrong).

So now, I’m 90% done implementing a WebSocket with juce::StreamingSocket to see if that works better, which all my research points to that it should…

//Edit: yes, that did it :partying_face:
[video-to-gif output image]

This is a juce::Image rendered on a background thread using juce::Graphics (just counting the frames) at 30fps in JUCE, 800x600 pixels and then transmitted via websocket as raw pixel data to the browser frontend, directly displayed on a canvas in a Vue app. Can’t feel a thing handling buttons/knobs on the same, single-threaded frontend.

//Edit 2: now - transmitting an actually moving image - i can unfortunately see that it’s super janky albeit the transfer IS really fast… I’m not sure yet that this can be done well, I’ll report findings when/if I should get them… don’t follow my lead just yet if you read this and get excited by that gif up there, writing a websocket server suuuuuucks :smiley:

2 Likes