This commit is contained in:
Avently
2024-06-03 18:13:28 +07:00
parent d095672f00
commit 33c4ea3940
4 changed files with 8 additions and 6 deletions

View File

@@ -115,7 +115,7 @@ actual fun ActiveCallView() {
Log.d(TAG, "received from WebRTCView: $apiMsg")
val call = chatModel.activeCall.value
if (call != null) {
Log.d(TAG, "has active call $call")
Log.d(TAG, "has active call callState: ${call.callState}, localMedia: ${call.localMedia}, peerMedia: ${call.peerMedia}, audioEnabled: ${call.audioEnabled}, connectionInfo: ${call.connectionInfo}")
val callRh = call.remoteHostId
when (val r = apiMsg.resp) {
is WCallResponse.Capabilities -> withBGApi {

View File

@@ -7,15 +7,17 @@ const socket = new WebSocket(`ws://${location.host}`);
socket.addEventListener("open", (_event) => {
console.log("Opened socket");
sendMessageToNative = (msg) => {
console.log("Message to server");
var _a;
console.log(`Message to server will be sent: ${(_a = msg.command) === null || _a === void 0 ? void 0 : _a.type}`);
socket.send(JSON.stringify(msg));
};
});
socket.addEventListener("message", (event) => {
var _a;
const parsed = JSON.parse(event.data);
reactOnMessageFromServer(parsed);
processCommand(parsed);
console.log("Message from server");
console.log(`Message from server finished processing: ${(_a = parsed.command) === null || _a === void 0 ? void 0 : _a.type}`);
});
socket.addEventListener("close", (_event) => {
console.log("Closed socket");

View File

@@ -30,7 +30,7 @@ actual fun ActiveCallView() {
Log.d(TAG, "received from WebRTCController: $apiMsg")
val call = chatModel.activeCall.value
if (call != null) {
Log.d(TAG, "has active call $call")
Log.d(TAG, "has active call callState: ${call.callState}, localMedia: ${call.localMedia}, peerMedia: ${call.peerMedia}, audioEnabled: ${call.audioEnabled}, connectionInfo: ${call.connectionInfo}")
val callRh = call.remoteHostId
when (val r = apiMsg.resp) {
is WCallResponse.Capabilities -> withBGApi {

View File

@@ -8,7 +8,7 @@ const socket = new WebSocket(`ws://${location.host}`)
socket.addEventListener("open", (_event) => {
console.log("Opened socket")
sendMessageToNative = (msg: WVApiMessage) => {
console.log("Message to server")
console.log(`Message to server will be sent: ${msg.command?.type}`)
socket.send(JSON.stringify(msg))
}
})
@@ -17,7 +17,7 @@ socket.addEventListener("message", (event) => {
const parsed = JSON.parse(event.data)
reactOnMessageFromServer(parsed)
processCommand(parsed)
console.log("Message from server")
console.log(`Message from server finished processing: ${parsed.command?.type}`)
})
socket.addEventListener("close", (_event) => {