Skip to main content
 首页 » 编程设计

python之apprtc之getusermedia() 失败

2025年05月04日22lexus

我从 here 下载了 apprtc .然后我安装了 python 2.7、google-appengine-api 和所有依赖项。我将所有内容添加到我的路径并运行以下命令:

dev_appserver.py apprtc 

产生以下输出:

INFO     2014-04-24 21:31:34,246 sdk_update_checker.py:242] Checking for updates 
to the SDK. 
INFO     2014-04-24 21:31:35,681 sdk_update_checker.py:286] This SDK release is 
newer than the advertised release. 
INFO     2014-04-24 21:31:35,917 api_server.py:171] Starting API server at: http 
://localhost:46857 
INFO     2014-04-24 21:31:35,924 dispatcher.py:182] Starting module "default" ru 
nning at: http://localhost:8080 
INFO     2014-04-24 21:31:35,927 admin_server.py:117] Starting admin server at: 
http://localhost:8000 

但如果我现在在 chrome 或 firefox 中打开 localhost:8080,则会弹出以下消息:

getusermedia() failed. is this a webrtc capable browser 
 
Gathered ICE Candidates 
Local: 
Remote: 
getUserMedia failed with exception: getUserMedia is not defined 

但如果我打开 the official apprtc demo它运行良好。

我在本地失败的原因是什么? 谢谢!

请您参考如下方法:

试试这个来获取用户媒体

navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;