WebView in a VST plugin


#1

Hi,

I’d like to build a VST plugin to run on OSX and Windows only - I’m mainly a Javascript developer.

My very first idea is simple; I’d like to be able to allow a user to open the VST, login using username/password, upload a audio file or download an audio file. The VST host would then read the downloaded audio sample file.

Is this complex to do? Any tips and advice to start doing this?

Thanks!


#2

It’s possible but not straightforward. Things you need to consider are:

  • The JUCE WebBrowserComponent has quite a simple interface and doesn’t expose much of the underlying functionality in WebKit or IWebBrowser2 that would allow for things like callbacks between your C++ and JavaScript code
  • If you just use a standard HTML link to your audio file, the WebBrowserComponent will try to open the file in the browser. You need to intercept this in WebBrowserComponent::pageAboutToLoad() and download your audio to memory in a background thread (otherwise the download will block your UI)
  • You need to think carefully about your threading model in the plugin, e.g. what happens if concurrent downloads are requested, passing information about the download between threads, synchronising access to resources etc.

Jamie


#3

The OP title + description are a bit confusing… Do you mean a web-view in a plugin, or plugin in a web-view?


#4

You’re right, Webview in a plugin :slight_smile:

Thanks Jamie, I found a few talks that I’ll watch later about GUI development and one about modern UI. I had a quick look and it’s amazing so probably I won’t need the webView - was planning that to be able to reuse web code.


#5

been there, done that, we feature on our flagship product Nyrv AGENT a full WebBrowserComponent based Marketplace where you can download stuff and it works. great.

we achieved it by detecting a custom URL protocol and doing stuff accordingly (download, place on appropiate location, etc), packages are zip files and feature a json manifest for install setup

so it is quite straightforward… create an html window, do stuff on it, and when done, close it or something similar and do your c++ processing…


#6

That’s nice to hear you built something like that already.

My idea is similar but I won’t charge to use it. Shouldn’t have that many users. I hope to work on it any time soon.


#7

I’d be interested in that. Can you elaborate further?
Does this require user interaction to allow the custom protocol to be registered?


#8

Just make your website create a link like:

MyAPP::somewhere.com/SomePackage.zip

then in WebBrowserComponent: pageAboutToLoad (inherit from WBC and override the method)

then do your thing… fetch that file and download it or something…