smov/src/_oldvideo/state/cache.ts
2023-09-02 16:12:57 +02:00

9 lines
321 B
TypeScript

import { VideoPlayerState } from "./types";
export const _players: Map<string, VideoPlayerState> = new Map();
export function getPlayerState(descriptor: string): VideoPlayerState {
const state = _players.get(descriptor);
if (!state) throw new Error("invalid descriptor or has been unregistered");
return state;
}