How to obtain object from navigator.getUserMedia() in mobile web?

谁说胖子不能爱 提交于 2019-12-11 15:16:55

问题


Trying to get a JavaScript reference/promise to a MediaStream returned from MediaDevices in HTML5 and WebRTC.

JavaScript here is run on Chrome and Safari on iOS and Android.

navigator.mediaDevices.getUserMedia(session, initRec , onErr);

This throws TypeError: undefined is not an object (evaluating 'navigator.mediaDevices.getUserMedia')

Fine, let's try it the slightly older way:

navigator.getUserMedia(parms,initfunc,errfunc);

This throws TypeError: navigator.getuserMedia is not a function. (In 'navigator.getUserMedia(parms,initfunc,errfunc)', 'navigator.getUserMedia' is undefined)

Note: Both of those calls work on desktop versions. Did mobile web EVER work for audio recording?


回答1:


Safari (or any browser on iOS) does not support getUserMedia and WebRTC until the upcoming Safari 11. See the webkit blog post for details and note that it does not mention the MediaRecorder API.



来源:https://stackoverflow.com/questions/44576832/how-to-obtain-object-from-navigator-getusermedia-in-mobile-web

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!