Jump to content

play mp3 mobile application


leandroavila74

Recommended Posts

how do I play mp3 audio in a mobile app?

 

I tried using html5, put in a unimHtmlFrame1 content:

 

<audio id = "player3" src = "files / music.mp3"> </ audio>

 

and I called to play using the code:

 

UniSession.SendResponse ('var ael = document.getElementById ("player3"); ael.load (); ael.play ()');

 

It works perfectly on the desktop, but not on mobile!

 

also I tried using:

 

unimUrlFrame1.URL: = 'http: //192.168.25.198: 8077 / m / files / music.mp3';

 

again it works perfectly on the desktop but not on mobile,

but if I put in the android browser manually, it works!

 

please help me if you can

 

 

Leandro Ávila

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...

If you want to play the sound file pragmatically then this will not help you, because browser by default block playing sound using js, the solution is to use an atomic var and associate it to the first 'click' or 'tap' when  and do:

myPlay.play();
myPlay.pause();

And then whenever you need to play it use just:

myPlay.play(); 
Link to comment
Share on other sites

  • 5 months later...

 

If you want to play the sound file pragmatically then this will not help you, because browser by default block playing sound using js, the solution is to use an atomic var and associate it to the first 'click' or 'tap' when  and do:

myPlay.play();
myPlay.pause();

And then whenever you need to play it use just:

myPlay.play(); 

 

Hi,

could you please provide an example of how to play a sound on the mobile through this technique, using a unimtimer for example

Link to comment
Share on other sites

  • 4 years later...
  On 4/18/2017 at 10:39 AM, mohammad said:

 

If you want to play the sound file pragmatically then this will not help you, because browser by default block playing sound using js, the solution is to use an atomic var and associate it to the first 'click' or 'tap' when  and do:

myPlay.play();
myPlay.pause();

And then whenever you need to play it use just:

myPlay.play(); 

 

Hi,

could you please provide an example of how to play a sound on the mobile through this technique, using a unimtimer for example

Link to comment
Share on other sites

×
×
  • Create New...