Hello guys can someone share with me on how am i going to code my viewvideo.java class such that it allow auto-play video function which automatically sequence the task of playi
I think that all you need to do is call videoView.setVideoPath(next_file_path)
and then call videoView.start()
. If there are no more videos, then call videoView.stopPlayback()
.
Here's something that might work:
@Override
public void onClick(DialogInterface dialog, int which) {
if (arg1 == 0) {
Intent intentInfo = new Intent(ListViewActivity.this, DialogBox.class);
// Retrieve the path names of all videos from the top to the
// selected item (inclusive).
arrayPath = new String[selectedPosition+1];
for (int i = 0; i <= selectedPosition; ++i) {
arrayPath[i] = videoItems.get(i).absolutePath;
}
VideoInfo info = videoItems.get(selectedPosition);
intentInfo.putExtra("fileName", info.name);
intentInfo.putExtra("fileSize", info.size);
intentInfo.putExtra("absolutePath", info.absolutePath);
intentInfo.putExtra("arrayPath", arrayPath);
startActivity(intentInfo);
}
else
{
deleteFile();
}
}
This passes the array of path names to your DialogBox activity (which you haven't posted). You should then be able to retrieve arrayPath
and pass it on to the VideoView activity if the user selects to play all videos.