I'm noob and need your Help
i have this Function here:
async function joinRoom() {
const tokenObj = await generateToken();
await ZegoExpressManager.shared.joinRoom(config.roomID, tokenObj.token, {
userID: config.userID,
userName: config.userName,
});
I need now to Set the last Parameter to this:
[ZegoMediaOptions.AutoPlayAudio, ZegoMediaOptions.PublishLocalAudio]
This is what i tried:
async function joinRoom() {
const tokenObj = await generateToken();
await ZegoExpressManager.shared.joinRoom(config.roomID, tokenObj.token, {
userID: config.userID,
userName: config.userName,
AutoPlayAudio: 1,
PublishLocalAudio: 4,
});
And it not works... The support of the API told me: The Last Parameter is an ArrayType
Please teach me ))
Why don't you look at the TypeScript definition of joinRoom function:
joinRoom(
roomID: string,
token: string,
user: ZegoUser,
options?: ZegoMediaOptions[]
): Promise<boolean>
You can conclude that:
I never used the API, but my attempt would be:
await ZegoExpressManager.shared.joinRoom(
config.roomID,
tokenObj.token,
{
userID: config.userID,
userName: config.userName
},
[ZegoMediaOptions.AutoPlayAudio, ZegoMediaOptions.PublishLocalAudio]
);