1

Either my webserver at codejanitor is not designed for streaming? or maybe I'm doing something wrong?

I've tried the following two approaches:

try {
            mp = MediaPlayer.create(
                    AmazonClipActivity.this, 
                    Uri.parse("http://codejanitor.us/good.mp3"));
            mp.setOnPreparedListener(new OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mp) {
                    mp.start();

                }
            });
        } finally {
            if(mp!=null) {
                mp.release();
                mp =null;
            }
        } 

AND

try {
            mp = MediaPlayer.create(
                    AmazonClipActivity.this, 
                    Uri.parse("http://codejanitor.us/good.mp3"));
            mp.start();
        } finally {
            if(mp!=null) {
                mp.release();
                mp =null;
            }
        } 

AND both produce:

05-19 12:27:48.104: DEBUG/MediaPlayer(1730): Couldn't open file on client side, trying server side
05-19 12:27:48.104: INFO/StagefrightPlayer(68): setDataSource('http://codejanitor.us/good.mp3')
05-19 12:27:48.104: INFO/NuHTTPDataSource(68): connect to codejanitor.us:80/good.mp3 @0
05-19 12:27:53.653: INFO/NuCachedSource2(68): ERROR_END_OF_STREAM
hunterp
  • 15,716
  • 18
  • 63
  • 115

1 Answers1

1

Read this topic. None of the answers are marked, but there are a few solutions to how to get MediaPlayer to stream from a URL.

Community
  • 1
  • 1
codewario
  • 19,553
  • 20
  • 90
  • 159