Function: withResyncedAnchor()
function withResyncedAnchor(
state: PlayerState,
position: number,
now: number
): PlayerState;
Defined in: packages/player/src/state.ts:1216
Re-anchor the projection on an authoritative position, without touching any other field.
Used by the one-shot time-pos resync: reading the real position is not an
event, so it does not go through reducePlayerState, but it must
still produce a fresh immutable snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | PlayerState | The snapshot to re-anchor. |
position | number | The authoritative position in seconds. |
now | number | Date.now()-style timestamp the position was read at. |
Returns
A new snapshot, or state if the anchor would not change.