Members
(static, constant) SEGMENT_SKIP_END_OF_MEDIA_SECONDS
How close to the end of the media a skip may land before it counts as reaching the end.
- Default Value
- 5
Methods
(static) findActiveSegment(segments, positionSeconds) → {dynamic}
findActiveSegment: Finds the media segment containing the current playback position.
Linear scan over the segments array (typically 2-5 items). Returns the first segment where StartTicks <= position < EndTicks.
| Name | Type | Description |
|---|---|---|
segments | roArray | Array of MediaSegmentDto objects ({Id, Type, StartTicks, EndTicks}) |
positionSeconds | float | Current playback position in seconds |
The active MediaSegmentDto or invalid if not inside any segment
- Type:
- dynamic
(static) findSegmentById(segments, segmentId) → {dynamic}
findSegmentById: Finds a media segment by its Id.
Linear scan over the segments array (typically 2-5 items). Prefer this over caching segment objects, since the segments array can be replaced during content loading (audio/subtitle track changes).
| Name | Type | Description |
|---|---|---|
segments | roArray | Array of MediaSegmentDto objects |
segmentId | string | The segment Id to find |
The matching MediaSegmentDto or invalid if not found
- Type:
- dynamic
(static) resolveEffectiveSegmentAction(segmentType, userSettings, userConfig, alreadySkipped) → {string}
resolveEffectiveSegmentAction: Resolves the action for a segment, accounting for whether it has already been auto-skipped this playback session.
A Skip-configured segment auto-seeks only on its first pass. Once skipped, rewinding back into it must not re-skip (that would trap the user in a rewind loop), but the user should still get the manual Skip button. So an already-skipped Skip segment degrades to AskToSkip; all other actions pass through unchanged.
| Name | Type | Description |
|---|---|---|
segmentType | string | MediaSegmentType value ("Intro", "Outro", etc.) |
userSettings | object | JellyfinUserSettings node (JellyRock settings) |
userConfig | object | JellyfinUserConfiguration node (web client settings) |
alreadySkipped | boolean | true if this segment already auto-skipped this session |
- MediaSegmentAction value ("None", "AskToSkip", "Skip")
- Type:
- string
(static) resolveSegmentAction(segmentType, userSettings, userConfig) → {string}
resolveSegmentAction: Resolves the action to take for a given media segment type.
Checks JellyRock per-type override setting first, then falls back to web client DisplayPreferences CustomPrefs value, then falls back to built-in defaults.
Built-in defaults: All types = AskToSkip
| Name | Type | Description |
|---|---|---|
segmentType | string | MediaSegmentType value ("Intro", "Outro", etc.) |
userSettings | object | JellyfinUserSettings node (JellyRock settings) |
userConfig | object | JellyfinUserConfiguration node (web client settings) |
- MediaSegmentAction value ("None", "AskToSkip", "Skip")
- Type:
- string
(static) segmentTicksToSeconds(ticks) → {float}
segmentTicksToSeconds: Converts Jellyfin ticks (100-nanosecond units) to seconds.
| Name | Type | Description |
|---|---|---|
ticks | dynamic | Tick count (10,000,000 ticks = 1 second) |
- Position in seconds
- Type:
- float
(static) skipEndsPlayback(segmentEndSeconds, durationSeconds) → {boolean}
skipEndsPlayback: Whether skipping to a segment's end would leave nothing left to play.
A skip seeks to the segment's end. When that is at or near the end of the media, the stream has nothing left to buffer: the player sits in buffering until the stall check reports a playback error, instead of ever reaching finished and moving on. So the caller finishes playback rather than seeking.
Independent of the segment TYPE on purpose. Any segment can run to the end of the file (a Preview after the Outro, credits, a commercial), and what makes the seek unplayable is where it lands, not what the segment was called.
| Name | Type | Description |
|---|---|---|
segmentEndSeconds | float | Where the skip would seek to |
durationSeconds | float | Media duration; 0 or less when unknown |
- true to finish playback, false to seek
- Type:
- boolean
(static) supportsMediaSegments() → {boolean}
supportsMediaSegments: Checks if the connected Jellyfin server supports the MediaSegments API.
The /MediaSegments/{itemId} endpoint was introduced in Jellyfin 10.10.0. Servers below 10.10.0 do not have this endpoint and will return 404.
- true if server supports media segments
- Type:
- boolean