nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
129 stars 36 forks source link

disconnected event never fired #120

Open gavalierm opened 2 years ago

gavalierm commented 2 years ago

EDIT: Disconnected event is fired ONCE as very first "connection problem", when library is in "reconnecting" state (every second try to reconnect) no Disconnected event is fired.

I think it will be have "Reconnecting" event for handle this state.

My quick fix is this:

myAtem.on('info', (data) => {
    console.log(data);
    if (data === "reconnect") {
        console.log("Atem reconnecting");
        socket.emit("atem_down"); 
    }
});