- Source
Methods
(static) buildConfigFromMetadata(itemMeta, videoID, deviceWidth, initialPosition) → {dynamic}
buildConfigFromMetadata: Extracts and validates trickplay config from item metadata
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 |
|---|---|---|
itemMeta | object | Item metadata from ItemMetaData() |
videoID | string | Video item ID |
deviceWidth | integer | Device max video width for resolution selection |
initialPosition | integer | Starting playback position in seconds |
- 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 (720p) uses smallest available, FHD (1920p) uses largest, scales between
| Name | Type | Description |
|---|---|---|
trickplayData | Object | Trickplay data object with width keys (e.g., {"320": {...}, "640": {...}}) |
deviceWidth | Integer | Device max video width (e.g., 1920 for FHD, 720 for SD) |
- Source
- Best width key to use, or invalid if no data available
- Type:
- dynamic
(static) thumbnailIndexToPosition(index, interval) → {float}
Converts a thumbnail index to video position in seconds
| Name | Type | Description |
|---|---|---|
index | Integer | Zero-based thumbnail index |
interval | Integer | Milliseconds between thumbnails |
- Source
- Video position in seconds
- Type:
- float
(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