Closed GoogleCodeExporter closed 8 years ago
I have the similar issue, i confirm this bug on Android 4.4 (kitkat). It's
there any solution on this issue?
Original comment by florin.i...@gmail.com
on 1 Dec 2013 at 11:45
Same here 4.4.+
Original comment by m.mokrzy...@gmail.com
on 11 Dec 2013 at 10:59
Could you please retry using standalone emulator / device ?
I am trying standalone emulator, running 4.4.2 (ARM) and playing this stream
without errors:
http://http.yourmuze.com:8000/play/paradise/l.aac
Original comment by vbarta...@gmail.com
on 29 Dec 2013 at 9:47
Issue 46 has been merged into this issue.
Original comment by vbarta...@gmail.com
on 29 Dec 2013 at 9:48
Original comment by vbarta...@gmail.com
on 29 Dec 2013 at 9:48
vbarta,
The issue it's also on normal device, tested on Nexus 7 (2013), Android 4.4.2,
here you have a stream demo: http://159.253.145.178:8100
Thanks
Original comment by florin.i...@gmail.com
on 30 Dec 2013 at 11:51
with the update of kitkat, android removed something, i modified the lib with
httpclientandroidlib and works but have glitchs streams cuts sometimes
Original comment by alexis...@gmail.com
on 30 Dec 2013 at 2:31
i modified the file aacplayer.java
import ch.boye.httpclientandroidlib.Header;
import ch.boye.httpclientandroidlib.HttpEntity;
import ch.boye.httpclientandroidlib.HttpResponse;
import ch.boye.httpclientandroidlib.client.methods.HttpGet;
import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient;
added this lib and changed:
public void play( String url, int expectedKBitSecRate ) throws Exception {
this method to:
public void play( String url, int expectedKBitSecRate ) throws Exception {
if (url.indexOf( ':' ) > 0) {
/*
URLConnection cn = new URL( url ).openConnection();
prepareConnection( cn );
cn.connect();
processHeaders( cn );
// TODO: try to get the expectedKBitSecRate from headers
play( getInputStream( cn ), expectedKBitSecRate);
*/
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet request = new HttpGet(url);
request.setHeader("Icy-MetaData", "1");
HttpResponse response = httpClient.execute(request);
Header[] headers = response.getAllHeaders();
for (Header header : headers) {
Log.d(LOG, header.getName());
playerCallback.playerMetadata(header.getName(), header.getValue());
}
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
play( inputStream, expectedKBitSecRate);
}
else play( new FileInputStream( url ), expectedKBitSecRate );
}
stream will work then but have some cuts, dont know why if someone can help
with this will be awesome.
Original comment by alexis...@gmail.com
on 30 Dec 2013 at 2:36
i attached the modified aacplayer and httpclientandroidlib
Original comment by alexis...@gmail.com
on 30 Dec 2013 at 2:38
Attachments:
Alexis can you attach the compiled lib????
Original comment by dang...@danguru.com
on 7 Jan 2014 at 11:11
[deleted comment]
I have problem with android 4.4.+ (as I said before) nexus 4
If it helps my rom is: cyanogenmod 11-201407-NIGHTLY-mako
Original comment by m.mokrzy...@gmail.com
on 8 Jan 2014 at 11:44
It is related to this:
http://stackoverflow.com/questions/19738798/android-4-4-http-api-bugs
Original comment by vbarta...@gmail.com
on 8 Jan 2014 at 1:25
I've created own solution for this issue:
$ svn ci
Sending decoder/src/com/spoledge/aacdecoder/AACPlayer.java
Adding decoder/src/com/spoledge/aacdecoder/IcyURLConnection.java
Adding decoder/src/com/spoledge/aacdecoder/IcyURLStreamHandler.java
Sending player/src/com/spoledge/aacplay/AACPlayerActivity.java
Transmitting file data ....
Committed revision 37.
I've added a simple implementation of the HTTP/SHOUTCAST URLConnection called
IcyURLConnection and IcyURLStreamHandler which is a java.net.URLStreamHandler.
The library then detects whether the response is the standard HTTP or SHOUTCAST
(or better "non-HTTP" - because the class is working for all responses like
"xxx 200 OK"). If the response is standard, then continuing without any change.
For non-HTTP responses, the old connection is closed and new one created - but
for a differrent URL - starting with "icy" protocol.
To allow this solution working you need to register the IcyURLStreamHandler
once in the JVM (I am doing this in the demo player - AACPlayerActiviy:)
----
try {
java.net.URL.setURLStreamHandlerFactory( new java.net.URLStreamHandlerFactory(){
public java.net.URLStreamHandler createURLStreamHandler( String protocol ) {
Log.d( LOG, "Asking for stream handler for protocol: '" + protocol + "'" );
if ("icy".equals( protocol )) return new com.spoledge.aacdecoder.IcyURLStreamHandler();
return null;
}
});
}
catch (Throwable t) {
Log.w( LOG, "Cannot set the ICY URLStreamHandler - maybe already set ? - " + t );
}
----
For pre-Kitkat version this works like before - the old HttpURLConnection is
used, because it is able to parse the response.
For Kitkat version you can speedup the process by supplying the "icy" protocol
directly in the URL like: icy://159.253.145.178:8100
Attaching the library Jar file (the native *.so libraries are not affected).
Original comment by vbarta...@gmail.com
on 8 Jan 2014 at 11:26
Attachments:
Tnk you , is working well
Original comment by dang...@danguru.com
on 10 Jan 2014 at 2:51
revision 38 and revision 39
- IcyURLConnection can be used in plain Java (removed Android logging)
- unified the way how shoutcast connections are handled on pre-Kitkat and Kitkat
--> since now always reconnecting shoutcast streams using IcyURLConnection (due to the check of the response code - without reconnection the check is not possible)
--> for backward compatibility use AACPlayer.setResponseCodeCheckEnabled( false )
Original comment by vbarta...@gmail.com
on 10 Jan 2014 at 7:35
included in version 0.8
Original comment by vbarta...@gmail.com
on 12 Jan 2014 at 8:16
Original issue reported on code.google.com by
alexis...@gmail.com
on 26 Nov 2013 at 6:23