diff --git a/conference.js b/conference.js index 904737c96..5f7d71f7f 100644 --- a/conference.js +++ b/conference.js @@ -2727,6 +2727,18 @@ export default { */ convertVideoToDesktop: true, + /** + * Callback invoked when the connection has been closed + * automatically. Triggers cleanup of screensharing if active. + * + * @returns {void} + */ + onConnectionClosed: () => { + if (this._untoggleScreenSharing) { + this._untoggleScreenSharing(); + } + }, + /** * Callback invoked to pass messages from the local client back * out to the external client.