Function: projectPosition()
function projectPosition(state: PlayerState, now: number): number;
Defined in: packages/player/src/state.ts:565
Project the current playback position from state's anchor.
position = anchor.position + (advancing ? (now - anchor.timestamp) / 1000 * anchor.rate : 0), clamped to [0, duration].
Parameters
| Parameter | Type | Description |
|---|---|---|
state | PlayerState | The snapshot to project from. |
now | number | Date.now()-style millisecond timestamp to project to. |
Returns
number
The position in seconds.