mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
- Add NEXT_PUBLIC_VIDEO_PLATFORM environment variable support - Create video platform abstraction layer with factory pattern - Implement Whereby and Jitsi platform providers - Update room meeting page to use platform-agnostic component - Add platform display in room management (cards and table views) - Support single platform per deployment configuration - Maintain backward compatibility with existing Whereby integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
846 B
TypeScript
30 lines
846 B
TypeScript
import { VideoPlatform } from "../../api";
|
|
import { VideoPlatformAdapter } from "./types";
|
|
import { localConfig } from "../../../config-template";
|
|
|
|
// Platform implementations
|
|
import { WherebyAdapter } from "./whereby/WherebyAdapter";
|
|
import { JitsiAdapter } from "./jitsi/JitsiAdapter";
|
|
|
|
const platformAdapters: Record<VideoPlatform, VideoPlatformAdapter> = {
|
|
whereby: WherebyAdapter,
|
|
jitsi: JitsiAdapter,
|
|
};
|
|
|
|
export function getVideoPlatformAdapter(
|
|
platform?: VideoPlatform,
|
|
): VideoPlatformAdapter {
|
|
const selectedPlatform = platform || localConfig.video_platform;
|
|
|
|
const adapter = platformAdapters[selectedPlatform];
|
|
if (!adapter) {
|
|
throw new Error(`Unsupported video platform: ${selectedPlatform}`);
|
|
}
|
|
|
|
return adapter;
|
|
}
|
|
|
|
export function getCurrentVideoPlatform(): VideoPlatform {
|
|
return localConfig.video_platform;
|
|
}
|