Skip to main content

Variable: BUFFERED_POSITION_STEP

const BUFFERED_POSITION_STEP: 1 = 1;

Defined in: packages/player/src/state.ts:494

How far PlayerState.bufferedPosition must move before the reducer publishes it, in seconds.

Remarks

mpv republishes demuxer-cache-time continuously — ~4-6 broadcasts per second in steady playback, and it keeps filling while paused too. Each accepted value is a fresh PlayerState object and a full state fan-out, so left unquantised this single property makes the "state changes only on discontinuities" contract untrue for the entire life of a session.

One second is chosen, not tuned: it is the granularity every consumer of the value already works at (a buffer bar is a few hundred pixels wide over a multi-minute track; media3's setContentBufferedPositionMs feeds the same bar; the media-session persistence layer rounds to seconds anyway), and it is coarse enough that a 4-6 Hz feed becomes ~1 Hz at the fastest fill and silent at a realistic one.