Not receiving events from JitsiMeetExternalAPI in Angular 1.5 component

First of all, Jitsi is spectacular and I’m really grateful for it. It’s covering all my needs out of the box, so that’s phenomenal.

However I’m having trouble with my implementation where events are seemingly never dispatched.
I’ve tried creating a minimal test in JSFiddle and it worked there. In my actual dev environment though it appears as if no events are ever received. This is happening in an Angular 1.5 component controller script: It queries for the div created in the template and instantiates JitsiMeetExternalAPI “by the book”.

I’m on my way reading through the source but from the public API level it seems like the events I am looking for (audioMuteStatusChanged, videoMuteStatusChanged) are expected to be first received by the Transport, and then forwarded to the local API instance’s emit implementation. I made some modifications of the prototype at runtime to observe the behavior and it looks to me like the listener registered with _transport.on("event", ...) in _setupListeners never receives any events.

Without having dug deeper, it looks to me like Transport is some kind of low level event bus that also handles remote events, so the actual source of the audio-mute-status-changed event is serverside…?

I realize this is a very general question, but what have you encountered that could cause the transport to fail in my environment? I’ve looked at the verbose logs coming through and I’m not seeing any error messages, so I’m really puzzled right now.

Thanks!

– Andreas R

Are you expecting these events on startup, maybe you are attaching the listeners late? Do you receive them later when muting/unmuting …

I’m expecting the events when the user interacts with the GUI, so I’m not expecting them until later. I attach the listeners immediately after the API has been created. I suspected for a bit I was attaching them too soon actually, so I moved the event setup to the iframe onload handler, but that didn’t change anything for me.

Ok after further testing, it seems the issue is to do with JitsiMeetExternalAPI being instantiated and listeners set up in the controller for an Angular 1.5 component in ServiceNow. I moved all the source out to a script node in the HTML and the events fire as normal in that context. This is unfortunately not a solution since I need the events to propagate back to the controller in a clean way.

Really puzzling stuff but also hard for me to expect you guys to really know what’s going on here. I’ll keep investigating and report back as i discover more.

Yeah I’m going to chalk this up to Angular 1 idiosyncrasies being the issue. I’m now initializing Jitsi in the surrounding HTML and using the Angular API to broadcast events into the Angular scope I need them. It’s a nasty hack tbh but it solves the issue as it stands.