HTML5 improvements

Previous topic - Next topic

Kitty Hello

I copy the icon.png to the distribute folder.
I managed to get ASYNCIFY running. Now infinite loops with SHOWSCREEN will work - which makes DDGui's combo boxes etc. fully working. But also, all code should just run without any modifications. I don't think performance will be an issue anymore. Today's mobile phones are more powerfull than the computers we had when experimenting with emscripten/html5.

Here's what I did - but it does not beep on my Android mobile Firefox :(

https://www.glbasic.com/beep_timer/BeepTimer.html

I pushed my changes to git.

Qedo

I confirm it doesn't play on Firefox mobile and I also add Google Chrome mobile
How can I access git for changes?

Paul Smith

I love it when updates and fixes are being worked on, But I have the same question as Qedo. Does a push to GIT mean it will start to roll out on a STEAM update or do we have to do something manually?
Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD RYZEN 7,RTX 3060TI

Paul Smith

Confirmed your Bleep does not work on Android Firefox.

I noticed firefox can be a little particular with sound as can Chrome, I tried a few settings for a bleep and in the end I used WAV 8/16bit 16/22/41 khz stereo(Mono didn't work) and these works on all platforms so far.

My Key click sound works on Firefox on my android.

https://paulsmith6175gmailcom.itch.io/bc

This is a work in progress and once its sorted I will create a thread with all the little things I discovered on my journey like how to get the full phone resolution not the 360x760ish, Audio formats, reading the screen width and height
Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD RYZEN 7,RTX 3060TI

erico

Nice work guys!
I have to get into hltml5 at some point soon.
Probably not game related but for a few tools.

Qedo

GLOBAL a$  = NETWEBGET$("jsonplaceholder.typicode.com","/users?_limit=3",80,2048, 5000)

any idea because in GLBasic  work and in HTML5 no?  bug?

Paul Smith

Not used that command, but others like NETWEBEND dont work.

I've been short on time this month and was looking into using alternative inline for NETWEBEND. I have two methods that need Ironing out. This code is from a google search. And needs formatting correctly.

    INLINE
    #include <emscripten.h>
    emscripten_run_script("window.open(\"" + url$ + "\", \"_blank\");");
    ENDINLINE

the other is

INLINE
    #include <emscripten.h>

    EM_ASM_({
        window.open(url, '_blank');  // Open the URL in a new tab
    }, url$);
   
    ENDINLINE

Not tried the first one but the second one opens a page, just not the right link.  :D
Hopefully someone smarter than me will fix this is seconds.


Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD RYZEN 7,RTX 3060TI

Kitty Hello

it's url_Str. The $ is replaced by _Str in C++.

Qedo

Paul, but can you compile these 2 examples in html5?
stop compiling because;

"fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated."

Paul Smith

I can't seem to use strings. This won't compile 
}, url$);  or {, url_Str);
The version I was supposed to show was  }); that just opens a new tab. It does compile but just a blank page.

This code does work and will open the correct page, strange thing is the // shows as comments after the https: but compiles fine.

INLINE
        EM_ASM({
       window.open('https://www.glbasic.com', '_blank');
    });
   ENDINLINE

Hope this helps
Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD RYZEN 7,RTX 3060TI

Qedo

for me impassable road nothing works.  Thanks anyway

Qedo

#11
for my app (server-client) I will change (sigh) to Js and node.js

I have a hope, I will try the latest updates  of html5 from git