問題タブ [apprtc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
657 参照

android - WebSocket - ステータス コード 403 とステータス メッセージ - 禁止

Apprtc.Follow 以下の言及ライブラリを使用してビデオ通話アプリに取り組んでいます。

  1. https://github.com/njovy/AppRTCDemo
  2. https://github.com/Piasy/AppRTC-Android

URL を apprtc サーバーではなくカスタム サーバーに変更すると、1 分後にビデオ通話が切断されます。サーバーとの接続が失われました。

サーバーとの接続が失われないようにするには、定期的に約 30 秒間隔でサーバーに ping を実行する必要があります。

ただし、上記のAppRTCプロジェクトはjarファイル(autobanh.jar)を使用してwebsocket接続を行っていますが、ライブラリではsendPing mentodはプライベートであるためアクセスできません。

質問 1 - Websocket サーバーに ping を実行する方法はありません。

websocket ライブラリを置き換えてから試してください websocket ライブラリを以下のライブラリで変更しました

  1. https://github.com/Koredotcom/android-kore-sdk/tree/master/BotsSDK/korebotsdklib/src/main/java/kore/botssdk/autobahn
  2. https://github.com/martindale/soundtrack.io-android/tree/master/src/de/tavendo/autobahn

websocket ライブラリを置き換えた後、sendPing メソッドにアクセスできるようになりました。しかし、ビデオ通話中に 60 秒後に接続が失われました。

Ping メソッド-

ping.mPayload 行のコメントを外すと、BufferOverflowException が発生します。

30秒のタイマー

60 秒後に通話が切断されないようにする方法を提案してください。