Controlling Background Audio in seamless play

maich4316 Community Member Posts: 13
I am using a background audio that runs across multiple pages. I also want to control it from the pages. I am using the Sound in Background properties in a Chapter that has four pages. This is the new feature in Lectora 17. I have used a global button (Chapter level) to control the BG Audio. However showing errors while publishing (seamless play). If I use the button in the pages then also it does not have any effect on the audio. And also the audio is looping. I am unable to view the audio in explorer and so unable to control the properties of the background audio, neither I can use action on it (like OnDonePlaying). Can anyone please help me if I am missing any settings?



  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    Please post a sample.
  • maich4316
    maich4316 Community Member Posts: 13
    Thanks for the reply.

    I have attached a LI 17 sample.

    The audio is playing seamlessly across multiple pages (seamless play publish), however I am unable to control it and it plays in loop.

    --- Mihir
  • klaatu
    klaatu Community Member Posts: 988
    Change the action on the play/pause button and replace with this runJS script:

    if (getDisplayWindow().a001_occasions_for_tea_occasions_for_tea_BkAudioMedia.paused == true) {
    } else {

    Of course this is just ugly, it can be made more elegant. Let me know if this works for you.

  • klaatu
    klaatu Community Member Posts: 988
    Whoops, just noticed that it doesn't stay working across all pages. Hmmm, gonna go shovel some of this Nor'Easter snow out of my driveway then I'll take another look see.
  • maich4316
    maich4316 Community Member Posts: 13
    Thanks for your effort Darrel. I'am still unable to solve this.
  • timk
    timk Community Member Posts: 1,214 ♦ Idol ♦
    Isn't Background sound meant for music to be playing all the time and to be looping? I mean, wouldn't it be easier for voiceover to use a separate normal audio object for each page so you can use all the usual features?

    It seems to be a bug that it's possible to target the background audio in actions. This is also new in Lectora 17. Although of course it would be nice to make the background audio controllable with the normal actions.

    Here's your sample using Darrels code to play / pause. It also prevents the audio from looping. The background audio gets a different id on each page that contains the page name. It would be easier to control if it always had the same id.

  • maich4316
    maich4316 Community Member Posts: 13
    Thanks a lot. However, it is still not running properly, throwing JavaScript errors. I tried to suppress the errors, however after a few clicks again the error pops up.
  • klaatu
    klaatu Community Member Posts: 988
    It plays fine. the problem comes in when you try to hit the pause/play button before the page loads (transition completes). You might want to disable the play/pause button until after the page loads.
  • klaatu
    klaatu Community Member Posts: 988
    Thanks, Tim. ;-)
  • nmaharaj8389
    nmaharaj8389 Community Member Posts: 13 ☆ Roadie ☆
    Hello All,

    Customer requested something like this, so I whipped something up,  if it helps..... you can view/play here: