Audio Events Not Always Firing - Maybe JavaScript Solution?
June 25, 2017 12:00 AM
This is Lectora 16. I am trying to disable all buttons, while the audio plays, audio is played from the button press, which disables all buttons using an actionGroup. When Audio is complete, an audio event is triggered that enables all buttons. I built a sample, attached, and limited it to two buttons/audio. In the real project I have nine in total. Sometimes it will work, other times the Run action group enablepops will not fire from the audio events.
Run the sample and click on the buttons a number of times, until it no longer enables the buttons.
1./ Why are audio events not always firing?
2./ Is there a better way of enabling the buttons after the audio has played?
3./ Is there a JavaScript way to do this? If So, help, not that familiar with JS.
Thank You
Ian Ross
Discussion (6)
Hi Tim K.
Thanks for your response.
This is just a short sample, I have many more events, and they do not always fire.
I have moved the event closer to the middle to no effect, still the same problem.
In testing enough I have identified that this code DOES work in IE 11, however in FireFox and Chrome it DOES NOT work.
I was hoping that there was some JavaScript experts that had a better way to launch events from different points in a audio playing. (I am not taht familiar with JavaScript, I have looked at Howler, https://howlerjs.com/, however I am having trouble implementing it in Lectora. (Just me, not that familiar with how to implement JS in Lectora.)
Thank You!
I've had the impression before that events are sometimes skipped if they are very close to the end of a file. Can't you use a normal "On: Done playing" action to run the group instead of an event?
I'm sure it can be done with javascript. But what I meant was using no events at all. Check the sample.
I do think Lectora events are based on Windows events ( codewise ), thus they do work perfectly in IE11 and have trouble in Firefox and Chrome. So either use Tim's advice to avoid events and do it in another way, or find a workaround for the browsers that fail.
Hi Ian Ross,
I went ahead and took a look at this issue. I have noticed we do have a bug regarding media events when the event is towards the end of the media. This seems to be a timing issue on our end. It most likely works in IE11 because it is a slower browser than Chrome, therefore giving the event more time to fire. Unfortunately there is no way for custom javascript to fix this issue.
You also mentioned that you adjusted the time of the event to be in the middle of the media and it still had problems. Just wanted to verify, after you changed the timing of the event did you reopen the sync events dialog for that media before publishing? In order for the time to apply correctly, that dialog should be reopened.
undefined
Discussions have been disabled for this post