mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-25 06:35:18 +00:00
* feat: Livekit bare no recording nor pipeline * feat: full livekit pipeline * fix: caddy hatchet with livekit * fix: caddy livekit * fix: hatchet tls * fix: agg to webm for no padding * fix: reflector user id on participants and duration fix * fix: better docs and internal review fixes * fix: remove video files livekit
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
from typing import Dict, Type
|
|
|
|
from ..schemas.platform import (
|
|
DAILY_PLATFORM,
|
|
LIVEKIT_PLATFORM,
|
|
WHEREBY_PLATFORM,
|
|
Platform,
|
|
)
|
|
from .base import VideoPlatformClient, VideoPlatformConfig
|
|
|
|
_PLATFORMS: Dict[Platform, Type[VideoPlatformClient]] = {}
|
|
|
|
|
|
def register_platform(name: Platform, client_class: Type[VideoPlatformClient]):
|
|
_PLATFORMS[name] = client_class
|
|
|
|
|
|
def get_platform_client(
|
|
platform: Platform, config: VideoPlatformConfig
|
|
) -> VideoPlatformClient:
|
|
if platform not in _PLATFORMS:
|
|
raise ValueError(f"Unknown video platform: {platform}")
|
|
|
|
client_class = _PLATFORMS[platform]
|
|
return client_class(config)
|
|
|
|
|
|
def get_available_platforms() -> list[Platform]:
|
|
return list(_PLATFORMS.keys())
|
|
|
|
|
|
def _register_builtin_platforms():
|
|
from .daily import DailyClient # noqa: PLC0415
|
|
from .livekit import LiveKitClient # noqa: PLC0415
|
|
from .whereby import WherebyClient # noqa: PLC0415
|
|
|
|
register_platform(WHEREBY_PLATFORM, WherebyClient)
|
|
register_platform(DAILY_PLATFORM, DailyClient)
|
|
register_platform(LIVEKIT_PLATFORM, LiveKitClient)
|
|
|
|
|
|
_register_builtin_platforms()
|