Have you configured content secutity policy in your html file? (please discard this answer if you're not using cordova 5 with plugin cordova-plugin-whitelist)
I think that in order to use getUserMedia in cordova, you have to add the following string in your CSP meta tag :
media-src: 'self' mediastream:
(csp configuration borrowed from this page)
More info about the cordova-plugin-whitelist there and CSP doc there.