AliSherKashif / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Streaming MP3 not working in ios #755

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On iOS there is no sound when streaming a mp3 from the web. On Android and 
simulator the same code works.

What steps will reproduce the problem?
Add this code to an app:
currentMedia = 
Display.getInstance().createMedia("http://media.spaic.nl/callme.mp3", false, 
new Runnable() {
                    public void run() {

                    }
                });
currentMedia.play();

What is the expected output? What do you see instead?
I expect to hear sound, instead nothing happens.

What version of the product are you using? On what operating system?
I am using the lastest CodenameOne. Tested on:
Working
Windows x64 simulator
Mac 10.8 Simulator
Galaxy Note 2, Android 4.1.2
Galaxy S2, Android 4.0

Not working
iPhone 5, iOS 6.1.1
iPhone 5, iOS 7.0.0
iPhone 3gs, iOS 5.1

Please provide any additional information below.

Original issue reported on code.google.com by mhvd...@gmail.com on 21 Jun 2013 at 8:45

GoogleCodeExporter commented 9 years ago
I did a bit of research on this one. Please look at these topics:
http://stackoverflow.com/questions/13131177/streaming-mp3-audio-with-avplayer

http://stackoverflow.com/questions/6856445/get-an-audio-stream-from-uri-and-play
-it-on-iphone

http://stackoverflow.com/questions/10862596/ios-music-streaming-and-http-live-st
reaming

Original comment by mhvd...@gmail.com on 25 Jun 2013 at 10:32

GoogleCodeExporter commented 9 years ago
Turns out this won't work:
https://developer.apple.com/library/ios/#qa/qa2009/qa1634.html

If you read the responses there (those that are accepted) really just download 
the file locally for playback.   

Original comment by shai.almog on 25 Jun 2013 at 8:08

GoogleCodeExporter commented 9 years ago
Shai, would it work to create a stream and pass it to the player? Or do I have 
to save the file locally (fully downloading) and start to play after it's saved?

Original comment by SimonSimCity@gmail.com on 25 Jun 2013 at 8:09

GoogleCodeExporter commented 9 years ago
Both would be roughly the same thing. If you create a stream we will open and 
download ourselves. 

Original comment by shai.almog on 25 Jun 2013 at 8:12

GoogleCodeExporter commented 9 years ago
Shai, but would that be similar to streaming, or does it first fully download 
the item before it starts playing?

Original comment by SimonSimCity@gmail.com on 25 Jun 2013 at 8:15

GoogleCodeExporter commented 9 years ago
I said its the same thing "we will download the file".

Original comment by shai.almog on 25 Jun 2013 at 8:17

GoogleCodeExporter commented 9 years ago
can't you use AVPlayer instead of AVAudioPlayer? because that one supports 
streaming

Original comment by mhvd...@gmail.com on 25 Jun 2013 at 8:23

GoogleCodeExporter commented 9 years ago
I'll convert the issue to an RFE for adding support for AVPlayer. Unfortunately 
these two aren't very compatible and AVPlayer has its own issues: 
http://stackoverflow.com/questions/3282866/avplayer-vs-avaudioplayer
We normally require the ability to seek properly and ideally individualized 
volume. However, I think we might be able to automatically use AVPlayer if 
running against an http URL which is something we can probably detect 
automatically.

Original comment by shai.almog on 26 Jun 2013 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by shai.almog on 5 Aug 2013 at 8:08

GoogleCodeExporter commented 9 years ago
This is fixed in SVN. On its way to the servers now.

Original comment by shai.almog on 7 Aug 2013 at 9:29

GoogleCodeExporter commented 9 years ago
This issue was fixed on the 7th.

Original comment by shai.almog on 20 Aug 2013 at 3:43