Search code examples
cordovaionic-frameworkcrosswalk-runtime

How to allow getUserMedia on a ionic project with crosswalk


When I run my ionic app with crosswalk, and try open the camera through the getUserMedia api. I get the PermissionDenied error

getUserMedia permissionDenied

How to allow the access to camera?


Solution

  • I managed to solve as follows:

    Simply using pure cordova, without ionic or CCA.

    Adding the crosswalk plugin:

    cordova plugin add cordova-plugin-crosswalk-webview

    Repository page: https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview

    And in the AndroidManifest.xml add the line:

    < uses-permission android:name="android.permission.CAMERA"/>

    See more permissions at: https://crosswalk-project.org/documentation/manifest/permissions.html

    The importance of the CSP rules still remain, as QuickFix said.

    :media-src: 'self' mediastream: