Skip to content

MIME type video/mp4 cannot be inserted into content://media/external/images/media; expected MIME type under image/* #305

Description

@AFAP

视频拍摄报错:MIME type video/mp4 cannot be inserted into content://media/external/images/media; expected MIME type under image/*

target:28
手机系统Android10
修复:MediaGridFragment.java中
getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);这边需要判断,如果是视频要存另一个地方:
Uri uri;
if (image) {
uri = getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
} else {
uri = getContext().getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions