Here I am going on with the fullscreen activity of playing video (i.e) i had two screens one is MainScreen and other one to view.In my FirstScreen I have several videos in listview if i longpress on the video it should take the video to Secondscreen there that patricular video should viewed in fullscreen.
If i am playing the video in Firstscreen with duration of(0:00 to 5:00 min) there my video is playing in duration (2:00 min)that time if i longpress the video to view in fullscreen while video playing in Firstscreen with duration between (2:00 min)there the video should continue with the same duration in fullscreen.
I can able to send the video to other screen to view fullscreen video but my problem was it plays from the beginning of the video how can i continue the same duration(2:00 min) as in firstscreen tried a lot to do this but can't able to fix it.
If anyone have idea about this please help me friends.
Here is my code below:
MainScreen:
public void onPrepared(MediaPlayer mp) {
videoPosition = mp.getCurrentPosition();
pDialog.dismiss();
videoPreview.start();
}
videoFullScreenButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent videoIntent = new Intent(MainScreen.this, FullViewScreen.class);
videoIntent.putExtra("current_position",videoPosition);
startActivity(videoIntent);
}
});
FullScreen:
public void onPrepared(MediaPlayer mp) {
Intent intent = getIntent();
String id = intent.getStringExtra("current_position");
mp.seekTo(Integer.parseInt(id));
pDialog.dismiss();
videoPreview.start();
}
XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
<VideoView
android:id="@+id/media_video_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
/>
</RelativeLayout>