- Source
Methods
(static) buildConfigFromMetadata(trickplayData, videoID, deviceWidth, initialPosition) → {dynamic}
buildConfigFromMetadata: Extracts and validates trickplay config from item trickplay data
Provides fail-fast validation at config creation time rather than at usage time. Reusable across all content types (movies, episodes, live TV, recordings, etc.)
| Name | Type | Description |
|---|---|---|
trickplayData | object | item.trickplayData AA ({mediaSourceId: {width: TrickplayInfoDto}}) |
videoID | string | Video item ID |
deviceWidth | integer | Device max video width for resolution selection |
initialPosition | integer | Starting playback position in seconds |
- Source
- Valid config object or invalid if trickplay unavailable/invalid
- Type:
- dynamic
(static) buildTrickplayCachePath(videoID, width, tileIndex) → {string}
Builds the cachefs:/ path for storing a trickplay tile
| Name | Type | Description |
|---|---|---|
videoID | String | Jellyfin video item ID |
width | Integer | Resolution width of trickplay images |
tileIndex | Integer | Zero-based tile index |
- Source
- cachefs:/ file path
- Type:
- string
(static) buildTrickplayUrl(videoID, width, tileIndex) → {string}
Builds the Jellyfin API URL for a trickplay tile
| Name | Type | Description |
|---|---|---|
videoID | String | Jellyfin video item ID |
width | Integer | Resolution width of trickplay images |
tileIndex | Integer | Zero-based tile index |
- Source
- API endpoint path
- Type:
- string
(static) calculateClippingRect(thumbnailIndex, tileWidth, tileHeight, thumbWidth, thumbHeight) → {object}
Calculates the clipping rectangle within a tile for a specific thumbnail
| Name | Type | Description |
|---|---|---|
thumbnailIndex | Integer | Zero-based thumbnail index |
tileWidth | Integer | Number of thumbnails per row in tile |
tileHeight | Integer | Number of thumbnail rows in tile |
thumbWidth | Integer | Width of individual thumbnail in pixels |
thumbHeight | Integer | Height of individual thumbnail in pixels |
- Source
- {x, y, width, height} clipping rectangle
- Type:
- object
(static) calculateThumbnailIndex(position, interval) → {integer}
Calculates which thumbnail index corresponds to a given video position
| Name | Type | Description |
|---|---|---|
position | Float | Current video position in seconds |
interval | Integer | Milliseconds between thumbnails |
- Source
- Zero-based thumbnail index
- Type:
- integer
(static) calculateTileIndex(thumbnailIndex, tileWidth, tileHeight) → {integer}
Calculates which tile contains a given thumbnail index
| Name | Type | Description |
|---|---|---|
thumbnailIndex | Integer | Zero-based thumbnail index |
tileWidth | Integer | Number of thumbnails per row in tile |
tileHeight | Integer | Number of thumbnail rows in tile |
- Source
- Zero-based tile index
- Type:
- integer
(static) selectBestResolution(trickplayData, deviceWidth) → {dynamic}
Selects the best trickplay resolution based on device capabilities SD (width 720 or less) uses the smallest available, FHD (width 1920 or more) the largest, and anything between takes the middle one
| Name | Type | Description |
|---|---|---|
trickplayData | Object | Trickplay data object with width keys (for example {"320": {...}, "640": {...}}) |
deviceWidth | Integer | Device max video width (for example 1920 for FHD, 720 for SD) |
- Source
- Best width key to use, or invalid if no data available
- Type:
- dynamic
(static) validateConfig(config) → {boolean}
validateConfig: Validates trickplay configuration object
Ensures all required fields exist and have valid values. Numeric fields must be positive.
| Name | Type | Description |
|---|---|---|
config | object | Config object to validate |
- True if valid, false otherwise
- Type:
- boolean