简体   繁体   中英

Android Play .asx file with MediaPlayer?

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)

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 SI have.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM