本文介绍了如何从移动网络中的navigator.getUserMedia()获取对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试获取 MediaStream 的JavaScript参考/承诺从HTML5和WebRTC中的 MediaDevices 返回.

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

此处的JavaScript在iOS和Android的Chrome和Safari上运行.

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

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

这将引发TypeError: undefined is not an object (evaluating 'navigator.mediaDevices.getUserMedia')

好吧,让我们尝试一下较旧的方法:

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

navigator.getUserMedia(parms,initfunc,errfunc);

这将引发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?

推荐答案

Safari(或iOS上的任何浏览器)在即将发布的Safari 11之前均不支持getUserMedia和WebRTC.请参见 webkit博客帖子了解详细信息,并注意它没有提及MediaRecorder API.

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.

这篇关于如何从移动网络中的navigator.getUserMedia()获取对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 02:28