3

This question has been asked before, but all of the threads I have found have been regarding Android 2.2 and earlier.

I am working on a mobile site that needs to embed a live mpeg-type stream. I would prefer that the stream continue playing even after the browser is closed.

If you navigate your Android phone to Grooveshark's Experimental Mobile Site, you can see that it is definitely possible to do this, provided your OS is greater than 2.2. Any idea how they were able to do this?

  • when you say "close" the browser, do you mean switch to a different app or the home screen? – Lloyd Mar 01 '12 at 18:42
  • 1
    Either one. I want to be able to play background audio when you are either on the home screen or in another app that isn't playing audio itself. As I said, Grooveshark can do it, so there must be some way. – Synesthetic Symphony Mar 02 '12 at 04:41

1 Answers1

1

This just worked for me on my Android phone

<audio id="audio1" controls="controls" loop="loop" autoplay="autoplay" >
   <source src="scene1.mp3" type="audio/mpeg" />
   <source src="scene1.ogg" type="audio/ogg" />
</audio>

I put the .mp3 line above the .ogg (before it was not working with .ogg above .mp3)

stevebull
  • 11
  • 1