Actually, I'm Developing a Video player. then I have small Requirement for the video player i.e., whenever my video player application is launched when clicking on the fab button how to play the last played video? Please anyone can help me..
Asked
Active
Viewed 70 times
0
-
When User Play Vedio Save It`s Uri In SharedPrefernce In Key for Example "lastVedio" And Then get it and Play it – Elsunhoty Apr 30 '18 at 06:38
-
store last played video data(like path of video and time to be resumed) in sharedPref . – Jyoti JK Apr 30 '18 at 06:38
-
Create a temp file which stores the path of last played video , and when you click on fab button you can play that video – bit-shashank Apr 30 '18 at 06:38
-
Thank you jyothi, but if you don't mine please provide sample – Ashok Apr 30 '18 at 06:43
-
Thank you java fan if you don't mine please provide sample – Ashok Apr 30 '18 at 06:43
-
Thank you Elsunhoty, if you don't mine please provide sample – Ashok Apr 30 '18 at 06:44
-
@Ashok you can refer [**`this link`**](https://stackoverflow.com/questions/23024831/android-shared-preferences-example) – Jyoti JK Apr 30 '18 at 06:45
2 Answers
0
Hai Priyank Actually How to Add the Volume Increase and Decrease options using seekbar on Swipeup(); and swipe down on onToucheventListener. I have no idea to add the above functionality if possible please tell me the process or please provide the sample Priyank.

Ashok
- 1
- 6
-2
Store your last played video uri or file path some where in shared preference or in database. and on click play that uri or file in your video view. like below example Ask anything if you not getting my point.
Store last Video :
SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPref",0);
Editor editor = pref.edit();
editor.putString("LastVideo", "path or Uri"); // Store your last video uri or file path
editor.commit();
Get last video :
String path = pref.getString("LastVideo", null); // getting String
You will get you last uri or path into path variable.

PriyankVadariya
- 809
- 9
- 14