According to MDN navigator.getUserMedia() is deprecated and not supported on iOS Safari (which also applies to Chrome and Firefox on iOS since both must use Webkit).
You’ll probably want to try your luck with navigator.mediaDevices.getUserMedia().
The code already has navigator.mediaDevices.getUserMedia, and falls back to navigator.getUserMedia if navigator.mediaDevices is absent. But neither works.
If it works in Safari then Apple might not grant access for other browser implementations (see e.g. this issue). Unfortunately I currently don’t have access to either an iOS device or browserstack, but you could perhaps try to throw in adapter.js.