radiant-player / radiant-player-electron

:zap: The future Radiant Player 2.0
https://radiant-player.github.io
32 stars 8 forks source link

Closing window on OSX kills radiant player #13

Open madeleineostoja opened 8 years ago

madeleineostoja commented 8 years ago

Closing the Radiant Player window (just closing, not quitting app) kills the player. When I try to open the app again it throws an exception:

Uncaught Exception:
TypeError: Cannot read property 'webContents' of null
    at send (/Applications/Radiant Player.app/Contents/Resources/app/backend.js:816:40)
    at Object.emit (/Applications/Radiant Player.app/Contents/Resources/app/backend.js:219:13)
    at EventEmitter.<anonymous> (/Applications/Radiant Player.app/Contents/Resources/app/backend.js:855:26)
    at emitTwo (events.js:106:13)
    at EventEmitter.emit (events.js:191:7)
    at /Applications/Radiant Player.app/Contents/Resources/app/node_modules/osx-mouse/index.js:11:9

On El Cap v10.11.6


As an aside, is this project still going ahead? Even in pre-alpha or whatever it's in it looks really promising (this breaking bug aside, obviously). Perf already miles better than old Radiant Player, and no Flash. Would happily use this as my daily driver if just the current limited featureset was stable.

jacobwgillespie commented 8 years ago

Still planning to go ahead yep - I'm fairly busy with full-time employment and part-time school, but definitely planning to finish this up as the "2.0" version of Radiant.

Thank you so much for testing the early release and for the bug report - it's really helpful! I'll see what I can do to get it fixed. I'm assuming we want the close button to "hide" the player window but continue playing music, so I'll see what can be done there...

MarshallOfSound commented 8 years ago

@jacobwgillespie You can call preventDefault on the close event 👍

mainWindow.on('close', (e) => {
  e.preventDefault();
  mainWindow.hide();
});