diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-menu/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/presentation-menu/component.jsx index 758f7c665d..aa7fbc2c33 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-menu/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-menu/component.jsx @@ -185,33 +185,41 @@ const PresentationMenu = (props) => { }, }); - toPng(getScreenshotRef(), { - width: window.screen.width, - height: window.screen.height, - }).then((data) => { - const anchor = document.createElement('a'); - anchor.href = data; - anchor.setAttribute( - 'download', - `${elementName}_${meetingName}_${new Date().toISOString()}.png`, - ); - anchor.click(); - - setState({ - loading: false, - hasError: false, + try { + const wbRef = document.getElementById('Navbar')?.nextSibling?.childNodes[1]?.querySelector('[tabindex = "0"]'); + toPng(wbRef, { + width: window.screen.width, + height: window.screen.height, + }).then((data) => { + const anchor = document.createElement('a'); + anchor.href = data; + anchor.setAttribute( + 'download', + `${elementName}_${meetingName}_${new Date().toISOString()}.png`, + ); + anchor.click(); + + setState({ + loading: false, + hasError: false, + }); + }).catch((error) => { + logger.warn({ + logCode: 'presentation_snapshot_error', + extraInfo: error, + }); + + setState({ + loading: false, + hasError: true, + }); }); - }).catch((error) => { + } catch (err) { logger.warn({ logCode: 'presentation_snapshot_error', - extraInfo: error, + extraInfo: err, }); - - setState({ - loading: false, - hasError: true, - }); - }); + } }, }, );