mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Do nothing if there is 1 second left
This commit is contained in:
parent
64b9ab2a19
commit
7ad7f07b7c
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { PlaybackManager } from './playbackmanager';
|
import { PlaybackManager } from './playbackmanager';
|
||||||
import { TICKS_PER_MILLISECOND } from 'constants/time';
|
import { TICKS_PER_MILLISECOND, TICKS_PER_SECOND } from 'constants/time';
|
||||||
import { MediaSegmentDto, MediaSegmentType } from '@jellyfin/sdk/lib/generated-client';
|
import { MediaSegmentDto, MediaSegmentType } from '@jellyfin/sdk/lib/generated-client';
|
||||||
import { PlaybackSubscriber } from 'apps/stable/features/playback/utils/playbackSubscriber';
|
import { PlaybackSubscriber } from 'apps/stable/features/playback/utils/playbackSubscriber';
|
||||||
import { isInSegment } from 'apps/stable/features/playback/utils/mediaSegments';
|
import { isInSegment } from 'apps/stable/features/playback/utils/mediaSegments';
|
||||||
|
@ -39,8 +39,13 @@ class SkipSegment extends PlaybackSubscriber {
|
||||||
elem.classList.add('skip-button-hidden');
|
elem.classList.add('skip-button-hidden');
|
||||||
|
|
||||||
elem.addEventListener('click', () => {
|
elem.addEventListener('click', () => {
|
||||||
if (this.currentSegment) {
|
const time = this.playbackManager.currentTime() * TICKS_PER_MILLISECOND;
|
||||||
|
if (this.currentSegment?.EndTicks) {
|
||||||
|
if (time < this.currentSegment.EndTicks - TICKS_PER_SECOND) {
|
||||||
this.playbackManager.seek(this.currentSegment.EndTicks);
|
this.playbackManager.seek(this.currentSegment.EndTicks);
|
||||||
|
} else {
|
||||||
|
this.hideSkipButton();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue