Код: Выделить всё
val sdp = SessionDescription(SessionDescription.Type.OFFER, message.message)
Код: Выделить всё
Log.d("WebRtcActivityCandidate", "SessionDescription - ${sdp.description}")
Log.d("WebRtcActivityCandidate", "SessionDescription - ${sdp}")
Код: Выделить всё
peerConnection?.setRemoteDescription(object : SdpObserver {
override fun onCreateSuccess(p0: SessionDescription?) {}
override fun onSetSuccess() {
Log.d("WebRtcActivityCandidate", "Remote SDP set successfully after delay")
}
override fun onCreateFailure(p0: String?) {
Log.e("WebRtcActivityCandidate", "Failed to create SDP: $p0")
}
override fun onSetFailure(p0: String?) {
Log.e("WebRtcActivityCandidate", "Failed : $p0, SDP: ${sdp.description}")
Log.e("WebRtcActivityCandidate", "Failed to set remote SDP after delay: $p0")
}
}, sdp)
Что бы я ни делал, ошибок нет. изменения; постоянно пишет:
"Не удалось установить удаленный SDP после задержки: SessionDescription имеет значение NULL".
Код для его получения выглядит так:
Код: Выделить всё
if (message?.type == "video_call_process_offer_dsgdlkhjerogjdslghk" && openType == "incoming") {
Log.d("WebRtcActivityCandidate", "Original message: ${message.message}")
val sdpReplace = message.message.replace("\\s+".toRegex(), " ").trim()
Log.d("WebRtcActivityCandidate", "SDP Length: ${sdpReplace.length}")
Log.d("WebRtcActivityCandidate", "SDP Content after trim: $sdpReplace")
val sdp = SessionDescription(SessionDescription.Type.OFFER, message.message)
Log.d("WebRtcActivityCandidate", "SessionDescription - ${sdp.description}")
Log.d("WebRtcActivityCandidate", "SessionDescription - ${sdp}")
if (sdp.description.isEmpty()) {
Log.e("WebRtcActivityCandidate", "SDP Description is empty")
}
if (peerConnection == null) {
Log.e("WebRtcActivityCandidate", "PeerConnection is null!")
} else {
Log.d("WebRtcActivityCandidate", "PeerConnection is ready to set remote SDP")
}
val sdpM = sdp
peerConnection?.setRemoteDescription(object : SdpObserver {
override fun onCreateSuccess(p0: SessionDescription?) {}
override fun onSetSuccess() {
Log.d("WebRtcActivityCandidate", "Remote SDP set successfully after delay")
}
override fun onCreateFailure(p0: String?) {
Log.e("WebRtcActivityCandidate", "Failed to create SDP: $p0")
}
override fun onSetFailure(p0: String?) {
Log.e("WebRtcActivityCandidate", "Failed to set remote SDP after delay: $p0, SDP: ${sdp.description}")
Log.e("WebRtcActivityCandidate", "Failed to set remote SDP after delay: $p0")
}
}, sdpM)
}
Код: Выделить всё
SessionDescription - org.webrtc.SessionDescription@9b95f43
12:17:50.737 17462-17462 WebRtcActivityCandidate ru....r.it.service.afreeapplication D PeerConnection is ready to set remote SDP
12:17:50.776 17462-18956 WebRtcActivityCandidate ru....r.it.service.afreeapplication E Failed to set remote SDP after delay: SessionDescription is NULL., SDP: v=0
o=- 5772125125799692495 2 IN IP4 127.0.0.1
s=-
t=0 0
...
Failed to set remote SDP after delay: SessionDescription is NULL.
СПАСИБО!
Подробнее здесь: https://stackoverflow.com/questions/790 ... lwais-null
Мобильная версия