Android examples for android.media:Video Uri
get Video Uri From Media Provider
import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore.Video; public class Main { public static final Uri getVideoUriFromMediaProvider(Context ctxt, String videoFile) { String selection = Video.VideoColumns.DATA + "=?"; String[] selectArgs = { videoFile }; String[] projection = { Video.VideoColumns._ID }; Cursor c = null;//from w w w.j av a2 s . c om try { c = ctxt.getContentResolver().query(android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, selection, selectArgs, null); if (c.getCount() > 0) { c.moveToFirst(); String id = c.getString(c.getColumnIndex(Video.VideoColumns._ID)); return Uri.withAppendedPath(android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI, id); } return null; } finally { if (c != null) { c.close(); } } } }