Created
September 7, 2017 12:47
-
-
Save kendhia/74e36b29b6930d7e88d256d749aa9741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getAbsolutePathForVideoFromURI(@NonNull Context context, @NonNull Uri videoUri) { | |
if (ContentResolver.SCHEME_FILE.equals(videoUri.getScheme())) { | |
return videoUri.getPath(); | |
} else if ("com.google.android.apps.photos.contentprovider".equals(videoUri.getAuthority())) { | |
String pathUri = videoUri.getPath(); | |
videoUri = Uri.parse(pathUri.substring(pathUri.indexOf("content"), pathUri.lastIndexOf("/ORIGINAL"))); | |
} | |
String id = getUriId(videoUri); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment