mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-10 00:02:16 +08:00
💦 播放速度
This commit is contained in:
@@ -75,7 +75,6 @@ function createMini () {
|
||||
}
|
||||
|
||||
app.allowRendererProcessReuse = true
|
||||
app.commandLine.appendSwitch('--no-sandbox')
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
@@ -154,6 +153,22 @@ if (!gotTheLock) {
|
||||
mini.webContents.send('down', 0)
|
||||
}
|
||||
})
|
||||
globalShortcut.register('shift+up', function () {
|
||||
if (win) {
|
||||
win.webContents.send('playbackRateUp', 0)
|
||||
}
|
||||
if (mini) {
|
||||
mini.webContents.send('playbackRateUp', 0)
|
||||
}
|
||||
})
|
||||
globalShortcut.register('shift+down', function () {
|
||||
if (win) {
|
||||
win.webContents.send('playbackRateDown', 0)
|
||||
}
|
||||
if (mini) {
|
||||
mini.webContents.send('playbackRateDown', 0)
|
||||
}
|
||||
})
|
||||
if (!process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
createProtocol('app')
|
||||
}
|
||||
|
||||
@@ -411,6 +411,15 @@ export default {
|
||||
this.right.historyData = e.reverse()
|
||||
})
|
||||
})
|
||||
},
|
||||
playbackRateEvent (e) {
|
||||
let rate = this.xg.playbackRate
|
||||
if (rate > 0.25) {
|
||||
rate = rate + e
|
||||
this.xg.playbackRate = rate
|
||||
// this.xg.video.playbackRate = rate
|
||||
console.log(rate, 'rate')
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -432,6 +441,22 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
ipc.on('playbackRateUp', () => {
|
||||
console.log('opacity up')
|
||||
if (this.xg) {
|
||||
if (this.xg.hasStart) {
|
||||
this.playbackRateEvent(0.25)
|
||||
}
|
||||
}
|
||||
})
|
||||
ipc.on('playbackRateDown', () => {
|
||||
console.log('opacity down')
|
||||
if (this.xg) {
|
||||
if (this.xg.hasStart) {
|
||||
this.playbackRateEvent(-0.25)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user