Closed kieraneglin closed 8 years ago
Looks like this was an easy fix!
For anyone else with this issue, you can can either disable backgrounding (tells Chromium to not reduce performances (and save CPU cycles) when the window is in background)
Instead of doing that, you can also set the BrowserWindow visibility state to always be in the "visible" state. This saves CPU cycles, but occasionally causes freezing upon your app regaining focus
I got this solution from pracucci.com
var app = require("app");
app.commandLine.appendSwitch("disable-renderer-backgrounding");
app.on("ready", function () {
// ...
});
new BrowserWindow({
"web-preferences": {
"page-visibility": true
},
// ...
});
When using the default implementation:
the file plays fine when window is in focus, but when focus is lost, playback stops after a few seconds.
Playback resumes immediately when the window is back in focus, or when I switch between apps.
No errors are being thrown