目前在写一个读取本地视频播放,现在如下获取到以后要怎样才能一个一个播放,请
指教
public List<Videoinfo> getList() {
List<Videoinfo> list = null;
if (mcontext != null) {
Cursor cursor = mcontext.getContentResolver().query(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, null, null,
null, null);
if (cursor != null) {
list = new ArrayList<Videoinfo>();
while (cursor.moveToNext()) {
int id = cursor.getInt(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media._ID));
String title = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.TITLE));
String album = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.ALBUM));
String artist = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.ARTIST));
String displayName = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME));
String mimeType = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.MIME_TYPE));
String path = cursor
.getString(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.DATA));
long duration = cursor
.getInt(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.DURATION));
long size = cursor
.getLong(cursor
.getColumnIndexOrThrow(MediaStore.Video.Media.SIZE));
Videoinfo video = new Videoinfo(id,displayName,path);
list.add(video);
Log.i(TAG,"name"+video.getPath()+" video"+video);
}
cursor.close();
}
}
return list;
}