Skip to content

Instantly share code, notes, and snippets.

@BrandonXLF
Last active November 3, 2023 22:58
Show Gist options
  • Save BrandonXLF/465e91ee96fe29514d4e9d998e590d76 to your computer and use it in GitHub Desktop.
Save BrandonXLF/465e91ee96fe29514d4e9d998e590d76 to your computer and use it in GitHub Desktop.
mp4-handle
const { net, protocol, app, BrowserWindow } = require('electron')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.loadURL('file:///PUT_LOCAL_LOCAL_MP4_FILE');
}
app.whenReady().then(() => {
protocol.handle('file', async (req) => {
return net.fetch(req, {
bypassCustomProtocolHandlers: true
});
});
createWindow();
});
{
"name": "maddening-conversation-phone-kmkem",
"productName": "maddening-conversation-phone-kmkem",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "brand",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "27.0.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment