LiveStream
app/features/live-streams/core/LiveStream.tsNo overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 loader1 action3 routes6 components2 routines7 other
Types
Live streams of one streamer, most viewed first.
export interface StreamerStreams<T> { streams: [T, ...T[]]; viewerCount: number; }
Functions & values
Where the stream can be watched: the live video when its id is known, otherwise the channel.
export function url(stream: StreamAccount & { videoId?: string | null })
Unit tests (1)
Thumbnail image of a live stream, sized for a stream card.
export function thumbnailSrc(stream: { platform: StreamAccount["platform"]; thumbnailUrl: string; videoId: string | null; })
Unit tests (1)
Identifies the account across sources, Twitch logins being case-insensitive.
export function key({ platform, account }: StreamAccount)
Whether both point to the same account on the same platform.
export function isSameAccount(a: StreamAccount, b: StreamAccount)
Unit tests (1)
Groups the streams of a user live on several platforms together, streams of no user (casts) by their account. Most viewed streamer first.
export function groupByStreamer< T extends StreamAccount & { userId: number | null; viewerCount: number }, >(streams: T[]): StreamerStreams<T>[]