Safari 不发送 ice 候选 [英] Safari does not send ice candidates

查看:50
本文介绍了Safari 不发送 ice 候选的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不要在 safari 中工作

don't work example in safari

https://github.com/Kurento/kurento-tutorial-node/tree/master/kurento-one2many-call

在 chrome 中,一切都很好.

In chrome, everything is fine.

Safary 不会在查看模式下发送冰候选者.演示者模式正常

Safary does not send ice candidates in view mode. Presenter mode is ok

====================

====================

在前面(index.js)

事件 onOfferViewer 总是被执行

The event onOfferViewer is always executed

onIceCandidate – 从未执行过

onIceCandidate – never executed

Front 到节点的连接

var ws = new WebSocket('wss://' + location.host + '/one2many');

var ws = new WebSocket('wss://' + location.host + '/one2many');

在 KMS 上,Turn 没有打开,但配置了 Stun.我可以从 Safari 进行广播,但无法在其上观看

On KMS a Turn doesn’t turn on, but a Stun is configured. I can broadcasting from Safari, but I cannot watching on it

深入了解 kurento utils

在 WebRtcPeer 初始化之前选择了 2 个 Sturm 服务器

2 Sturm servers are chosen, before WebRtcPeer initialization

iceServers:数组 (2)0 {username: undefined, credential: undefined, url: "stun:stun.l.google.com:19302", urls: ["stun:stun.l.google.com:19302"]}

1 {username: undefined, credential: undefined, url: "stun:stun.voipbuster.com", urls: ["stun:stun.voipbuster.com"]}

创建 RTCPeerConnection 之后
执行流程回答后

After RTCPeerConnection is created
After Process answer is executed

我认为下一步必须在函数 addEventListener 中

pc.addEventListener('icecandidate', function (event) {…} 

在 Chrome 的 addEventListener 函数中,会执行回调,但对于 Safari 则不会.

In Chrome in the function addEventListener a callback is executed but for Safari never.

我可以假设候选人在订阅之前就来了,但没有证据,我不明白为什么演示者工作正常.

I can assume that the candidates come before the subscription is taking place, but there is no evidence, and I don’t understand why the presenter works fine.

我开始在 Safari 中以演示者模式进行广播

I started broadcasting in the presenter mode in the Safari

Safari 版本 - 13604.3.5 (MacOs - 11.0.1)

The Safari version - 13604.3.5 (MacOs - 11.0.1)

Safari 选项

旧 API - 已启用

Old api - Enabled

冰限制 - 已禁用

Bower 的依赖

"dependencies": { 
    "adapter.js": "v0.2.9", 
    "bootstrap": "~3.3.0", 
    "ekko-lightbox": "~3.3.0", 
    "demo-console": "1.5.1", 
    "kurento-utils": "master" 
 } 

package.json 结构

{ 
  "name": "kurento-one2many-call", 
  "version": "6.7.3-dev", 
  "private": true, 
  "scripts": { 
    "postinstall": "cd static && bower install" 
  }, 
  "dependencies": { 
    "express": "~4.12.4", 
    "minimist": "^1.1.1", 
    "ws": "~1.0.1", 
    "kurento-client": "Kurento/kurento-client-js" 
  }, 
  "devDependencies": { 
    "bower": "^1.4.1" 
  } 
} 

Safari 日志的输出

Safari 日志的输出

Output of Safari logs

[Log] Browser does not appear to be WebRTC-capable (adapter.js, line 34) 

[Debug] constraints: {"offerToReceiveAudio":true,"offerToReceiveVideo":true} (kurento-utils.js, line 268) 

[Debug] Created SDP offer (kurento-utils.js, line 270) 

[Debug] Local description set – "v=0 

↵o=- 5811275597248577793 2 IN IP4 127.0.0.1 

↵s=- 

↵t=0 0 

↵a=msid-semantic: WMS 

↵" (kurento-utils.js, line 275) 

"v=0 

o=- 5811275597248577793 2 IN IP4 127.0.0.1 

s=- 

t=0 0 

a=msid-semantic: WMS 

" 

[Log] Senging message: {"id":"viewer","sdpOffer":"v=0\r\no=- 5811275597248577793 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=msid-semantic: WMS\r\n"} (index.js, line 70) 

[Info] Received message: {"id":"viewerResponse","response":"accepted","sdpAnswer":"v=0\r\no=- 3748169328 3748169328 IN IP4 0.0.0.0\r\ns=Kurento Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=msid-semantic: WMS\r\n"} (index.js, line 70) 

[Debug] SDP answer received, setting remote description (kurento-utils.js, line 320)  

[Debug] Remote stream: – undefined (kurento-utils.js, line 294)

节点如何连接到KMS

var argv = minimist(process.argv.slice(2), {
    default: { 
        as_uri: 'https://localhost:8443/',      
        ws_uri: 'ws://37.228.89.170:8888/kurento' 
    }
}); 

推荐答案

两个选项:

  1. 仅限 Safari 12 - 需要在 Safari 设置、高级实验性功能中启用实验性功能启用 MDNS Ice Candidates"
  2. Safari 11 - 您必须调用 getUserMedia({video: true, audio: true}),并让用户接受对话框以允许在您的页面上显示视频和音频.即使您不想使用视频或音频,这也会导致 safari 在谈判期间发送冰面候选人
  1. Safari 12 only - Need to enable the experimental feature "Enable MDNS Ice Candidates" in Safari settings, advanced, experimental features
  2. Safari 11 - you have to call getUserMedia({video: true, audio: true}), and have the user accept the dialog box to allow video and audio on your page. Even though you don't want to use the video or audio, this then causes safari to send ice-candidates during the negotiation

这篇关于Safari 不发送 ice 候选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆