| 19 | type Provider = "bilibili" | "youtube"; |
| 20 | |
| 21 | interface ProviderConfig { |
| 22 | /** Embeddable player URL. Autoplay is only requested after a user gesture. */ |
| 23 | embedUrl: (id: string, autoplay: boolean) => string; |
| 24 | /** Canonical watch page — the load-failure / slow-network fallback link. */ |
| 25 | watchUrl: (id: string) => string; |
| 26 | /** Human label for the fallback link ("在 Bilibili 观看"). */ |
| 27 | siteName: string; |
| 28 | /** Validates the id shape so a typo renders a notice, not a broken frame. */ |
| 29 | isValidId: (id: string) => boolean; |
| 30 | } |
| 31 | |
| 32 | const PROVIDERS: Record<Provider, ProviderConfig> = { |
| 33 | bilibili: { |
nothing calls this directly
no outgoing calls
no test coverage detected