Log in or register to post comments

Change Location of video on SD Card at runtime.

May 23, 2013 - 9:53am #1

Hi Guys,

I have modified the Video Playback Sample such that we download a video from my server and store it in the SD Card/External Memory and play it on texture from there. I set the data location in this line in VideoPlayerHelper.java.

                            mMediaPlayer.setDataSource(Environment.getExternalStorageDirectory().getPath().toString()+"/"+str);
Where "str" is the name of the video file.
The problem i am facing is that this location is static i.e. this location is loaded at the initial startup of the app. I want to change this location dyanamically at a time i wish. I tried a procedure where i refer to a method "setstring" in VideoPlayerHelper where i set str but this fails to work i.e. this change is not recognised and the location that was reffered to initially only loads. Can anyone suggest a way to do this.
 
Thanks.

Change Location of video on SD Card at runtime.

May 23, 2013 - 2:10pm #2

Hi,

you may need to stop the mediaplayer before calling setDataSource();

check the MediaPlayer documentation in the Android Dev Guide:

http://developer.android.com/reference/android/media/MediaPlayer.html

 

Log in or register to post comments