mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 23:19:42 +00:00
Suppress auto skip for 2s after manual seek
Prevents intro/outro skip from immediately triggering when user uses jump back, prev chapter, or seeks manually into a skip zone.
This commit is contained in:
parent
888852a128
commit
ceeee97e63
1 changed files with 6 additions and 0 deletions
|
|
@ -280,9 +280,11 @@ export default {
|
||||||
this.playerHandler.playPause()
|
this.playerHandler.playPause()
|
||||||
},
|
},
|
||||||
jumpForward() {
|
jumpForward() {
|
||||||
|
this._manualSeekTime = Date.now()
|
||||||
this.playerHandler.jumpForward()
|
this.playerHandler.jumpForward()
|
||||||
},
|
},
|
||||||
jumpBackward() {
|
jumpBackward() {
|
||||||
|
this._manualSeekTime = Date.now()
|
||||||
this.playerHandler.jumpBackward()
|
this.playerHandler.jumpBackward()
|
||||||
},
|
},
|
||||||
setVolume(volume) {
|
setVolume(volume) {
|
||||||
|
|
@ -293,6 +295,7 @@ export default {
|
||||||
this.playerHandler.setPlaybackRate(playbackRate)
|
this.playerHandler.setPlaybackRate(playbackRate)
|
||||||
},
|
},
|
||||||
seek(time) {
|
seek(time) {
|
||||||
|
this._manualSeekTime = Date.now()
|
||||||
this.playerHandler.seek(time)
|
this.playerHandler.seek(time)
|
||||||
},
|
},
|
||||||
playbackTimeUpdate(time) {
|
playbackTimeUpdate(time) {
|
||||||
|
|
@ -568,6 +571,9 @@ export default {
|
||||||
if (!doSkipIntro && !doSkipOutro) return
|
if (!doSkipIntro && !doSkipOutro) return
|
||||||
if (!this.isPlaying || !this.chapters.length) return
|
if (!this.isPlaying || !this.chapters.length) return
|
||||||
|
|
||||||
|
// 用户手动seek后2秒内不触发跳过
|
||||||
|
if (this._manualSeekTime && Date.now() - this._manualSeekTime < 2000) return
|
||||||
|
|
||||||
// 防重入:正在跳过时等待到达目标位置后再解除
|
// 防重入:正在跳过时等待到达目标位置后再解除
|
||||||
if (this._isSkipping) {
|
if (this._isSkipping) {
|
||||||
if (this._skipTarget != null && currentTime >= this._skipTarget - 0.5) {
|
if (this._skipTarget != null && currentTime >= this._skipTarget - 0.5) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue