facebook

Background Music

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #332430 Reply

    adikate
    Member

    I 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.

    #332433 Reply

    Hi 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.

    #332453 Reply

    adikate
    Member

    i 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

    #332465 Reply

    @adikate,

    Step #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

    #332493 Reply

    adikate
    Member

    Octavio is it possible to use mp3 files which are in my computer or this example is only limited to url.

    #332497 Reply

    @adikate,

    Yes, 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.

    #332498 Reply

    adikate
    Member

    Octavio 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…

    #332502 Reply

    @adikate,

    I 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.

    #332625 Reply

    adikate
    Member

    hey 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.
    #332644 Reply

    support-michael
    Keymaster

    @adikate

    See Octavio’s previous response in this thread where he states that <audio> tag is not implemented in the Test Center emulator.

    #332654 Reply

    adikate
    Member

    i 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….

    #332699 Reply

    @adikate,

    You 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;

    #332943 Reply

    adikate
    Member

    hello 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

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: Background Music

You must be logged in to post in the forum log in