Disable playback controls while in external player (#909)
This commit is contained in:
@@ -58,7 +58,7 @@ function init () {
|
||||
*/
|
||||
|
||||
ipc.on('onPlayerOpen', function () {
|
||||
menu.setPlayerOpen(true)
|
||||
menu.togglePlaybackControls(true)
|
||||
powerSaveBlocker.enable()
|
||||
shortcuts.enable()
|
||||
thumbar.enable()
|
||||
@@ -70,7 +70,7 @@ function init () {
|
||||
})
|
||||
|
||||
ipc.on('onPlayerClose', function () {
|
||||
menu.setPlayerOpen(false)
|
||||
menu.togglePlaybackControls(false)
|
||||
powerSaveBlocker.disable()
|
||||
shortcuts.disable()
|
||||
thumbar.disable()
|
||||
@@ -126,7 +126,12 @@ function init () {
|
||||
})
|
||||
})
|
||||
|
||||
ipc.on('openExternalPlayer', (e, ...args) => externalPlayer.spawn(...args))
|
||||
ipc.on('openExternalPlayer', (e, ...args) => {
|
||||
menu.togglePlaybackControls(false)
|
||||
thumbar.disable()
|
||||
externalPlayer.spawn(...args)
|
||||
})
|
||||
|
||||
ipc.on('quitExternalPlayer', () => externalPlayer.kill())
|
||||
|
||||
// Capture all events
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
init,
|
||||
setPlayerOpen,
|
||||
togglePlaybackControls,
|
||||
setWindowFocus,
|
||||
setAllowNav,
|
||||
onPlayerUpdate,
|
||||
@@ -24,7 +24,7 @@ function init () {
|
||||
electron.Menu.setApplicationMenu(menu)
|
||||
}
|
||||
|
||||
function setPlayerOpen (flag) {
|
||||
function togglePlaybackControls (flag) {
|
||||
getMenuItem('Play/Pause').enabled = flag
|
||||
getMenuItem('Skip Next').enabled = flag
|
||||
getMenuItem('Skip Previous').enabled = flag
|
||||
|
||||
Reference in New Issue
Block a user