mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-05 13:38:27 +01:00
24 lines
714 B
TypeScript
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);
|
|
}
|