Skip to content

feat: setting which tracks should be considered for seek and autopause#890

Open
rodrigo-suarezmajor wants to merge 1 commit intokillergerbah:mainfrom
rodrigo-suarezmajor:seekable-setting-per-track
Open

feat: setting which tracks should be considered for seek and autopause#890
rodrigo-suarezmajor wants to merge 1 commit intokillergerbah:mainfrom
rodrigo-suarezmajor:seekable-setting-per-track

Conversation

@rodrigo-suarezmajor
Copy link

@rodrigo-suarezmajor rodrigo-suarezmajor commented Feb 21, 2026

Added a setting for deciding which subtitles track should be "seekable" through keyboard shortcuts as well as auto-paused on, as mentionend in #742 #385 #402

Default is to consider only the first track, which imo should be the expected behavior. I didn't manage to implement it in the other playback modes easily, there the previous behavior remains.

Screenshot 2026-02-21 at 21 24 14

@killergerbah
Copy link
Owner

Thanks for this, will review once 1.14 is out

Copy link
Owner

@killergerbah killergerbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really appreciate the PR, fixes a pretty bad issue. Left some minor comments.

playbackRate = 2,
}

export type SeekableTracks = [boolean, boolean, boolean]; // [firstTrack, secondTrack, thirdTrack]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you picked a list of booleans vs a list of numbers? At first thought a list of numbers would generally be more compact, easier to understand and extensible, even if we never extend the list of configurable tracks beyond 3.

}

subtitlesAt(timestamp: number): SubtitleSlice<T> {
subtitlesAt(timestamp: number, seekableTracks?: SeekableTracks): SubtitleSlice<T> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see why seekableTracks is a convenient parameter but from the perspective of just this class it's not completely obvious why seekable should have the same meaning as showing.

Instead of having this parameter I suggest keeping the track seekability logic outside of this class. If it feels like you're repeating a lot of code then it can be extracted into a function.

refreshCurrentSubtitle: boolean;
_preCacheDom;
dictionaryTrackSettings?: DictionaryTrack[];
seekableTracks: () => SeekableTracks;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other subtitle settings are exposed as public fields, curious why you went with a function just for this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants