Stop power save blocker on route leave

This commit is contained in:
Preston 2021-01-13 15:56:25 -05:00
parent 0295354ffd
commit 5663d56b12
1 changed files with 10 additions and 0 deletions

View File

@ -28,6 +28,11 @@ export default Vue.extend({
} else if (this.player.isInPictureInPicture()) { } else if (this.player.isInPictureInPicture()) {
this.player.play() this.player.play()
} }
if (this.usingElectron && this.powerSaveBlocker !== null) {
const { powerSaveBlocker } = require('electron')
powerSaveBlocker.stop(this.powerSaveBlocker)
}
}, },
props: { props: {
format: { format: {
@ -172,6 +177,11 @@ export default Vue.extend({
clearTimeout(this.mouseTimeout) clearTimeout(this.mouseTimeout)
} }
} }
if (this.usingElectron && this.powerSaveBlocker !== null) {
const { powerSaveBlocker } = require('electron')
powerSaveBlocker.stop(this.powerSaveBlocker)
}
}, },
methods: { methods: {
initializePlayer: async function () { initializePlayer: async function () {