mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
11 lines
384 B
TypeScript
11 lines
384 B
TypeScript
import { SOURCES, type SourceId } from './sources';
|
|
|
|
export function getMuxAssetId(source: SourceId): string | undefined {
|
|
return SOURCES[source].url.match(/stream\.mux\.com\/([a-zA-Z0-9]+)/)?.[1];
|
|
}
|
|
|
|
export function getMuxPosterSrc(source: SourceId): string | undefined {
|
|
const id = getMuxAssetId(source);
|
|
return id ? `https://image.mux.com/${id}/thumbnail.jpg` : undefined;
|
|
}
|