Stumped by displaying webpage in WebView
-
@d-healey Yeah I thought as much when I had to go in and start correcting syntax. I suck at HTML and it made mistakes even I could spot.
I can't see an example that shows a redirecting to a webpage within the UI in HISE, do you know of one? I can see people have it working on the forum but explanations as to how seem thin on the ground.
-
@LozPetts said in Stumped by displaying webpage in WebView:
do you know of one?
The webview doesn't work on Linux so I haven't taken much interest in it. I know some other people are using it successfully though so maybe you'll get some responses.
In the meantime you should go through the scripting basics so you can see how dreadful that GPT output is.
-
@d-healey Yeah it's terrible, I just thought I'd try it, it's helped me with some CSS stuff recently and it did 'okay'
-
@LozPetts It's pretty good with css, javascript, c++, python, etc. All the major languages, because there is loads of data that it's trained on. But that data doesn't exist for HISE and it doesn't understand HISE scripting at all. It will just return some unhinged Javascript.
-
@d-healey Figured as much, just thought I'd give it a go! Hopefully someone with WebView experience chimes in
-
@LozPetts So I started again based on a recent thread from Clevername27 - I'm now here -
Content.makeFrontInterface(1000, 650); const var web_DOCS_CoreHTML_GUI = Content.getComponent("web_DOCS_CoreHTML_GUI"); // WebView // HTML file points redirects to internet var startingPage = FileSystem.getFolder(FileSystem.AudioFiles).getParentDirectory().getChildFile("Images/path-example/index.html"); web_DOCS_CoreHTML_GUI.set("enableCache", true); web_DOCS_CoreHTML_GUI.reset(); web_DOCS_CoreHTML_GUI.setIndexFile(startingPage);
With the suggested HTML test file below located at the path detailed in the code above:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta http-equiv="refresh" content="0; URL=https://www.ferretsfightingllamas.com" /> </head> <body> </body> </html>
I have no idea what Ferretsfightingllamas.com is but I'm excited to find out when this gets working haha.
I currently get a white webview window with my HTML file displayed on a dark background.
-
@LozPetts said in Stumped by displaying webpage in WebView:
var startingPage
This should probably be a const, it definitely shouldn't be a var. That whole file path seems weird, why is the html going in the project's Images folder?
-
@d-healey Because that's where they are in the example projects on GitHub, to do with making sure they get embedded correctly perhaps?
-
@LozPetts said in Stumped by displaying webpage in WebView:
Because that's where they are in the example projects on GitHub
Oh, seems strange but I guess that's where they are meant to be then
-
Bump - anyone with web view experience able to weigh in? I've done some more playing around and can't get any further with it.