Reputation: 83
1.I have to use .m3u8 file for HLS,tried to seek the video as 0th position using video view but it is playing live streaming.
videoPlayer = (VideoView) findViewById(R.id.videoView);
videoPlayer.setVideoURI(Uri.parse("http://xxx.xxx.xx/test/640x360_main_656.m3u8"));
videoPlayer.setMediaController(new MediaController(this));
videoPlayer.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
// TODO Auto-generated method stub
videoPlayer.seekTo(0);
videoPlayer.start();
}
});
2.I tested android version 4.1.1 is support to play from beginning,it is support android version based?
Upvotes: 0
Views: 1044
Reputation: 9827
No you cannot play a live stream from beginning (that's why it's a Live Stream) BUT you can tweak the server from which you are getting your live stream (most probably it will be a Wowza server) to enable stream caching than you can play the stream from beginning as server is caching your stream and will provide you complete stream from beginning.
Upvotes: 1