Page 1 of 1

Playing custom sound on page load does not work

Posted: Fri Dec 18, 2015 2:32 pm
by Hawk

I trying to follow this article (https://blog.appery.io/2015/10/how-to...).

The custom sound can be played on events such as button click, scroll ... etc. But it fails to play on page load or page show. I tried for both the sound on the server or in the App (uploaded to the App). In both cases, the result was the same, it plays on button click, but not on page show or page load.

I also tried it in the browser and in the device.

Please advise.


Playing custom sound on page load does not work

Posted: Sat Dec 19, 2015 4:11 am
by Illya Stepanov

Hi -

In this article the dynamic JavaScript approach is used to append HTML5 Audio component into the app screen and invoke function with dynamic parameters, thus Load and Show events won't work. You will need to use pre-defined and existing component (https://devcenter.appery.io/documenta...) on the page for such events.


Playing custom sound on page load does not work

Posted: Tue Jan 19, 2016 9:41 pm
by Ser Bronn

I followed this code(PlayTrack("files/resources/Beep_once.mp3"); to embed an offline sound into my app once a button is clicked. I used this posting below but it's not playing.
https://blog.appery.io/2015/10/how-to...

Any suggestions? The app is shared with support using a href="mailto:macoy99@me.com" rel="nofollow"macoy99@me.com/a login


Playing custom sound on page load does not work

Posted: Tue Jan 19, 2016 10:25 pm
by Illya Stepanov

Hi - this is not a correct code: precode(PlayTrack("files/resources/Beep_once.mp3");/pre

Please specify the name of your app.


Playing custom sound on page load does not work

Posted: Tue Jan 19, 2016 11:59 pm
by Ser Bronn

Starts Module
(PlayTrack("files/resources/Beep_once.ogg");


Playing custom sound on page load does not work

Posted: Sun Jan 24, 2016 9:29 pm
by Illya Stepanov

Hi Ser -

Thank you for notice this, since your app uses Libraries version 3.0 the structure of project folders has been changed in it.

You will need to move all your sound files to the /app folder and invoke PlayTrack function with your file this way:
http://prntscr.com/9ud2pg
pre
PlayTrack("Beep_once.ogg");
/pre

I will update the blog post with this information.