javascript - (Ionic/Cordova) PermissionDeniedError for getUserMedia -
so i'm working on app uses webrtc , i'm @ point want bang head against table. i'm having issue getusermedia, returns permissiondeniederror when run on phone (android 6.0.1).
the app has these permissions set in androidmanifest.xml:
<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.camera" /> <uses-permission android:name="android.permission.record_audio" /> <uses-permission android:name="android.permission.modify_audio_settings" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.access_wifi_state" />
the app request storage, camera , voice permissions on runtime , have installed cordova-diagnostic-plugin, verifies app has these permissions.
i've tried setting following html header recommended someone:
<meta http-equiv="content-security-policy" content="media-src: 'self' mediastream: blob:;">
i'm running cordova 6.3.1 , ionic 2.0.0. (i have installed android support repository 38 , support library 23.2.1 required cordova-diagnostic-plugin).
for reference, getusermedia code i'm using is:
if (navigator.webkitgetusermedia) { navigator.webkitgetusermedia({audio: true, video: true}, gotusermedia, reject); }
the android target sdk version set 23 (for android 6).
has got ideas help? thanks.
okay, crisis averted. turns out fault, running app --livereload on ionic (to console output), ran via non-ssl local server getusermedia doesn't xd
i built app via "ionic build android" , installed manually on phone, , works fine :)
Comments
Post a Comment