简体   繁体   English

带有MediaPlayer的Android Play .asx文件?

[英]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? 但这似乎不是可行的,甚至可以播放.asx文件吗? 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. Android媒体播放器可以播放的内容取决于制造商在设备中包含的编解码器。 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. 如果您要开发用于分发的应用程序,则最好使用大多数android设备中普遍可用的格式。 A decent search in Wikipedia (or google) will reveal some lists. 在Wikipedia(或google)中进行不错的搜索会显示一些列表。

And, most importantly, I found that, the android emulator cannot play many files that can be played in the Samsung Galaxy SI have. 而且,最重要的是,我发现,Android仿真器无法播放可以在Samsung Galaxy SI中播放的许多文件。

I don't think it's possible. 我认为这是不可能的。 You could try to extract (parse) links from .asx file and than play them. 您可以尝试从.asx文件中提取(解析)链接,然后播放它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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