Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Playing custom sound on page load does not work

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Playing custom sound on page load does not work

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.

Ser Bronn
Posts: 0
Joined: Thu Jan 14, 2016 7:38 am

Playing custom sound on page load does not work

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Playing custom sound on page load does not work

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

Please specify the name of your app.

Ser Bronn
Posts: 0
Joined: Thu Jan 14, 2016 7:38 am

Playing custom sound on page load does not work

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Playing custom sound on page load does not work

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.

Return to “Issues”