¿How to activate a continuous alarm by pressing a button?

Hello, does anyone know if we have any way to achieve this:
WHEN THE DELIVERY MAN STARTS! MUST
SOUND AN ALERT/ALARM, EVERY 3 SECONDS
UNTIL THE EMPLOYEE CLICKS ON “ACCEPT
SERVICE” ONCE YOU HAVE SELECTED THAT, THE
ALARM STOPS SOUNDING.

This can’t be done natively in Glide. There might be some workarounds, @Darren_Murphy, @ThinhDinh, @Jeff_Hager, @Robert_Petitto?

@DillanMartinez Can you share with us the use case?

One easy solution would be to use a rich text component with an audio html tag set up to autoplay and loop an audio file. Then use visibility to hide or show the rich text component. But, the problem is that some browsers, such as chrome, do not allow audio to auto play without some sort of user interaction. So, this method may not work reliability.

The only other solution I can think of, would be to create an external website somewhere, that will play the audio. It may require some sort of javascript to play or start playing of the audio. Then you could maybe embed that external website into your app with the web embed component and control the visibility of that web embed component. I’m not sure how well something like that would work, or how to set it up, but it could be something to try.

hehe, I looked at this earlier, and the same thing occurred to me.
In my mind though, this would be an incredibly annoying thing - I hate phones that make (unsolicited) noises - so I instinctively started searching Google for “annoying sound on repeat”. This is what I found :rofl:

2 Likes

Hahaha god @Darren_Murphy this is really annoying haha ​​I’ll try option 1 since it’s for internal company use so I can say use another browser. If I succeed I will tell you. Thank you.

1 Like

by any chance can you give me the html code to do this, I can’t get it to work.
I thought one way to do this is to have a button trigger the audio component’s audio, but I haven’t found an action that does this.
imagen audio

This is the closest I could get. Put this is a rich text component.

<audio controls autoplay loop
source src="https://www.soundjay.com/misc/censor-beep-01.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

Removing ‘controls’ would make the audio component invisible, provided it works. ‘Autoplay’ is obviously meant to make the audio play automatically, but in my case, chrome prevents that from happening, so I still have to click on the play button. ‘Loop’ causes the audio to continuously loop.

1 Like

I think most modern browsers would block the autoplay ability if the user has not interacted with the site. For this use case, clicking a button kills the original use case.

Generally, I don’t like audio being autoplay without my consent, anyway :sweat_smile:

2 Likes

But Android & Chrome rocks eh @Jeff_Hager ?

2 Likes

Nice! I didn’t know that about the installed PWA.

I have to admit, Android is pretty amazing. :wink:

1 Like