electron4.1.0 版本调用了leaveChannel方法,onLeaveChannel回调不执行

3个回答
H 回复于 2023-03-24 09:42 · IP属地上海

请确认以下几点:

  • 调用了 leaveChannel 后,我们有等待 onLeaveChannel 回调返回再调用 release 方法吗?如果调用了 leaveChannel 后立即调用 release 方法,SDK 将无法触发 onLeaveChannel 回调。
  • leaveChannel 的返回值是否等于 0 ?如果不等于 0,说明方法调用失败了,请提供具体的错误码。
  • 参考官网 Demo 的 leaveChannel 方法写法,如果还是有问题,请提供 SDK 日志,我们来看下。
回复·5

没有调用release方法,leaveChannel 返回的是0,之前使用的4.0.1版本,更新到了4.1.0就不行了,代码没有动


日志

[2023-03-27 16:20:54.056] [26396] [debug] [iris_logger.cc:92] C:\Users\log/agora-iris.log

[2023-03-27 16:20:54.274] [26396] [debug] [iris_rtc_device_manager_impl.cc:29] IrisRtcDeviceManagerImpl Initialize

[2023-03-27 16:20:54.281] [26396] [debug] [iris_rtc_media_player_impl.cc:32] IrisMediaPlayerImpl Initialize

[2023-03-27 16:20:54.281] [26396] [debug] [iris_rtc_spatial_audio_engine_impl.cc:207] IrisLocalSpatialAudioEngineImpl Initialize

[2023-03-27 16:20:54.281] [26396] [debug] [iris_rtc_media_recoder_impl.cc:19] IrisMediaRecoderImpl Initialize

[2023-03-27 16:20:54.282] [26396] [debug] [iris_rtc_music_center_impl.cc:25] IrisMusicPlayerImpl Initialize

[2023-03-27 16:20:54.282] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

[2023-03-27 16:20:54.283] [26396] [debug] [iris_rtc_engine_impl.cc:114] api name RtcEngine_setAppType params {"appType":3}

[2023-03-27 16:20:54.283] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

[2023-03-27 16:20:54.283] [26396] [debug] [iris_rtc_engine_impl.cc:114] api name RtcEngine_setChannelProfile params {"profile":1}

[2023-03-27 16:20:54.283] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

[2023-03-27 16:20:54.283] [26396] [debug] [iris_rtc_engine_impl.cc:114] api name RtcEngine_setClientRole params {"role":1}

[2023-03-27 16:20:54.290] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}


[2023-03-27 16:20:54.291] [26396] [debug] [iris_rtc_device_manager_impl.cc:43] api name AudioDeviceManager_getPlaybackDeviceInfo params {}

[2023-03-27 16:20:54.292] [26396] [debug] [iris_rtc_device_manager_impl.cc:46] ret 0 result {"deviceId":"{0.0.0.00000000}.{ace9b98d-c65c-4ba1-85ba-ec63b78c3683}","deviceName":"TCL Monitor (英特尔(R) 显示器音频)","result":0}

[2023-03-27 16:20:54.292] [26396] [debug] [iris_rtc_device_manager_impl.cc:43] api name AudioDeviceManager_getRecordingDeviceInfo params {}

[2023-03-27 16:20:54.292] [26396] [debug] [iris_rtc_device_manager_impl.cc:46] ret 0 result {"result":-7}

[2023-03-27 16:20:58.182] [26396] [debug] [iris_rtc_engine_impl.cc:112] api name RtcEngine_joinChannel2 params {"channelId":"ioDj7c6LAWjI0svl","token":"0069***************XyFk","uid":414951480}


[2023-03-27 16:20:58.256] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

[2023-03-27 16:20:58.256] [26396] [error] [rtc_engine_event_handler.cc:112] err 1011 msg

[2023-03-27 16:20:58.256] [26396] [error] [rtc_engine_event_handler.cc:112] err 1012 msg

[2023-03-27 16:20:58.475] [26396] [info] [rtc_engine_event_handler.cc:53] channel ioDj7c6LAWjI0svl uid 414951480

[2023-03-27 16:20:58.782] [26396] [info] [rtc_engine_event_handler.cc:1524] channel ioDj7c6LAWjI0svl uid 414951480 remoteUid 516051809

[2023-03-27 16:21:01.181] [26396] [debug] [iris_rtc_engine_impl.cc:114] api name RtcEngine_leaveChannel2 params {"options":{}}

[2023-03-27 16:21:01.206] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

[2023-03-27 16:21:01.206] [26396] [info] [rtc_engine_event_handler.cc:1316] channel ioDj7c6LAWjI0svl uid 414951480

[2023-03-27 16:21:02.779] [26396] [debug] [iris_rtc_engine_impl.cc:114] api name RtcEngine_leaveChannel2 params {"options":{}}

[2023-03-27 16:21:02.780] [26396] [debug] [iris_rtc_engine_impl.cc:132] ret 0 result {"result":0}

这边用Demo测试是可以的,我们看了下 4.1.0 的 leaveChannel&onLeaveChannel 代码,和 4.0.1 对比没有变动的,应该还是集成的问题。可以对照 demo 检查下,重点看下onLeaveChannel回调是什么时候注册的。

用户538507 回复于 2023-04-04 10:48 · IP属地广东

谢谢,已经解决了。注册放在initialize后面可以了

回复·0
用户538507 回复于 2023-04-04 10:52 · IP属地广东

您好,再请教一个问题MAC电脑上面的问题,打包过后加载SDK提示下面的错误

回复·2

用 demo 直接打包会有问题么?

/build/Release/AgoraDavid.framework/AgoraDav1d: file too short -> AgoraDav1d这个文件咱们修改过么?看起来好像是打包时导入SDK库文件有点问题

谢谢解答,已经解决了。

mac环境下node采用compressing解压SDK会损坏,采用unzip命令解压SDk可以正常运行。