I tried to implement the following code but it shows media player error (1,-1010) or do i need to use another player.
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();
}
}}
Can we use RTSP for audio streaming in android?
After long search I integrate VLC player with my app.This solves all the issue faced earlier now i can easily play audio/video through .m3u8 format.