How to play radio live stream .asx video/x-ms-asf? [closed]

做~自己de王妃 提交于 2019-12-03 03:23:16

If you open url of the stream in VLC player you can find out that it is an MMS stream using WMA codec mmsh://38.96.148.75/SunnahAudio?MSWMExt=.asf Here is an open source project aacplayer-android which uses libmms and libffmpeg to get WMA content from mms:// stream and play it.
I hope it solves your problem.

I was able to successfully play your stream on Android using Vitamio library. The biggest advantage of this lib is that it's API-compatible with Android SDK, so you'll just have to change imports in your code.

One of Vitamino plugins should be present on given device to use the library. Simply open Vitamio Demo in Eclipse and take a look at how to use it. Prompting user to install Vitamio plugin is included in demo.

I was able to play your stream with this code:

import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.os.Bundle;

public class VideoViewDemo extends Activity {

    private String path = "mmsh://38.96.148.75/SunnahAudio";
    private VideoView mVideoView;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.videoview);
        mVideoView = (VideoView) findViewById(R.id.surface_view);
        mVideoView.setVideoPath(path);
        mVideoView.setMediaController(new MediaController(this));
        mVideoView.requestFocus();
    }

}

As you can see - similar to using VideoView from Android SDK. Pretty much the only difference are imports.

The only difference to be noted is that I was unable to use http link, so I had to use the real streaming URL with mmsh protocol (opened in VLC - similar to what @vasart did).

For reference you can take a look at logs from successful playback.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!