Electron mac sdk can't auto join audio

Description
integrate sdk [v5.0.24433.0616] of electron. In mac platform, app can’t auto join audio event I set it as auto join.
meetingConfig.MeetingConfig_HideMeetingInfoOnMeetingUI({bEnable: false});
this issue only happens in Mac platform.

same Mac computer start same meeting has get different result:
[mac native sdk]

[mac electron sdk]

another issue is virtual background feature does not support video in mac electron sdk.

Hey @guan_bj

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. :slightly_smiling_face:

Checkout this related thread that may have the answer you are looking for:

If this thread did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,
DeveloperBot

Hi @guan_bj,

Thanks for the post. Is the Zoom Mac client’s audio working on your device?

@Carson_Chen My mac computer’s audio works well, since I join with Mac native code it join audio automatically(as the first picture). In fact it works with pre-version sdk 4.6.21666.0428

Thanks for confirming @guan_bj, this feature works well on my side so I’m wondering if you could provide an SDK log for us for further investigation?

Thanks!

@Carson_Chen I fix this issue. I report two bugs
1. mac can’t auto join audio in mac [mac/meeting_service_wrap_core.mm] from: v5.0.24433.0616


2. fail to customize language resource in windows from: the first version
Electron sdk需要修改的地方

  1. zoom_native_sdk_wrap_core.cpp 里的std::string wsTOs(const ZoomSTRING& s)函数
    //保存资源文件的全路径变量
    std::string g_langPath = “”;
    /*

这个函数原始代码有bug,会造成资源路径被转换后变为错的,导致语言资源文件加载失败

*/

std::string wsTOs(const ZoomSTRING& s)

{

int iLength = WideCharToMultiByte(CP_ACP, 0, s.c_str(), -1, NULL, 0, NULL, NULL);

char *pDest = new char[iLength + 1];

pDest[iLength] = ‘\0’;

WideCharToMultiByte(CP_ACP, 0, s.c_str(), -1, pDest, iLength, NULL, NULL);

std::string result(pDest);

return result;

}
ZNSDKError ZNativeSDKWrap::InitSDK(ZNInitParam& initParam)
{
ZOOM_SDK_NAMESPACE::InitParam param;
param.emLanguageID = Map2SDKDefine(initParam.langid);
param.strWebDomain = initParam.domain.c_str();
param.enableLogByDefault = initParam.enable_log;
param.strSupportUrl = initParam.strSupportUrl.c_str();
param.obConfigOpts.customizedLang.langName = wsTOs(initParam.obConfigOpts.customizedLang.langName).c_str();
/*
* 因为wsTOs函数返回的是栈上的临时变量,必须先拷贝到全局变量里,否则后面传给sdk.dll时,栈已经被回收了造成语言文件加载失败。
*/
g_langPath = wsTOs(initParam.obConfigOpts.customizedLang.langInfo).c_str();
param.obConfigOpts.customizedLang.langInfo = g_langPath.c_str();
param.locale = Map2SDKDefine(initParam.locale);
param.uiLogFileSize = initParam.logFileSize;

HMODULE hRes = NULL;
param.uiWindowIconSmallID = IDI_SDK_ICON;
param.uiWindowIconBigID = IDI_SDK_BIG_ICON;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)DummyFunc, &hRes);
param.hResInstance = hRes;
FreeLibrary(hRes);


ZNSDKError err = Map2WrapDefine(ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().InitSDK(
	initParam.path.size() > 0 ? initParam.path.c_str() : NULL, param));
if (ZNSDKERR_SUCCESS == err)
{
	_z_auth_service_wrap.Init();
}
return err;

}

  1. sdk_loader.cpp 里

ZOOM_SDK_NAMESPACE::SDKError CSDKImpl::InitSDK(ZOOM_SDK_NAMESPACE::InitParam& initParam)

{

ZOOM_SDK_NAMESPACE::SDKError ret(ZOOM_SDK_NAMESPACE::SDKERR_UNINITIALIZE);

if (m_fnInitSDK)

{

  //设置语言包

if(initParam.obConfigOpts.customizedLang.langInfo != NULL && strlen(initParam.obConfigOpts.customizedLang.langInfo) > 0)

  {

     initParam.obConfigOpts.customizedLang.langType = (ZOOM_SDK_NAMESPACE::CustomizedLanguageType)1;

  }

  ret = m_fnInitSDK(initParam);

}

return ret;

}

Hi @guan_bj,

Thanks for the reply and the detailed info. Glad to hear that you have found the solution and I will forward this to the engineering team to further investigate and fix them.

Thanks!