- This topic has 12 replies, 3 voices, and was last updated 12 years, 2 months ago by
adikate.
-
AuthorPosts
-
adikateMemberI want to design an app with background music running on all the screens i had. In mobione design centre there is audio icon when i drag that to design an app its showing the play button but i need it be hidden so that the music play when app is started.
support-octavioMemberHi adikate,
This example should be helpful for you: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=2123
Let us know if you have problem to implement it in your app.
adikateMemberi downloaded the file that u gave in reply but of no use. when i click on play no music is heard…can u please give me more detailed information on adding background music
support-octavioMemberStep #3 states that you need to change the URL of your mp3 to get it working. Also if you rename the project you should change the buttonId variable
adikateMemberOctavio is it possible to use mp3 files which are in my computer or this example is only limited to url.
support-octavioMemberYes, you can use other mp3 file. Just add it as Additional Project File and use a relative url to change the src in the javascript code. i.e. if your mp3 name is mymusic.mp3, after you add it as Additional Project File set the src of mp3 file: “mymusic.mp3”. Let me know how it goes for you.
adikateMemberOctavio if the file is in G folder and mymusic files(i.e., G:\mymusic) how can i do it as a relative url. i added a file like what u said in reply but i cant do nothing. plz help me with this…
support-octavioMemberI suspect that it’s not working because you’re testing on Test Center, note that it doesn’t support audio/video playback, you should test the generated files on desktop browser.
adikateMemberhey Octavio everything is working fine but there is an error in dom inspector and debugger. can i know what might be the cause for the error…
Attachments:
You must be logged in to view attached files.
support-michaelKeymasterSee Octavio’s previous response in this thread where he states that <audio> tag is not implemented in the Test Center emulator.
adikateMemberi thank the support team for all their support. i got a 10 second mp3 file which i named as mymusic.mp3 and in the code i updated the audio.src = mymusic.mp3 and also added as additional project file. now my doubt is how to play this 10 second mp3 file continuously(repeated) as long as user is playing the game. i tested with 10 second and 5 minute mp3 files but all are playing only once and button is still showing STOP even though the mp3 file is finished, can u please help me with this….
support-octavioMemberYou can add the loop attr with next snippet:
audio.loop = "loop";
Add it after set the src attr:
audio = new Audio();
audio.src = ‘myaudio-file.mp3’;
audio.loop = “loop”;
isPlaying = false;
adikateMemberhello Octavio, i tested on my iphone every thing is working fine but when i press the home button the app closes and the background music also stopped. when i press again my app icon the music is not playing and also the play/stop button is not updated i.e., its still in stop as it needs to be in play….please help me with this
-
AuthorPosts