OK A. Just a quickie feed back. (PS hoping that it contributes usefully to the new native PubCoder actions ;-) )
The above code works gr8. I suspect it works as it was designed to. ie in Quick Preview:
- page opens with inactive Read Aloud button and the pulse effect is active. Debugger shows no details.
- on click Read Aloud button, Read Aloud button goes 'active', read aloud narration commences, pulse switches to non active. Debugger shows Read Aloud Started event.
- on read aloud narration completion, Read Aloud button remains 'active', pulse remains non active. Debugger shows no change.
- on second click of Read Aloud, Read Aloud button switches to inactive, pulse switches to active. Debugger shows Read Aloud Started event and Read Aloud Stopped event.
So all is good :-)
In my further thinking about this functionality, I imagine guiding the reader through the page .....
so stepping through narration with text highlighting, then being drawn to tap on a pulsing word / object which opens a pop-up that exposes another learning moment (eg word pronunciation audio / graphic etc).
So. Looking to have the pulse 'off' on page opening, then automatically triggered to 'on' when the narration completes plus...
... should the reader click on the text / object that is (or isn't) pulsing before the narration completes, the page narration should stop to prevent pop-up audio playing over page audio at the same time.
I hope I've described that well enough such that it provokes further cogitation at your end. With thanks. Regards and best.