Package-level declarations

Types

Link copied to clipboard
sealed interface SortPreset

Named sort presets controlling participant ordering.

Properties

Link copied to clipboard

Sorts participants by their ParticipantState.joinedAt, earliest first. Nulls last.

Link copied to clipboard

Sorts participants by name ascending.

Link copied to clipboard

Sorts participants by their ParticipantState.userId ascending (string compare).

Link copied to clipboard

Sorts participants flagged as dominant speaker before the rest.

Link copied to clipboard

Sorts participants currently publishing audio first.

Link copied to clipboard

Sorts participants currently publishing video first.

Link copied to clipboard

Sorts participants with a raised-hand reaction first.

Link copied to clipboard

Sorts screen-sharing participants first.

Link copied to clipboard

Sorts participants currently speaking before silent ones.

Functions

Link copied to clipboard

Sorts participants who have a reaction matching type first.

Link copied to clipboard

Returns a comparator that prioritizes participants holding any of roles.

Link copied to clipboard
fun bySourcePriority(vararg sources: ERROR CLASS: Symbol not found for ParticipantSource): Comparator<ParticipantState>

Returns a comparator that prioritizes participants whose ParticipantState.source matches one of sources, in the given order. Sources not in the list are placed last.

Link copied to clipboard
fun <T> combineComparators(vararg comparators: Comparator<T>): Comparator<T>

Combines multiple comparators in priority order. The first comparator that returns a non-zero result determines the ordering; subsequent comparators are skipped for that pair. Mirrors combineComparators from stream-video-js.

Link copied to clipboard
fun <T> conditional(predicate: (T, T) -> Boolean, comparator: Comparator<T>): Comparator<T>

Returns a comparator that delegates to comparator only when predicate returns true for the pair, otherwise returns 0 (preserving order). Mirrors conditional from stream-video-js.

Link copied to clipboard

Wraps comparator so it only applies when at least one participant in a pair has visibility state VisibilityOnScreenState.INVISIBLE. When both are VisibilityOnScreenState.VISIBLE (or VisibilityOnScreenState.UNKNOWN) the pair is left in place (returns 0). This is the speaker-layout / default-grid stability guarantee.

Link copied to clipboard

Wraps comparator so it applies when at least one participant has visibility state VisibilityOnScreenState.INVISIBLE or VisibilityOnScreenState.UNKNOWN. Stricter than ifInvisible — useful for continuous-scroll grids where off-screen tiles may report UNKNOWN before they ever render. Visible/visible pairs return 0.