te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - Does RTCPeerConnection work in Microsoft Edge? - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Does RTCPeerConnection work in Microsoft Edge? - Stack Overflow

programmeradmin3浏览0评论

I am currently working on VoIP using WebRTC. It's going to be a UWP application written in JavaScript.

Now, I am trying to check whether it works or not by testing samples from on Microsoft Edge.

It turns out that it works fine except RTCPeerConnection.

For example, when I opened in Edge, it gave me getUserMedia() error: NotFoundError when I clicked the call button. On Chrome, it works fine.

Another example is when I tried , it gave me

Messages:  
Error getting user media: null
getUserMedia error: Failed to get access to local media. Error name was NotFoundError. Continuing without sending a stream.
Create PeerConnection exception: InvalidAccessError

Version:    
gitHash:    c135495bc71e5da61344f098a8209a255f64985f
branch:     master
time:       Fri Apr 8 13:33:05 2016 +0200

So, how should I fix that? Adapter.js is also called. I also allow everything it needs.

Or I shouldn't use WebRTC for this project. If so, what should I use?

Cheers!

I am currently working on VoIP using WebRTC. It's going to be a UWP application written in JavaScript.

Now, I am trying to check whether it works or not by testing samples from https://webrtc.github.io/samples on Microsoft Edge.

It turns out that it works fine except RTCPeerConnection.

For example, when I opened https://webrtc.github.io/samples/src/content/peerconnection/audio in Edge, it gave me getUserMedia() error: NotFoundError when I clicked the call button. On Chrome, it works fine.

Another example is when I tried https://apprtc.appspot., it gave me

Messages:  
Error getting user media: null
getUserMedia error: Failed to get access to local media. Error name was NotFoundError. Continuing without sending a stream.
Create PeerConnection exception: InvalidAccessError

Version:    
gitHash:    c135495bc71e5da61344f098a8209a255f64985f
branch:     master
time:       Fri Apr 8 13:33:05 2016 +0200

So, how should I fix that? Adapter.js is also called. I also allow everything it needs.

Or I shouldn't use WebRTC for this project. If so, what should I use?

Cheers!

Share Improve this question asked Apr 24, 2016 at 14:43 ThammarithThammarith 7726 silver badges21 bronze badges 1
  • that looks like an issue with your cam/mic. Check the output of navigator.mediaDevices.enumerateDevices e.g. using this demo – Philipp Hancke Commented Apr 25, 2016 at 5:27
Add a ment  | 

2 Answers 2

Reset to default 13

Microsoft Edge implements ORTC, a more low-level decentralized cousin of WebRTC that does not have an overarching RTCPeerConnection object.

But the good news is that adapter.js, the official WebRTC polyfill, shims RTCPeerConnection for you on Edge, so you should be able to use WebRTC the same way on all the browsers.

For instance, this demo works for me in Edge, Firefox and Chrome.

var pc1 = new RTCPeerConnection(), pc2 = new RTCPeerConnection();

navigator.mediaDevices.getUserMedia({ video: true, audio: true })
  .then(stream => pc1.addStream(video1.srcObject = stream))
  .catch(log);

var add = (pc, can) => can && pc.addIceCandidate(can).catch(log);
pc1.onicecandidate = e => add(pc2, e.candidate);
pc2.onicecandidate = e => add(pc1, e.candidate);

pc2.onaddstream = e => video2.srcObject = e.stream;
pc1.oniceconnectionstatechange = e => log(pc1.iceConnectionState);
pc1.onnegotiationneeded = e =>
  pc1.createOffer().then(d => pc1.setLocalDescription(d))
  .then(() => pc2.setRemoteDescription(pc1.localDescription))
  .then(() => pc2.createAnswer()).then(d => pc2.setLocalDescription(d))
  .then(() => pc1.setRemoteDescription(pc2.localDescription))
  .catch(log);

var log = msg => div.innerHTML += "<br>" + msg;
<video id="video1" width="160" height="120" autoplay muted></video>
<video id="video2" width="160" height="120" autoplay></video><br>
<div id="div"></div>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>

You should check your privacy settings first to allow Edge to access your media devices. https://privacy.microsoft./en-us/windows-10-camera-and-privacy

发布评论

评论列表(0)

  1. 暂无评论