Audio Function - Play-From-To
April 16, 2020 12:00 AM
Howdy all! Long time no post!
Quite some time ago, several folks helped put together a Play-From-To function for the audio player. To summarize, the goal was to have an audio file that played from one specific time stamp and pause at another and/or jump between start points based on button clicks.
It worked GREAT in Lectora 16, but as was the case in my custom skin, I'm finding that something with Lectora 18 has broken part of the function. Originally, if you started the audio at 0:00, it was set up to automatically stop at a specific time stamp. Then, if the user clicked on a button, the audio would jump to a new starting time stamp and pause at the end of that segment.
However, with the upgrade to v18, the audio is no longer pausing at the appropriate times - the jump to and play works, but the pause is failing. I just can't figure out where the issue is, given the changes to the media player. I did notice that there's a new JS file in the root folder of the HTML published version called "mediaelement-and-player.js". I'm wondering if that has an impact on one section of the JavaScript attached to the player:
player = new MediaElement(pageaudio);
I have no idea where to go and it's been long enough that I'm rusty on recalling, even with Tim's earlier fantastic explanation, where I might look for the fix.
Discussion (3)
Hi Jason,
I'm working on an update.
What's the "Play full audio" button supposed to do? It's currently playing an interval but not the full audio.
You can make the event run action group and give the actions in the group a condition.
Here's my new version. With the new "Set time" action, there's hardly any external javascript left...
Hi Tim! Thanks for picking up and taking a look at that again. I just remembered that there is a now a "Set time" action that can be applied to buttons that control the audio in version 18, so I'm going to see how that starts working.
For this page, that play full audio is set, for some reason, to only play the audio for the first button, which is a goof on my part. It's supposed to play the full audio file starting at the audio for the first button. I and my QA team must have missed it in during testing prior to originally publishing the course.
*Edit - I just realized that the "play full audio" is going to take a little more work, since the pause has to be an event on the audio file, and you can't set conditions on events :(
Discussions have been disabled for this post