【问题标题】:Failed to make webrtc call with DataChannel from Chrome web app to Android app无法使用 DataChannel 从 Chrome 网络应用程序到 Android 应用程序进行 webrtc 调用
【发布时间】:2015-04-10 20:58:44
【问题描述】:

我在:
https://github.com/wennycooper/wsProject

上写了一个webrtc webapp(带视频+音频+dataChannel)

我也在上面写了一个 Android webrtc 应用:
https://github.com/wennycooper/webrtcClient

webapp-to-webapp 调用工作正常。 没有数据通道的 androidapp-to-androidapp 也可以正常工作。

我尝试将数据通道代码添加到 androidapp 并从 webapp 调用 androidapp。当被调用者收到Offer时,显示如下错误:

04-10 15:48:32.410: W/libjingle(10639): Warning(rtpdataengine.cc:149): Failed to SetSendCodecs because there is no known codec.
04-10 15:48:32.410: W/libjingle(10639): Warning(channel.cc:2375): Failed to set remote data description
04-10 15:48:32.420: E/libjingle(10639): Error(channel.cc:730): Failure in SetRemoteContent with action 0
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsession.cc:272): Failed to set remote offer sdp: Session error code: ERROR_CONTENT. Session error description: Failed to set data send codecs..
04-10 15:48:32.420: D/MainActivity(10639): Creating ANSWER...
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsessiondescriptionfactory.cc:245): CreateAnswer can't be called before SetRemoteDescription.
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsessiondescriptionfactory.cc:408): Create SDP failed: CreateAnswer can't be called before SetRemoteDescription.

完整的 adb 日志在这里:
https://s3-us-west-2.amazonaws.com/kkwebrtc/webrtcAndroid_callee.txt

我不知道发生了什么事??
任何人都可以提供带有数据通道的工作示例,将不胜感激。

【问题讨论】:

    标签: android webrtc rtcdatachannel


    【解决方案1】:

    最后,我得到了一个工作示例。

    我所做的是注释掉以下行并使用 SCTPDataChannel。

    //pcConstraints.optional.add(new KeyValuePair("RtpDataChannels", "false")); 

    工作示例在这里:
    https://github.com/wennycooper/webrtcClient

    【讨论】:

    • 我在你的 repo "sendData" 方法中没有找到,你这样做吗?
    • 致@AlexanderSupertramp,你说得对,我刚刚添加了 sendDataChannelMessage() 和 onDataChannelMessage() 方法。我已经用我的网络应用对其进行了测试,它运行良好。
    • 谢谢,我会尝试将它集成到我的项目中。
    • 我无法运行我的应用程序。您的应用是否与 DataChannels 配合良好?您使用的是自己的信号服务器,对吗?我要试试你的..
    • 是的,我的应用在数据通道上运行良好。它使用我自己的信号。请注意,我的信令服务器无法保证正常运行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-14
    • 2011-05-10
    相关资源
    最近更新 更多