gpt4 book ai didi

webrtc - tokbox : Subscriber time out error on Safari

转载 作者:行者123 更新时间:2023-12-02 04:25:32 24 4
gpt4 key购买 nike

使用 opentok.js v2,视频 channel 在 Chrome 和 Firefox 上运行良好。使用的 opentok 版本来自此链接:https://static.opentok.com/v2/js/opentok.min.js

但它不适用于 safari 11.0.3。
在 session 的流创建事件中,它会生成以下错误消息“由于网络错误,流无法连接。确保您的连接没有被防火墙阻止”
发布者已成功发布,即 session.publish(..) 工作正常。

下面的代码用于进行视频通话:

this.session=OT.initSession(this.apiKey, this.sessionId);

this.session.on({

streamCreated: (event) => {

 

this.session.subscribe(event.stream, 'subscriber');

},

streamDestroyed: (event) => {

console.log(`Stream ${event.stream.name} ended because ${event.reason}`);

}

});

this.session.connect(this.token, () => {
this.publisher=OT.initPublisher('publisher');

this.session.publish(this.publisher);

});

}

opentok.js 生成的控制台中的其他异常如下:
[Error] OT.exception :: title: undefined (1554) msg: OT.Subscriber PeerConnection Error: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
_exceptionHandler (vendor.js:150924)
handleJsException (vendor.js:151002)
onPeerConnectionFailure (vendor.js:162673)
(anonymous function) (vendor.js:162414)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)


[Error] OT_ICE_WORKFLOW_FAILED: ICEWorkflow: Subscriber PeerConnection with connection (not found) failed: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
dispatchOTError (vendor.js:159161)
(anonymous function) (vendor.js:160080)
handleThisOnce (vendor.js:137437)
(anonymous function) (vendor.js:137675)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)



[Error] OT.exception :: title: undefined (1554) msg: ICEWorkflow: Subscriber PeerConnection with connection (not found) failed: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
_exceptionHandler (vendor.js:150924)
handleJsException (vendor.js:151002)
dispatchOTError (vendor.js:159163)
(anonymous function) (vendor.js:160080)
handleThisOnce (vendor.js:137437)
(anonymous function) (vendor.js:137675)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)


以上所有错误仅在 Safari 浏览器上生成。

最佳答案

您需要确保已在 OpenTok 帐户门户中创建了一个 Safari 项目。更多详情请见 https://tokbox.com/developer/sdks/js/safari/

看起来您正在使用 polyfills.js 文件。如果那是来自 Angular 的包含 zone.js 的 polyfill,那么您需要在 polyfills.js 文件中包含 RTCPeerConnections 'zone.js/dist/webapis-rtc-peer-connection' 的修复程序。

import 'zone.js/dist/webapis-rtc-peer-connection';

您可能还想包含 getUserMedia 的 polyfill。更多详情请见 https://github.com/angular/zone.js/issues/948#issuecomment-357558384

关于webrtc - tokbox : Subscriber time out error on Safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48654523/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com