Android Play .asx file with MediaPlayer?

5.7k views Asked by At

I want to make an app with which you can play radio audio streams.

So far i have this:

@Override
    public void onClick(View v)
    {
        player = new MediaPlayer();
        try {
            player.setDataSource("http://livestreams.omroep.nl/npo/3fm-bb");
            player.prepare();
            player.start();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

But this aint seem to be working, is it even possible to play an .asx file? or like this? (click on the link and see what i mean)

2

There are 2 answers

1
Sarwar Erfan On

What Android media player can play depends on the codecs included in the device by the manufacturer. There is no fixed list of formats for all devices. Check your device manual for the available codecs in your device. If you are developing an application for distribution, then you better use a format that is commonly available in most android devices. A decent search in Wikipedia (or google) will reveal some lists.

And, most importantly, I found that, the android emulator cannot play many files that can be played in the Samsung Galaxy S I have.

0
Dmitry On

I don't think it's possible. You could try to extract (parse) links from .asx file and than play them.