我正在开发一个简单的应用程序,在此我尝试使用getUserMedia访问摄像头和麦克风.它适用于台式机Chrome和
Android Chrome,但它在iPhone和iPad Chrome中无效.
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; var constraints = ""; if (mediaType === "audio,video") { constraints = { audio : true,video : true }; } else { constraints = { audio : true,video : false }; } navigator.getUserMedia(constraints,successCallback,errorCallback);
解决方法
… but it’s not working in iPhone and iPad Chrome.
iPhone或iPad上的Chrome应用程序未运行“完整”版本的Chrome.它的功能仅限于iOS平台.所以getUserMedia等可能要到Safari/Apple supports it才能使用.
Quoting from another question:
Apple policy forces other browser to use their version of webkit which does not support webRTC,so you will not have webRTC support in a web app on iOS anytime soon. Activity in webkit hints as a change,but time for this to land,it will be months.