fix recording videos on some SD cards
This commit is contained in:
parent
af049de119
commit
7c0924b2fd
|
@ -57,5 +57,5 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.26.18'
|
implementation 'com.simplemobiletools:commons:5.26.19'
|
||||||
}
|
}
|
||||||
|
|
|
@ -773,7 +773,10 @@ class CameraPreview : ViewGroup, TextureView.SurfaceTextureListener, MyPreview {
|
||||||
val videoSize = getCurrentResolution()
|
val videoSize = getCurrentResolution()
|
||||||
mLastVideoPath = mActivity.getOutputMediaFile(false)
|
mLastVideoPath = mActivity.getOutputMediaFile(false)
|
||||||
val uri = if (context.isPathOnSD(mLastVideoPath)) {
|
val uri = if (context.isPathOnSD(mLastVideoPath)) {
|
||||||
context.getDocumentFile(mLastVideoPath.getParentPath())?.createFile("video/mp4", mLastVideoPath.getFilenameFromPath())!!.uri
|
val parentDocumentFile = context.getDocumentFile(mLastVideoPath.getParentPath())
|
||||||
|
val documentFile = parentDocumentFile?.createFile("video/mp4", mLastVideoPath.getFilenameFromPath())
|
||||||
|
?: mActivity.getDocumentFile(mLastVideoPath)
|
||||||
|
documentFile!!.uri
|
||||||
} else {
|
} else {
|
||||||
Uri.fromFile(File(mLastVideoPath))
|
Uri.fromFile(File(mLastVideoPath))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue