readyToClose event listener not working from me in Iframe

Hi ,
readyToClose event listener not firing when participant left from the room.
My sample code:
function listenerHangup() {
window.open(“https://jitsiembed.freesoftware/","_self”);
}

      function listenerJoined() {
         console.log('A participant has joined to the room');
      }

      api.addEventListeners({
          readyToClose: listenerHangup,
          videoConferenceJoined: listenerJoined
        });

addEventListeners is incorrect. You should use addListener or on.