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

Returns:
Type: 
void

(static) calculateSafetyThreshold() → {integer}

Calculates the safety threshold - how many thumbnails ahead we need to trigger download Formula: thumbsPerTick * ticksToDownload * safetyBuffer

Returns:
  • 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)

Parameters:
NameTypeDescription
thumbnailIndexInteger

Current thumbnail index being displayed

Returns:
  • 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

Returns:
  • 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

Parameters:
NameTypeDescription
thumbnailIndexInteger

Current thumbnail index

Returns:
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

Returns:
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

Parameters:
NameTypeDescription
thumbnailIndexInteger

Current thumbnail position

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

Parameters:
NameTypeDescription
centerThumbnailIndexInteger

New center thumbnail to display

Returns:
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

Returns:
  • 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

Returns:
Type: 
void

(static) onConfigChanged() → {void}

Called when trickplayConfig is set

Returns:
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

Returns:
Type: 
void

(static) onTaskStateChanged() → {void}

Called when tile loader task state changes Handles task completion: updates cache, clears pending, processes queue

Returns:
Type: 
void

(static) onThumbnailIndexChanged() → {void}

Main entry point - called when parent component updates thumbnail index

Returns:
Type: 
void

(static) onVisibilityChanged() → {void}

Called when visible field changes Performs initial tile caching and displays posters when carousel first appears

Returns:
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

Returns:
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

Parameters:
NameTypeDescription
centerThumbnailIndexInteger

Current center thumbnail

Returns:
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

Parameters:
NameTypeDescription
tileIndexInteger

Tile index to preload into texture memory

Returns:
Type: 
void

(static) prioritizeTileQueue(tileIndexes) → {object}

Sorts tile indexes by priority: closest to current position first, then by scrub direction

Parameters:
NameTypeDescription
tileIndexesArray

Array of tile indexes to sort

Returns:
  • 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

Parameters:
NameTypeDescription
loadedTilesAssocArray

Map of tileIndex -> cachePath

Returns:
Type: 
void

(static) requestSingleTile(tileIndex) → {void}

Requests a single tile to be loaded (for immediate needs)

Parameters:
NameTypeDescription
tileIndexInteger

Tile index to load

Returns:
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

Parameters:
NameTypeDescription
tileIndexesArray

Array of tile indexes to load

Returns:
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

Returns:
Type: 
void

(static) startTileLoader(tileIndexes) → {void}

Starts the tile loader task with specified tiles

Parameters:
NameTypeDescription
tileIndexesArray

Array of tile indexes to load

Returns:
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

Returns:
Type: 
void

(static) updateSinglePoster(posterIndex, thumbnailIndex) → {void}

Updates a single poster with a new thumbnail Handles tile loading, clipping calculation, and visibility

Parameters:
NameTypeDescription
posterIndexInteger

Poster array index (0-4)

thumbnailIndexInteger

Thumbnail index to display

Returns:
Type: 
void

(static) updateVelocity(newIndex, oldIndex) → {void}

Updates velocity tracking when thumbnail index changes Uses exponential moving average for smooth velocity estimation

Parameters:
NameTypeDescription
newIndexInteger

New thumbnail index

oldIndexInteger

Previous thumbnail index

Returns:
Type: 
void