Closed AdlerJS closed 1 year ago
@dragermrb - Did want to give more info after doing a bit of research. I think this is related specifically to the Android code
CapacitorPlugin(
name = "VideoEditor",
permissions = {
@Permission(
strings = {Manifest.permission.READ_EXTERNAL_STORAGE},
alias = VideoEditorPlugin.STORAGE
)
}
)
On Android 13 -
private val readImagePermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
if(ContextCompat.checkSelfPermission(this, readImagePermission) == PackageManager.PERMISSION_GRANTED){
//permission granted
} else {
//permission not granted
}
Just to be explicit the new permissions are as follows: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO and READ_MEDIA_AUDIO.
Let me know if there is anymore I can do or add to help. Thanks!
Hi Dan
I'm on vacation for two weeks, I'll look at it when I get back
El mar, 25 jul 2023, 21:37, Dan Adler @.***> escribió:
@dragermrb https://github.com/dragermrb - Did want to give more info after doing a bit of research. I think this is related specifically to the Android code
CapacitorPlugin( name = "VideoEditor", permissions = { @Permission( strings = {Manifest.permission.READ_EXTERNAL_STORAGE}, alias = VideoEditorPlugin.STORAGE ) } )
On Android 13 - was deprecated (see: @.***/how-to-migrate-read-external-storage-permission-to-read-media-images-permission-for-android-13-ab99de39318) meaning if you are targeting SDK 33 on Android 13 the READ_EXTERNAL_STORAGE dialog request will be ignored at the native level. My guess here is that this plugin is expecting that permission. Instead we need to target the new permissions similar to this example from the medium article:
private val readImagePermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE if(ContextCompat.checkSelfPermission(this, readImagePermission) == PackageManager.PERMISSION_GRANTED){ //permission granted } else { //permission not granted }
Just to be explicit the new permissions are as follows: READ_MEDIA_IMAGES https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_IMAGES, READ_MEDIA_VIDEO https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_VIDEO and READ_MEDIA_AUDIO https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_AUDIO .
Let me know if there is anymore I can do or add to help. Thanks!
— Reply to this email directly, view it on GitHub https://github.com/dragermrb/capacitor-plugin-video-editor/issues/9#issuecomment-1650422709, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSVEGLLEIMUC77DYM3THTXSAN57ANCNFSM6AAAAAA2XO24XE . You are receiving this because you were mentioned.Message ID: @.***>
@dragermrb - I know you are vacation and hope you enjoy it. I put up a PR to fix this issue here as it is a blocker for an upcoming release we have. If you wouldn't mind taking a look. Just trying to avoid having to point our app towards a local fork.
https://github.com/dragermrb/capacitor-plugin-video-editor/pull/12
Thanks!
Merged #12
When trying to use the thumbnail function on Capacitor Android to generate a thumbnail preview I'm getting the following error thrown: "User denied access to storage"
Note: I've also tried adding the following permissions:
uses-permission android:name="android.permission.READ_MEDIA_VIDEO" Android Version: ~ Android 13 (API level 33)
Code:
I have what I believe is the correct permissions in AndroidManifest.xml
Logcat Info: