Audio stops working after visiting external site


#1

Hi,

I have an issue with Zappar audio. When I trigger an audio effect from a timeline, everything is OK. But when I visit (via launchUrl()) an external site I have developed which uses audio and then I return to Zappar app, sounds do not work any more. All the Zappar app audio functionality is compromised: it does not beep any more when it scans a new zapcode, for example. I have to kill and restart the app to restore sound functionality.

I am developing on macOS 10.13, latest ZapStudio, and using the latest Zappar app on iOS 13.1.3 on an iPhone XS.

This is the JS code I use to programmatically load sounds in the external site (which works like a charm) :

function sound(src) {
  this.sound = document.createElement("audio");
  this.sound.src = src;
  this.sound.setAttribute("preload", "auto");
  this.sound.setAttribute("controls", "none");
  this.sound.style.display = "none";
  document.body.appendChild(this.sound);
  this.play = function(){
    this.sound.play();
  }
  this.stop = function(){
    this.sound.pause();
  }
}
...
taDaa = new sound("sounds/tadaa.mp3");
....
taDaa.play()

Any clue? Is this a known bug? Is there anything in the site loaded with launchUrl() which captures the sound engine in some exclusive way and has to be explicitly released when leaving?

Thank you in advance,

Aaron
Fishbone Creek Italy


#2

Just a guessing here but when you leave zappar to go to the website and then come back is the zappar app still running from the first time?

Do you have to leave the zappar app for your website? Could you open it inside zappar?

Steve


#3

I open the website via Z.device.launchUrl(), so it is opened into an in-app browser, with a “done” button which returns to the zappar app. It is THE SAME app, not an independent browser (i.e, if I open the apps switcher I do not see a separate Zappar browser, it is the same process).

Obviously I can open the website with a standard browser by navigating directly to the URL I pass to Z.device.launchUrl() and everything works…


#4

Sorry I was just guessing. Haven’t worked much with outside sites and zappar. Seeing you are a business I would send an email to the guys at support@zappar.com. That should get back to you sometime Monday.

Steve


#5

Yes, I wrote here because I believe this is a question of general interest, so I was waiting for an answer from @james.wright or @simon or somebody else from the Zappar team… :slight_smile: