foo-webview-sdk
    Preparing search index...

    Interface PlaybackGetPositionSuccess

    Successful response from playback.getPosition.

    interface PlaybackGetPositionSuccess {
        duration: number;
        hostTime: number;
        path: string;
        position: number;
        subsong: number;
        success: true;
    }
    Index
    duration: number

    Length of the track in seconds; 0 when nothing is playing or the length is unknown.

    hostTime: number

    Host system time when position was read, Unix epoch milliseconds with a fractional part, the same clock as Date.now(). While playing and not paused, position + (Date.now() - hostTime) / 1000 estimates the current position.

    path: string

    Path as foobar2000 stores it, without a subsong suffix; empty when nothing is playing.

    position: number

    Audible position in seconds from the start of the track, already adjusted for output-buffer and DSP latency; do not subtract that latency again. The host advances this reading in steps, typically 10–30 ms apart. It can briefly stall or jump after starting, seeking or resuming, and during crossfades; it is not a sample-accurate clock.

    subsong: number

    Subsong identifier of the track; 0 for a whole file.

    success: true

    Always true here; a failed call resolves with ApiFailure instead.