* @param {string} streamUrl - The URL of the stream to load * @param {number} width - The width of the window * @param {number} height - The height of the window
(streamUrl, width, height)
| 19 | * @param {number} height - The height of the window |
| 20 | */ |
| 21 | async function createWindow(streamUrl, width, height) { |
| 22 | const win = new BrowserWindow({ |
| 23 | title: 'E2B Desktop', |
| 24 | width, |
| 25 | height: height + windowFrameHeight, |
| 26 | webPreferences: { |
| 27 | nodeIntegration: false, |
| 28 | contextIsolation: true, |
| 29 | webviewTag: true, |
| 30 | }, |
| 31 | }) |
| 32 | |
| 33 | console.log('> Loading stream URL...') |
| 34 | await win.loadURL(streamUrl) |
| 35 | console.log(' - Stream URL loaded') |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @param {import('@e2b/desktop').Sandbox} desktop - E2B desktop sandbox |