Remove beforeRouteLeave in ft-video-player as it is never called (#3213)

This commit is contained in:
absidue 2023-02-27 02:03:26 +01:00 committed by GitHub
parent 290435d545
commit d6b355082a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 17 deletions

View File

@ -20,23 +20,6 @@ import { getPicturesPath, showSaveDialog, showToast } from '../../helpers/utils'
export default defineComponent({
name: 'FtVideoPlayer',
beforeRouteLeave: function () {
document.removeEventListener('keydown', this.keyboardShortcutHandler)
if (this.player !== null) {
this.exitFullWindow()
}
if (this.player !== null && !this.player.isInPictureInPicture()) {
this.player.dispose()
this.player = null
} else if (this.player.isInPictureInPicture()) {
this.player.play()
}
if (process.env.IS_ELECTRON && this.powerSaveBlocker !== null) {
const { ipcRenderer } = require('electron')
ipcRenderer.send(IpcChannels.STOP_POWER_SAVE_BLOCKER, this.powerSaveBlocker)
}
},
props: {
format: {
type: String,
@ -332,6 +315,7 @@ export default defineComponent({
}
},
beforeDestroy: function () {
document.removeEventListener('keydown', this.keyboardShortcutHandler)
if (this.player !== null) {
this.exitFullWindow()