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) 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) 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