Files
streamyfin/providers/SyncPlay/constants.ts
2026-06-05 20:00:55 +10:00

24 lines
714 B
TypeScript

/**
* Constants — shared timing/threshold values used across SyncPlay files.
* Kept separate from `types.ts` because these are implementation tuning
* values, not the public protocol/types surface.
*/
import { TicksPerMillisecond } from "./types";
export { TicksPerMillisecond };
/** Default timeout for `waitForEventOnce` (matches jellyfin-web). */
export const WaitForEventDefaultTimeout = 30000;
/** Short-lived timeout for player events (matches jellyfin-web). */
export const WaitForPlayerEventTimeout = 500;
export function ticksToMs(ticks: number): number {
return ticks / TicksPerMillisecond;
}
export function msToTicks(ms: number): number {
return Math.round(ms * TicksPerMillisecond);
}