我尝试实现以下代码,但它显示媒体播放器错误(1,-1010)或者我需要使用另一个播放器。
public class VideoViewActivity extends Activity {
// Declare variables
ProgressDialog pDialog;
VideoView videoview;
Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the layout from video_main.xml
setContentView(R.layout.videoview_main);
// Find your VideoView in your video_main.xml layout
MediaPlayer mp=new MediaPlayer();
videoview = (VideoView) findViewById(R.id.VideoView);
try {
mp.setDataSource("http://example.com/playlist.m3u8");
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
mp.prepare();
mp.start();
} catch (IllegalArgumentException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}}
我们可以在android中使用RTSP进行音频流吗?