You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "liuminyu2989 (via GitHub)" <gi...@apache.org> on 2025/01/10 07:43:16 UTC

[I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

liuminyu2989 opened a new issue, #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310

   ```
   this.androidPermissions.requestPermissions([
           this.androidPermissions.PERMISSION.RECORD_AUDIO,
           this.androidPermissions.PERMISSION.CAMERA,
           this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE,
           this.androidPermissions.PERMISSION.READ_EXTERNAL_STORAGE,
           this.androidPermissions.PERMISSION.MODIFY_AUDIO_SETTINGS,
         ])
         .then(res => {
           console.log(res);   
           this.mediaCapture.captureVideo().then((mediaFiles:MediaFile[]) => {
             console.log(mediaFiles);
             resolve(mediaFiles);   
             }).catch(e => `{`
               console.log(e);
           })     
         })
   ```
   
   > I use cordova-plugin-android-permissions to apply for the permission needed for video recording.The result is{code: 4, message: 'Permission denied.'}
   
   AndroidManifest.xml:
   ```
   <?xml version='1.0' encoding='utf-8'?>
   <manifest android:hardwareAccelerated="true" android:versionCode="10600" android:versionName="1.6.0" xmlns:android="http://schemas.android.com/apk/res/android">
       <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
       <uses-permission android:name="android.permission.INTERNET" />
       <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true">
           <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@style/Theme.App.SplashScreen" android:windowSoftInputMode="adjustResize">
               <intent-filter android:label="@string/launcher_name">
                   <action android:name="android.intent.action.MAIN" />
                   <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
           </activity>
           <provider android:authorities="${applicationId}.cordova.plugin.camera.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
               <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths" />
           </provider>
           <provider android:authorities="${applicationId}.fileOpener2.provider" android:exported="false" android:grantUriPermissions="true" android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider">
               <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" />
           </provider>
           <activity android:exported="false" android:name="de.niklasmerz.cordova.biometric.BiometricActivity" android:theme="@style/TransparentTheme" />
           <activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@android:style/Theme.Holo.Light" />
           <provider android:authorities="${applicationId}.localnotifications.provider" android:exported="false" android:grantUriPermissions="true" android:name="de.appplant.cordova.plugin.notification.util.AssetProvider">
               <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/localnotification_provider_paths" />
           </provider>
           <receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.TriggerReceiver" />
           <receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.ClearReceiver" />
           <activity android:excludeFromRecents="true" android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.ClickHandlerActivity" android:taskAffinity="" />
           <receiver android:directBootAware="true" android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver">
               <intent-filter>
                   <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                   <action android:name="android.intent.action.BOOT_COMPLETED" />
               </intent-filter>
           </receiver>
           <receiver android:enabled="true" android:exported="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
               <intent-filter>
                   <action android:name="android.intent.action.SEND" />
               </intent-filter>
           </receiver>
           <provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
               <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
           </provider>
       </application>
       <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
       <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
       <uses-permission android:name="android.permission.RECORD_AUDIO" />
       <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
       <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
       <uses-permission android:name="android.permission.PROJECT_MEDIA" />
       <uses-feature android:name="android.hardware.microphone" android:required="true" />
       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
       <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
       <uses-permission android:name="android.permission.USE_FINGERPRINT" />
       <queries>
           <intent>
               <action android:name="android.media.action.IMAGE_CAPTURE" />
           </intent>
           <intent>
               <action android:name="android.intent.action.GET_CONTENT" />
           </intent>
           <intent>
               <action android:name="android.intent.action.PICK" />
           </intent>
           <intent>
               <action android:name="com.android.camera.action.CROP" />
               <data android:mimeType="image/*" android:scheme="content" />
           </intent>
       </queries>
       <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
       <uses-permission android:name="android.permission.USE_BIOMETRIC" />
       <uses-permission android:name="android.permission.CAMERA" android:required="false" />
       <uses-feature android:name="android.hardware.camera" android:required="false" />
       <uses-feature android:name="android.hardware.camera.front" android:required="false" />
       <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
       <uses-permission android:name="android.permission.WAKE_LOCK" />
       <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
       <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
       <uses-permission android:name="android.permission.VIBRATE" />
       <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
   </manifest>
   ```
   
   > My running environment is as follows:
   
   1."@angular/core": "14.3.0"
   2."@ionic-native/android-permissions": "^5.36.0",
   3."@ionic-native/core": "5.36.0",
   4. "@ionic-native/file": "5.36.0",
   5. "cordova-android": "^12.0.1",
   6. "cordova-plugin-media-capture": "^4.0.0"
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "liuminyu2989 (via GitHub)" <gi...@apache.org>.
liuminyu2989 commented on issue #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310#issuecomment-3071613151

   Use the v6 of the media capture plugin is OK.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "christianbuonaiutowork (via GitHub)" <gi...@apache.org>.
christianbuonaiutowork commented on issue #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310#issuecomment-3048190378

   🆙
   I have the same problem 😔


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "liuminyu2989 (via GitHub)" <gi...@apache.org>.
liuminyu2989 commented on issue #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310#issuecomment-2581983834

   But it can run normally on Android 9.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #310: Call captureVideo method on Android 14,Permission denied.
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310#issuecomment-3049390016

   This should be addressed in the v6 of the media capture plugin. Note that the READ_MEDIA_* permissions are not necessary for capturing media content.
   
   If you're having issues with v6 of the plugin, I'd advise opening up a new issue with more up to date information. I'm closing this as out-dated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Call captureVideo method on Android 14,Permission denied. [cordova-plugin-media-capture]

Posted by "christianbuonaiutowork (via GitHub)" <gi...@apache.org>.
christianbuonaiutowork commented on issue #310:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/310#issuecomment-3072718727

   > Use the v6 of the media capture plugin is OK.
   
   Ah ok, I use the v5... maybe can be this is the problem 🙃


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org