New problem with the last version and avatarURL function

Hi! Sometimes when we start a videocall with the last version we get the next error and the videocall can’t start:

2021-12-13T20:57:42.148Z [features/base/app] TypeError: Cannot destructure property ‘avatarURL’ of ‘Bh(…)’ as it is undefined.
at Object.changeLocalAvatarUrl (app.bundle.min.js:138)
at Object.avatar-url (app.bundle.min.js:138)
at app.bundle.min.js:138
at app.bundle.min.js:138
at Set.forEach ()
at see.on (app.bundle.min.js:138)
at Object.init (app.bundle.min.js:138)
at app.bundle.min.js:2
at app.bundle.min.js:138
at app.bundle.min.js:138
at app.bundle.min.js:138
at app.bundle.min.js:138
at app.bundle.min.js:138

We think is something about the avatarUrl function. Here the way that we send that parameter:

Selección_093

We really appreciate your important help!

I have an identical problem when I use IFrame API by meet.jit.si and:

api.executeCommand('avatarUrl', 'https://joseluisandrade.com/alimentar/recursos/imagens/avatar.svg');

@Jose_Luis_Andrade Can you provide an example that reproduces the issue?
We are not able to reproduce it.
One thing I notice from your screenshot is that you set the avatar too early. its just after document ready … Maybe try loading it on videoConferenceJoined, does that work?

1 Like

I opened a new issue:
https://github.com/jitsi/jitsi-meet/issues/10772

As damencho mentioned, your issue is that you are calling it too early.

It will work if you call it on videoConferenceJoined, e.g.

const api = new JitsiMeetExternalAPI(domain, options);

api.addListener('videoConferenceJoined', () => {
    api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647');

Demo: JSFiddle

With this change it already works fine.
Thank you very much for your help!

This problem only arose with Chrome Mac version 97. In firefox and Safari there was never a problem.

Thanks to developpers : this solution works fine for me too !

The downside of this solution is that, when in the PreMeeting screen, the user will think that his AVATAR is wrong. Since it hasn’t been loaded yet. But it solves many cases.

As I really want the avatar to be seen on the preMeeting screen, I set it with a timeout of 1500ms. So far it’s working fine.

setTimeout(() => {
    api.executeCommand('avatarUrl', avatar);
}, 1500);

It would be very helpful to be able to do this:

userInfo: {
  email: 'exemple@exemple.com',
  displayName: 'Nobody',
  avatarUrl: 'URL'
},
1 Like