mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-13 07:43:43 +08:00
25 lines
678 B
TypeScript
25 lines
678 B
TypeScript
/**
|
|
* Video Source Configuration and Management
|
|
* Handles third-party video API sources with validation and health checks
|
|
*/
|
|
|
|
import type { VideoSource } from '@/lib/types';
|
|
import { DEFAULT_SOURCES } from './default-sources';
|
|
import { PREMIUM_SOURCES } from './premium-sources';
|
|
|
|
/**
|
|
* Get source by ID from both default and premium sources
|
|
*/
|
|
export function getSourceById(id: string): VideoSource | undefined {
|
|
// Search in default sources first
|
|
const defaultSource = DEFAULT_SOURCES.find(source => source.id === id);
|
|
if (defaultSource) {
|
|
return defaultSource;
|
|
}
|
|
|
|
// Search in premium sources
|
|
return PREMIUM_SOURCES.find(source => source.id === id);
|
|
}
|
|
|
|
|