Methods
(static) calculateDisplayDimensions() → {void}
Calculates display dimensions for thumbnails based on actual aspect ratio from trickplay metadata Keeps widths fixed (320 for sides, 480 for center) and calculates heights to preserve aspect ratio This ensures thumbnails from any video aspect ratio (16:9, 4:3, 21:9, etc.) display correctly
- Type:
- void
(static) calculateSafetyThreshold() → {integer}
Calculates the safety threshold - how many thumbnails ahead we need to trigger download Formula: thumbsPerTick * ticksToDownload * safetyBuffer
- Thumbnail count threshold for triggering next tile download
- Type:
- integer
(static) calculateThumbsUntilBoundary(thumbnailIndex) → {integer}
Calculates how many thumbnail STEPS until we need to load a different tile Used for proactive tile downloading based on velocity and scrub direction
Examples (100 thumbs per tile): Forward at index 99 (last in tile 0): returns 1 (next step enters tile 1) Backward at index 100 (first in tile 1): returns 1 (next step enters tile 0) Forward at index 50 (mid tile 0): returns 50 (50 steps until tile 1)
| Name | Type | Description |
|---|---|---|
thumbnailIndex | Integer | Current thumbnail index being displayed |
- Number of thumbnail steps until crossing tile boundary
- Type:
- integer
(static) calculateTilesNeeded() → {integer}
Calculates how many tiles ahead to preload based on current velocity Uses the formula: tilesNeeded = ceil(downloadTime / timeToNextTile) + 1
- Number of tiles to preload in scrub direction
- Type:
- integer
(static) checkProactiveTileRequest(thumbnailIndex) → {void}
Proactively checks if we need to request the next tile based on velocity Called on every thumbnail index change - the KEY function for smooth scrubbing Uses formula: if thumbsUntilBoundary < safetyThreshold → request next tile NOW
| Name | Type | Description |
|---|---|---|
thumbnailIndex | Integer | Current thumbnail index |
- Type:
- void
(static) destroy() → {void}
destroy: Full teardown releasing all resources before component removal Called by parent when popping scene or navigating away Clears task nodes, observers, all node refs, and data structures
- Type:
- void
(static) ensureTilesCachedAroundPosition(thumbnailIndex) → {void}
Immediately ensures tiles are cached around the given thumbnail position Called when carousel becomes visible to prepare for ANY scrub direction Requests current tile ± 2 tiles to cover both forward and backward scrubbing
| Name | Type | Description |
|---|---|---|
thumbnailIndex | Integer | Current thumbnail position |
- Type:
- void
(static) fullRecalculatePosters(centerThumbnailIndex) → {void}
Recalculates and loads all 5 posters for a new center thumbnail index Called on every thumbnail index change - we always recalculate all 5 because center poster (480x270) has different display properties than sides (320x180)
| Name | Type | Description |
|---|---|---|
centerThumbnailIndex | Integer | New center thumbnail to display |
- Type:
- void
(static) getNextTileToPreload() → {integer}
Determines which tile to preload - always ONE TILE AHEAD of the edge poster The preloader must finish loading BEFORE the edge poster needs the tile Edge poster = rightmost (FF) or leftmost (RW) visible poster
- Tile index to preload, or -1 if none needed
- Type:
- integer
(static) init() → {void}
Trickplay carousel component - displays 5 thumbnails above the trickPlayBar Uses index-based thumbnail shifting for efficient updates
- Type:
- void
(static) onConfigChanged() → {void}
Called when trickplayConfig is set
- Type:
- void
(static) onPlaybackPositionChanged() → {void}
Called when playback position changes during normal video playback Proactively caches tiles around current position so they're ready when user scrubs Only triggers when crossing into a new tile to avoid excessive requests
- Type:
- void
(static) onTaskStateChanged() → {void}
Called when tile loader task state changes Handles task completion: updates cache, clears pending, processes queue
- Type:
- void
(static) onThumbnailIndexChanged() → {void}
Main entry point - called when parent component updates thumbnail index
- Type:
- void
(static) onVisibilityChanged() → {void}
Called when visible field changes Performs initial tile caching and displays posters when carousel first appears
- Type:
- void
(static) performEarlyCaching() → {void}
Performs early tile caching when config is loaded (before carousel is visible) Uses initialPosition from config to cache tiles around the starting playback position This ensures tiles are ready before the user starts scrubbing
- Type:
- void
(static) preloadAdjacentTiles(centerThumbnailIndex) → {void}
Preloads tiles adjacent to current position for smooth scrubbing Uses velocity-based calculation to determine how many tiles ahead to preload Prioritizes tiles in the scrub direction
| Name | Type | Description |
|---|---|---|
centerThumbnailIndex | Integer | Current center thumbnail |
- Type:
- void
(static) preloadTextureForTile(tileIndex) → {void}
Preloads a tile's texture into GPU memory via the hidden preloader poster This warms Roku's texture cache so visible posters display instantly
| Name | Type | Description |
|---|---|---|
tileIndex | Integer | Tile index to preload into texture memory |
- Type:
- void
(static) prioritizeTileQueue(tileIndexes) → {object}
Sorts tile indexes by priority: closest to current position first, then by scrub direction
| Name | Type | Description |
|---|---|---|
tileIndexes | Array | Array of tile indexes to sort |
- Sorted array of tile indexes
- Type:
- object
(static) refreshPostersWithNewTiles(loadedTiles) → {void}
Refreshes posters that were waiting for newly loaded tiles Only updates posters that have thumbnails in the newly loaded tiles
| Name | Type | Description |
|---|---|---|
loadedTiles | AssocArray | Map of tileIndex -> cachePath |
- Type:
- void
(static) requestSingleTile(tileIndex) → {void}
Requests a single tile to be loaded (for immediate needs)
| Name | Type | Description |
|---|---|---|
tileIndex | Integer | Tile index to load |
- Type:
- void
(static) requestTiles(tileIndexes) → {void}
Requests multiple tiles to be loaded via queue system Prevents request cancellation by queuing instead of stopping in-flight requests
| Name | Type | Description |
|---|---|---|
tileIndexes | Array | Array of tile indexes to load |
- Type:
- void
(static) reset() → {void}
reset: Clears all caches when video session ends Called by parent VideoPlayerView when video changes or stops Prevents unbounded cache growth across multiple videos in binge-watching sessions
- Type:
- void
(static) startTileLoader(tileIndexes) → {void}
Starts the tile loader task with specified tiles
| Name | Type | Description |
|---|---|---|
tileIndexes | Array | Array of tile indexes to load |
- Type:
- void
(static) updateClipGroupsForAspectRatio() → {void}
Updates clip group rectangles and positions based on calculated display dimensions Adjusts vertical positions to keep thumbnails vertically centered regardless of aspect ratio
- Type:
- void
(static) updateSinglePoster(posterIndex, thumbnailIndex) → {void}
Updates a single poster with a new thumbnail Handles tile loading, clipping calculation, and visibility
| Name | Type | Description |
|---|---|---|
posterIndex | Integer | Poster array index (0-4) |
thumbnailIndex | Integer | Thumbnail index to display |
- Type:
- void
(static) updateVelocity(newIndex, oldIndex) → {void}
Updates velocity tracking when thumbnail index changes Uses exponential moving average for smooth velocity estimation
| Name | Type | Description |
|---|---|---|
newIndex | Integer | New thumbnail index |
oldIndex | Integer | Previous thumbnail index |
- Type:
- void