[Gambas-user] Supped up the WebAudio.class

Bruce Steers bsteers4 at gmail.com
Sat Jul 30 14:46:20 CEST 2022


On Fri, 29 Jul 2022 at 11:13, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:

> Le 29/07/2022 à 10:53, Bruce Steers a écrit :
> >
> >
> > On Thu, 28 Jul 2022 at 16:20, Benoit Minisini
> > <benoit.minisini at gambas-basic.org
> > <mailto:benoit.minisini at gambas-basic.org>> wrote:
> >
> >     Le 28/07/2022 à 15:41, Bruce Steers a écrit :
> >      >
> >      > I leave it in your oh so very capable hands :)
> >      >
> >      > Respects
> >      > BruceS
> >      >
> >
> >     I have fixed a lot of problems in the last commit. Please look at it
> >     carefully, and ask me if you don't understand why what you wrote was
> >     wrong.
> >
> >
> > Seems I didn't use the correct naming convention for $sSources but
> > didn't see many actual "bug" fixes.
>
> 1) The way you handled the 'Source' property was incorrect. You must not
> store the reference of the array sent by the user, you had to make a
> copy so that the object owns the array. And you have to deal with NULL
> values.
>
> 2) You generated HTML without using the Html() conversion function,
> leading to possible incorrect HTML generation or worse (script
> injection...).
>
> 3) Your automatic detection of mimetypes didn't work.
>
> 4) The javascript emitted when setting the Position property was
> incorrect, because of a bad use of Str() instead of CStr(). Or use JS()
> like I did, if you want to be sure to emit syntactically correct
> javascript.
>
> Try at least to never do bug #2 and bug #4 (confusion between Str and
> CStr) again in any of your projects. The other are less critical! :-)
>
> Regards,
>

I got more cool ideas that will probably be coded terribly if I do it ;) lol

1. Make WebEvent.class for use in the WebForm_Event() event.  this would
open up many avenues for coding tricks with non-handled events. I figured
it out by reading the WebControl.class but i think an Event.class and a
wiki page to describe the class/WebForm_Event() event is needed.

2. Slider needs mouse-up, mouse-down events so you can disable it if it's
currently being slid.  (or handle internally in the WebSlider.class to not
update if being slid) for purpose of something like an audio position
slider that will update itself regularly.  It's currently kinda unusable
for that (i fixed by make my own version with mouseup/mousedown events)

3. I'm sure i'll think of more upgrades as I use it.

On a more awesome note I should say I'm really liking gb.web.gui. 😎👍
I've knocked up a webpage for my music as i've mentioned before
http://bws.org.uk/music  it's looking good (even on my phone)
Got an audio player with custom controls thanks to my terrible coding
abilities and Benoits awesome coding abilities :)
I've made an alternative WebButton.class that supports a Hover image. (the
play button)  trouble is the image flicks to normal and back as it crosses
into the image inside the button.
Been able to make functions to pause video when audio is played and
vice-versa
Volume controls of the video/audio all link with a volume slider.
Page hit counter/ song play counter

Wrapping my head around the principles of the web interface is taking a
while but i'm getting there :)

All thanks to Gambas :)
Cheers Ben
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220730/cab47743/attachment.htm>


More information about the User mailing list