apprtc - getusermedia() 失败

2 投票
1 回答
561 浏览
提问于 2025-04-18 04:08

我从这里下载了apprtc。然后我安装了Python 2.7、Google App Engine 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

不过如果我打开官方的apprtc演示,它运行得很好。

我在本地遇到的失败可能是什么原因呢?谢谢!

1 个回答

2

试试这个来获取用户媒体

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

撰写回答