Package io.rong.imkit.picture.tools

## Class MediaUtils

- All Implemented Interfaces:

      public class MediaUtils

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MediaUtils()` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `static Uri` | `createImageUri(Context context)` | 创建一条图片地址uri,用于保存拍照后的照片
    `static Uri` | `createVideoUri(Context context)` | 创建一条视频地址uri,用于保存录制的视频
    `static long` | `extractDuration(Context context, boolean isAndroidQ, String path)` | 获取视频时长
    `static boolean` | `isLongImg(LocalMedia media)` | 是否是长图
    `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 int` | `getLastImageId(Context context, String mimeType)` | 获取DCIM文件下最新一条拍照记录

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MediaUtils

          MediaUtils()

  - ### Method Detail

    - #### createImageUri

           static Uri createImageUri(Context context)

      创建一条图片地址uri,用于保存拍照后的照片

      Returns:

        图片的uri

    - #### createVideoUri

           static Uri createVideoUri(Context context)

      创建一条视频地址uri,用于保存录制的视频

      Returns:

        视频的uri

    - #### extractDuration

           static long extractDuration(Context context, boolean isAndroidQ, String path)

      获取视频时长

    - #### isLongImg

           static boolean isLongImg(LocalMedia media)

      是否是长图

      Returns:

        true 是 or false 不是

    - #### 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)

      获取DCIM文件下最新一条拍照记录