Skip to main content

Interface: NativeSleepTimerState

Defined in: packages/media-session/src/specs/media-session.nitro.ts:1026

What the sleep timer is doing right now.

Returned instead of a bare number so the two modes stay distinguishable: a trackEnd timer with an unknown deadline (a live stream, or a track whose duration the app has not broadcast yet) is armed and will fire, and there is no number that says that — undefined would read as "not armed" and 0 as "about to fire".

Properties

mode

mode: SleepTimerMode;

Defined in: packages/media-session/src/specs/media-session.nitro.ts:1027


remainingSeconds?

optional remainingSeconds?: number;

Defined in: packages/media-session/src/specs/media-session.nitro.ts:1035

Seconds until it fires, when that is knowable.

Always present for duration. Present for trackEnd only while the current item has a duration and playback is advancing; omitted otherwise, which means "armed, deadline not computable yet".