Explore the community Forums Lectora Lectora Questions & Answers Audio Function – Play-From-To

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #442559 Score: 0
    Profile photo of Jason Dalrymple
    Jason Dalrymple
    Member
    beginner
    intermediate
    profile
    wise owl
    curious george
    contributor
    friend finder
    advanced
    picture perfect
    54 pts
    @JasonADal

    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.

    Attachments:
    1. PlayFromTo_v18.zip
    #442694 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    346 pts
    @timk

    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.

    #442702 Score: 0
    Profile photo of Jason Dalrymple
    Jason Dalrymple
    Member
    beginner
    intermediate
    profile
    wise owl
    curious george
    contributor
    friend finder
    advanced
    picture perfect
    54 pts
    @JasonADal

    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 🙁

    #442745 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    346 pts
    @timk

    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…

    This post has received 1 vote up.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.