简体   繁体   English

如何知道 WebRTC 何时连接在 android (webview) 中?

[英]how to know when WebRTC is connected in android (webview)?

Im using a Webview in android to have a WebRTC video stream.我在 android 中使用 Webview 来获得 WebRTC 视频 ZF7B44CFAFD5C52223D7498196C8A2。 I want to react on some connected and disconnected events in native android, but I cant find any examples of how to react to when webrtc is connected/disconnected.我想对原生 android 中的一些连接和断开事件做出反应,但我找不到任何关于如何在 webrtc 连接/断开时做出反应的示例。 Does anyone have any example of doing this?有没有人有这样做的例子?

RTCPeerConnection instance has connectionState property. RTCPeerConnection 实例具有 connectionState 属性。

If connected, its value is "connected", if disconnected "disconnected".如果已连接,则其值为“已连接”,如果已断开连接,则为“已断开”。

Now you can react:)现在你可以做出反应了:)

this MDN document will help you. 这个 MDN 文档会帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM