Evergreen Self Check: Audio Alerts Don't Sound

Bug #1815968 reported by Jennifer Pringle
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.6
Fix Released
Medium
Unassigned

Bug Description

Evergreen 3.1.7

Audio alerts for the Evergreen self check don't sound when the Self Check library setting "Audio Alert" is set to True.

I've tested this on our live system, the MassLNC 3.1.8 community demo server, and had confirmation that another organization isn't hearing them in 3.0.

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

EG 3.3.4 - In production, our self check stations do play sounds. We are using the OpenKiosk browser distribution.

When I try and test from my workstation though, I don't hear sounds, in either Chrome or Firefox. But I do in OpenKiosk V47 running on my workstation.

So I wonder if there was some recent audio api change by modern browsers that may be causing this?

Hmm, I found references to the fact that Google stopped allowing autoplay audio.
https://stackoverflow.com/questions/50490304/how-to-make-audio-autoplay-on-chrome

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/

When I add our evergreen site to the firefox autoplay exception list, I still don't hear any audio though. So I don't know if what evergreen is doing to play audio is what is being blocked.

Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello, I was looking into this some more today, and noticed something.

If I set a breakpoint in firefox for the line
document.body.appendChild(audio);

Then the audio file plays. I wonder if that is because it delays the next line, which is removing the audio element?

document.body.removeChild(audio);

Maybe there was a behavior change, at one time it worked to append and then immediately remove the audio element... but now the element isn't around long enough to actually play the audio?

Any javascript guru's know of a way to delay the removeChild until after the audio has a chance to fully play.

https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/web/js/dojo/openils/Util.js;h=e3588ae61f006ead72029a357112a77eeda6b3d2;hb=686ccf782a2dba2bb6ba1abf82edcee4590b1153#l362

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Removing the
document.body.removeChild(audio);

Allows the audio to play on Firefox 88.0.1 (64-bit).

But each time an alert gets played, a new <audio> element gets added to the DOM.

Instead of adding an autoplay audio element to the DOM, it also seems to work to just create an audio element and then play() it.

I'll try that out in production and make sure it works with older versions of Openkiosk.
Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Working branch at
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1815968_selfcheck_audio_alerts

user/stompro/lp1815968_selfcheck_audio_alerts

I put this in production this morning and it didn't break the audio of our current self checks that are using an older version of Firefox (Openkiosk). And it now works with newer versions of OpenKiosk, and I tried it out in Chrome 90 also.

Josh

tags: added: pullrequest
Revision history for this message
Erica Rohlfs (erohlfs) wrote :

I didn't test using Openkiosk, but I did test using Chrome and Firefox. I have tested this code and consent to signing off on it with my name, Erica Rohlfs and my email address, <email address hidden>.

Changed in evergreen:
assignee: nobody → Erica Rohlfs (erohlfs)
assignee: Erica Rohlfs (erohlfs) → nobody
tags: added: signedoff
Galen Charlton (gmc)
Changed in evergreen:
importance: Wishlist → Medium
milestone: none → 3.7.2
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_7, and rel_3_6. Thanks, Josh and Erica!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.