Created
July 25, 2023 13:46
-
-
Save t57ser/7f9c0dea1b56b50457e73f767b9cedb8 to your computer and use it in GitHub Desktop.
electron issue: videoTrack always has displaySurface set to "monitor"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const electron = require("electron"); | |
const { app, BrowserWindow } = require('electron') | |
let win = null | |
app.whenReady().then(() => { | |
win = new BrowserWindow() | |
win.loadURL('https://github.com') | |
electron.session.defaultSession.setDisplayMediaRequestHandler((request, callback) => { | |
callback({ | |
video: win.webContents.mainFrame, | |
audio: undefined, | |
}); | |
}); | |
electron.session.defaultSession.setPermissionCheckHandler((webContents, permission, requestingOrigin, details ) => { | |
return true; | |
}); | |
electron.session.defaultSession.setPermissionRequestHandler((webContents, permission, callback, details ) => { | |
return callback(true); | |
}); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "main.js", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"devDependencies": { | |
"electron": "26.0.0-beta.7" | |
}, | |
"dependencies": { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment