我正在处理一个RTCPeerConnection(pc),它有一个名为onnegotiationneeded的事件处理程序.
onnegotiationneeded使用pc.addStream或添加或删除完整的媒体流时会触发" " pc.removeStream.
是否有可能告诉onnegotiationneeded函数内部是否已执行,因为已添加或删除了流?因为从阅读文档我无法找到一个状态.
目前我正在切换的标志,当我做pc.addStream或pc.removeStream.这个标志可以帮助我判断onnegotiationneeded它是否被流删除了.
但我想知道浏览器(Chrome 40或Firefox 36)API是否已经提供了这样的属性?
onremovestream已被弃用(并从 Firefox 中删除),而onremovetrack尚未在 Firefox 中实现。
如何检测 Firefox 中的流或轨道何时被删除?
设想:
\n\n我在 iOS 上使用 WebRTC(Google 的 libjingle),并且使用 TURN 服务器设置 PeerConnection,我正在等待所有候选者聚集,然后再将它们发送给对等点(我使用的是 SIP)。问题是,尽管所有候选者都在大约 1-3 秒内收集完毕(我可以在日志中看到),但直到大约一分钟后,iceGatheringChanged() 回调才会以状态 GatheringComplete 被调用!
\n\n知道为什么会发生这种情况吗?
\n\n使用 Google 的 AppRTCDemo for iOS 分析流量后,似乎要触发 GatheringComplete,客户端需要 \xe2\x80\x8b 才能从远程端 \xe2\x80\x8b 接收候选者,因为它似乎需要设置 TURN 分配并在新分配上添加权限,以便可以与对等方交换数据。是这样吗?如果是这样为什么?
\n\n此致
\n使用appr.tc ice 服务器(google turn 服务器)时,我可以在任何情况下进行连接。但我无法连接到我自己的回合服务器。我确实通过coturn project.
我正在使用谷歌的libjingle_peerconnectionapi 创建一个Android Application可以执行video call.
当我运行转向服务器时:
<pre>
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.0.5 'dan Eider'
0:
Max number of open files/sockets allowed for this process: 4096
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 2000 (approximately)
0:
==== Show him the instruments, Practical Frost: ====
0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN …Run Code Online (Sandbox Code Playgroud) 当我想建立一个WebRtc连接时,我得到以下错误(尽管已经调用:RTCInitializeSSL();):
setRemoteDescription错误`Domain = org.webrtc.RTCPeerConnection Code = -1"无法设置远程应答sdp:无法按下传输描述:无法设置通道的ssl角色." UserInfo = {NSLocalizedDescription =无法设置远程回答sdp:无法按下传输描述:无法为通道设置ssl角色.}
你知道为什么吗?
我希望逻辑上没有缺陷。
步骤1:呼叫者创建报价
步骤2:呼叫者设置localDescription
步骤3:呼叫者将描述发送给被呼叫者
// ------------------------------------------------ ------ //
步骤4:被叫方收到要约集的远程描述
步骤5:被叫方创建答案
步骤6:被叫方设置本地描述
步骤7:被呼叫者将说明发送给呼叫者
// ------------------------------------------------ ------ //
步骤8:呼叫者收到答案并设置远程描述
这是上面的代码
const socket = io();
const constraints = {
audio: true,
video: true
};
const configuration = {
iceServers: [{
"url": "stun:23.21.150.121"
}, {
"url": "stun:stun.l.google.com:19302"
}]
};
const selfView = $('#selfView')[0];
const remoteView = $('#remoteView')[0];
var pc = new RTCPeerConnection(configuration);
pc.onicecandidate = ({
candidate
}) => {
socket.emit('message', {
to: $('#remote').val(),
candidate: candidate
}); …Run Code Online (Sandbox Code Playgroud) 我正在尝试基于 WebRTC 为 Android/iOS 应用程序实现 DTMF。Android 上有 DTMF API 吗?我尝试过拨打以下电话:
m_peerConnectionFactory.createdtmfsender(localAudioTrack);
m_peerConnectionFactory.insertDtmf(tone, duration,gap);
Run Code Online (Sandbox Code Playgroud)
我尝试过使用上面的 javascript api,它在浏览器上运行良好,但无法在 Android 上运行。我还没有在 iOS 上尝试过,因为我需要先让它在 Android 上运行。
请告诉我 Android/iOS 是否支持此功能?如果是的话,有人可以帮我提供正确的 api 吗
使用的 libjingle 版本:chrome 74.0.3729.169
webrtc peer-connection rtcpeerconnection webrtc-android webrtc-ios
我不能使用以下方法.
因为我只使用datachannel(不使用getUserMedia)
<script>
peerConnection.removeStream(remoteStream)
remoteVideo.onerror = null;
remoteVideo.pause();
remoteVideo.src = undefined;
remoteStream.stop();
remoteStream.onended = null;
remoteStream = null;
peerConnection.removeStream(localStream)
localVideo.onerror = null;
localVideo.pause();
localVideo.src = undefined;
localStream.stop();
localStream.onended = null;
localStream = null;
</script>
Run Code Online (Sandbox Code Playgroud)
有没有办法关闭数据通道?
我正在使用 node.js 服务器发送 iceCandidates 并通过对等连接 (javascript) 连接两台计算机。我想使用 TURN-server 作为 iceServer,但我没有,所以我想在我的服务器上制作 TURN-server。这怎么可能?