Package ai.nexconn.chatui.picture.tools
Class MediaUtils
-
- All Implemented Interfaces:
public class MediaUtils
-
-
Constructor Summary
Constructors Constructor Description MediaUtils()
-
Method Summary
Modifier and Type Method Description static UricreateImageUri(Context context)Create an image URI for saving captured photos static UricreateVideoUri(Context context)Create a video URI for saving recorded videos static longextractDuration(Context context, boolean isAndroidQ, String path)Get video duration static booleanisLongImg(LocalMedia media)Check whether it is a long image static Array<int>getLocalSizeToAndroidQ(Context context, String videoPath)get Local video width or height for api 29 static Array<int>getLocalImageSizeToAndroidQ(Context context, String videoPath)get Local image width or height for api 29 static Array<int>getLocalVideoSize(String videoPath)get Local video width or height static Array<int>getLocalVideoSize(Context context, Uri uri)get Local video width or height static Array<int>getLocalImageWidthOrHeight(String imagePath)get Local image width or height static intgetLastImageId(Context context, String mimeType)Get the latest photo record in the DCIM folder -
-
Method Detail
-
createImageUri
static Uri createImageUri(Context context)
Create an image URI for saving captured photos
- Returns:
the image URI
-
createVideoUri
static Uri createVideoUri(Context context)
Create a video URI for saving recorded videos
- Returns:
the video URI
-
extractDuration
static long extractDuration(Context context, boolean isAndroidQ, String path)
Get video duration
-
isLongImg
static boolean isLongImg(LocalMedia media)
Check whether it is a long image
- Returns:
true if long image, false otherwise
-
getLocalSizeToAndroidQ
@Deprecated() static Array<int> getLocalSizeToAndroidQ(Context context, String videoPath)
get Local video width or height for api 29
-
getLocalImageSizeToAndroidQ
static Array<int> getLocalImageSizeToAndroidQ(Context context, String videoPath)
get Local image width or height for api 29
-
getLocalVideoSize
static Array<int> getLocalVideoSize(String videoPath)
get Local video width or height
-
getLocalVideoSize
static Array<int> getLocalVideoSize(Context context, Uri uri)
get Local video width or height
-
getLocalImageWidthOrHeight
static Array<int> getLocalImageWidthOrHeight(String imagePath)
get Local image width or height
-
getLastImageId
@Deprecated() static int getLastImageId(Context context, String mimeType)
Get the latest photo record in the DCIM folder
-
-
-
-