Javascript sound media not working?
  • bernadet
    Posts: 4
    Joined: Thu Jul 20, 2017 1:52 pm

    Javascript sound media not working?

    by bernadet » Sun Mar 31, 2019 9:14 pm

    Hi there,

    I know the version history on the app store says the latest version is Aug 2018- but has anything been changed with the code for ARIS since last fall (November or later)? I’ve encountered a really bizarre bug/hiccup.

    In the latest version of my French game Explorez I’ve made a lot of game elements that are either hidden on the map or are triggered by timers to fill the gaps while students are walking between locations. I also put javascript in these to both make a sound and vibrate so that students would be aware they had encountered a game element.

    This worked fine last term & on the devices that downloaded ARIS last term for testing the javascript inserted sound is still working in Explorez. On the 7 devices that we’ve downloaded the app onto just this term (Feb/March) the sound doesn’t work. The javascript is partially being “read” because the devices vibrate, but there’s no sound…

    Before sending I figured I better also try uploading new sounds to see if this fixed the issue. Now any new audio files I upload aren’t playing. The weirdest thing is that ONLY my old audio files are working with the original media ID. I made a testing sound game and uploaded audio files. When I insert the media ID (new media) from this game, I get nothing. But if I put in the media ID (old media) from the other game Explorez, even though this doesn’t match the ID in the Testing Sound game, it plays the sound in this test game…

    Any help appreciated.

    thanks,
    Bernadette
  • User avatar
    djgagnon
    Site Admin
    Posts: 138
    Joined: Tue Sep 20, 2016 10:52 pm
    Location: Madison, WI
    Contact:

    Re: Javascript sound media not working?

    by djgagnon » Wed Apr 03, 2019 11:40 am

    We are checking into it. Look for an update shortly.
  • bernadet
    Posts: 4
    Joined: Thu Jul 20, 2017 1:52 pm

    Re: Javascript sound media not working?

    by bernadet » Mon Apr 08, 2019 9:47 am

    Great to hear! Thanks David :)
  • mtolly
    Posts: 5
    Joined: Mon Oct 31, 2016 2:10 pm

    Re: Javascript sound media not working?

    by mtolly » Thu Apr 11, 2019 11:53 am

    We've researched this, and it seems that playing a sound via JS will only work if the sound file has already been downloaded onto the device. This explains why it’s working on your older installations, and with existing sound files but not new ones. We will plan on fixing this in the app so calling “prepareAudio” and/or “playAudio” downloads the file if needed, but as a short-term fix you can turn on the “Preload Media” checkbox in the ARIS Editor game settings. This should ensure that all files are downloaded to the device on game load.