声网sdk 一对一log记录,主要看对方点击事件触发的回调方法

左边的500 手机 先打开 最后关闭
2020-09-04 13:57:23.470 29628-29628/io.agora.tutorials1v1vcall D/MyLog: joinChannel() called
2020-09-04 13:57:23.874 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onJoinChannelSuccess() called with: channel = [demoChannel1], uid = [-783830616], elapsed = [425]

右边的250手机 后打开
2020-09-04 13:58:13.019 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onUserJoined() called with: i = [-555464228], i1 = [49568]
2020-09-04 13:58:13.498 19356-19356/io.agora.tutorials1v1vcall D/MyLog: joinChannel() called
2020-09-04 13:58:13.821 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoDecoded() called with: uid = [-555464228], width = [360], height = [640], elapsed = [50372]
2020-09-04 13:58:13.868 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onJoinChannelSuccess() called with: channel = [demoChannel1], uid = [-555464228], elapsed = [382]
2020-09-04 13:58:13.872 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onUserJoined() called with: i = [-783830616], i1 = [383]
2020-09-04 13:58:14.000 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoDecoded() called with: uid = [-783830616], width = [360], height = [640], elapsed = [513]

2020-09-04 13:58:14.275 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoFrame() called with: uid = [-555464228], width = [360], height = [640], elapsed = [50826]
2020-09-04 13:58:14.444 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoFrame() called with: uid = [-783830616], width = [360], height = [640], elapsed = [957]
右边的250手机 先关闭
2020-09-04 13:59:02.382 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onUserOffline() called with: uid = [-555464228], reason = [0]

onUserJoined 与 onFirstRemoteVideoDecoded 方法类同,一个调用,另外一个也会调用。只是 onFirstRemoteVideoDecoded 显示过期。

左边的500 手机 先打开 最后关闭
2020-09-04 13:57:23.470 29628-29628/io.agora.tutorials1v1vcall D/MyLog: joinChannel() called
2020-09-04 13:57:23.874 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onJoinChannelSuccess() called with: channel = [demoChannel1], uid = [-783830616], elapsed = [425]

右边的250手机 后打开
2020-09-04 13:58:13.498 19356-19356/io.agora.tutorials1v1vcall D/MyLog: joinChannel() called
2020-09-04 13:58:13.821 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoDecoded() called with: uid = [-555464228], width = [360], height = [640], elapsed = [50372]
2020-09-04 13:58:13.868 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onJoinChannelSuccess() called with: channel = [demoChannel1], uid = [-555464228], elapsed = [382]
2020-09-04 13:58:14.000 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoDecoded() called with: uid = [-783830616], width = [360], height = [640], elapsed = [513]

2020-09-04 13:58:14.275 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoFrame() called with: uid = [-555464228], width = [360], height = [640], elapsed = [50826]
2020-09-04 13:58:14.444 19356-19398/io.agora.tutorials1v1vcall D/MyLog: onFirstRemoteVideoFrame() called with: uid = [-783830616], width = [360], height = [640], elapsed = [957]

右边的250手机 先关闭
2020-09-04 13:59:02.382 29628-29698/io.agora.tutorials1v1vcall D/MyLog: onUserOffline() called with: uid = [-555464228], reason = [0]

@openim/node-client-sdk是一个Node.js客户端库,用于与OpenIM即时通讯平台进行交互。如果你想监听一个账号在其他平台(如微信、QQ等)上发出的信息,通常情况下,OpenIM提供的服务并不直接支持跨平台的消息同步,因为它们通常是独立的通信系统。 不过,如果你是指在OpenIM内部的不同聊天室或群组里,你可以通过`node-client-sdk`来订阅并获取消息更新。你需要设置好事件处理器,比如当有新消息到达时,它会触发一个回调函数。这个函数会包含发件人信息以及消息内容。 以下是简单的步骤概述: 1. 初始化`node-client-sdk`实例,并连接到你的OpenIM服务器。 ```javascript const OpenIMClient = require('@openim/client-sdk'); const client = new OpenIMClient({ // ...配置项 }); client.connect().then(() => { // ... }); ``` 2. 注册事件监听,例如`onMessageReceived`事件,当有新消息到来时会被触发: ```javascript client.on('messageReceived', (msg) => { if (msg.from && msg.content) { // 检查消息来源和内容 console.log(`来自${msg.from}: ${msg.content}`); } }); ``` 3. 账号要在其他平台发出信息,那应该是用户在该平台操作的结果,而不是SDK直接处理的。你需要在相应的平台上配置用户的在线状态和消息发送,然后由OpenIM服务器转发到正确的接收者。 由于跨平台实时通信通常涉及API接口权限限制和技术难题,你可能需要依赖第三方服务或者API桥接才能实现类似的功能。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值